Skip to Content
0

JSON_VALUE function in Store Procedure

Aug 04, 2017 at 05:49 PM

79

avatar image
Former Member

I want to create the store procedure but failed to create. my code:

CREATE PROCEDURE "TESTING"."SCALAR_VARIABLE_EXAMPLE_INSERT" (IN paramin NVARCHAR(5000))
                LANGUAGE SQLSCRIPT
                SQL SECURITY INVOKER
                AS
BEGIN
                DECLARE username varchar(20) := 'bobbyss';
                DECLARE description varchar(100);
                description := 'select JSON_VALUE('''||:paramin||''', ''$.description'') AS "desc" from DUMMY';
                INSERT INTO "TESTING"."USER" VALUES (:username, :description);
END;

When I call this procedure, show SQL syntax error: incorrect syntax near "select". How to fix this problem? Thanks.

SQL
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Christoph Gilde
Aug 05, 2017 at 08:47 PM
1
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 07, 2017 at 03:54 PM
0

Hi Glide,

in the post from stackoverflow's you shared, that is my post. the last answer cannot fix my problem. any solution? thanks.

Regards,

Bobby

Share
10 |10000 characters needed characters left characters exceeded