Sqlx Call store procedure with json input

We are using Sqlx library .
we have create store procedure which take json as a input parameter .

we are try to call by using following command
input := {“code”:2001,“EmailID”:“abcd”,“MobileNumber”:1234567890,“StudentPassword”:“Abcd1234”}
_,err = easyglobal.Mydb.Exec( “CALL IU_Registration (?)”, input)

this procure insert record in the table .

this command execute but it is not inserting any record in side the table .

we are not getting any error

If you call the procedure manually from some interactive program where you can write and execute SQL queries (like SQL Server Management Studio in the case of SQL Server, pgAdmin for Postgres, etc.), does it work?

If you query rows from easyglobal.Mydb, do you get any results?

What if you execute a plain old INSERT instead of calling a stored procedure; does that work?

Yes. it is working in workbench
CALL IU_Registration(’{“Aadhaar”:2001,“EmailID”:“abcd”,
“MobileNumber”:1234567890,“StudentPassword”:“Abcd1234”,“mode”:“INSERT”}’)

This is work bench output
2001;abcd;1234567890;Abcd1234

Thanks for you quick reponse.

Hi,

I think I have identified the problem . it is adding “” character in json
CALL IU_Registration (’ {“Aadhaar”:2001,“EmailID”:“abcd”,“MobileNumber”:1234567890,“StudentPassword”:“Abcd1234”} ')

how I can remove this character from json .

It is adding “backslah” Character in json .
How to remove Backslash character from json in golang .

I’m not sure what you mean; can you paste your code and the JSON between triple backticks like this:

```
code here
```

Thanks for your quick response.

It is solved.In our Json string there is backslash character. We have removed backslash character from Json string.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.