Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

JSON_VALUE function in Store Procedure

Former Member
0 Likes
862
  • SAP Managed Tags

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.

2 REPLIES 2
Read only

Former Member
0 Likes
606
  • SAP Managed Tags

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