Skip to Content
avatar image
Former Member

JSON_VALUE function in Store Procedure

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
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 05, 2017 at 08:47 PM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 07, 2017 at 03:54 PM

    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

    Add comment
    10|10000 characters needed characters exceeded