Skip to Content
-1

How to call procedure by parameter fields using EXEC/EXECUTE IMMEDIATE statement ?

Example PROCEDURE
CREATE PROCEDURE test1(IN run1 date (30)) LANGUAGE SQLSCRIPT as --reads SQL DATA AS BEGIN DECLARE lv; lv := 'SELECT * from "OTEST" where "Date1" = '||:run1|| ''; EXECute immediate (:lv); END;

PROCEDURE created successfully;

How call a procedure ex: call test1 ('Good');

error msg :

SAP DBTech JDBC: [260]: invalid column name: "FINAL"."TEST1": line 11 col 1 (at pos 218): [260] (range 3) invalid column name exception: invalid column name: Good: line 1 col 41 (at pos 40) ;

Please help me.

I need to find a solution.

I HAVE DONE USING SQL DECLARE FUNCTION IN EXEC.

HOW TO DO IT HANA QUERY?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Mar 12 at 12:26 PM

    Your dynamic SQL (:lv) is wrong. if Good is a column name it will require double quotes around it, if its a string, single quotes.

    Michael

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.