im not able to execute this query held in stem vars through REXX
there are syntaxes in IBM manual for executing statements in a single variable like given below
statement = "UPDATE STAFF SET JOB = 'Clerk' WHERE JOB = 'Mgr'"
CALL SQLEXEC 'EXECUTE IMMEDIATE :statement'
IF ( SQLCA.SQLCODE < 0) THEN
SAY 'Update Error: SQLCODE = ' SQLCA.SQLCODE
But Im not able to execute the above syntax for query held in a stem
I tried to do use the below syntax too
CALL SQLEXEC ':ARR.1 :ARR.2 :ARR.3 :ARR.4"
but still it give syntax error
Concateneting the stem variable into a single variable and executing it wont serve my purpose
is there any way to execute a query held in stem varable or in multiple variables??
this is because my query is not so small as given below..it may extend to more than 500 letters of code
It can be an insert query which can amount to more than more than 1000 letters and if Im correct a rexx variable can only hold 255 letters (im not sure on this).
Is there any upper limit regarding the letters or bytes which a variable can hold?
If no, then Concateneting the stem variable into a single variable and executing it maybe a temporary solution to my problem
Im executing the DB2 statements in rexx using DSNREXX..
How can I execute the query after writing it into a dataset? are you suggesting to use a job to execute this query?thats also one possible solution...
i will try the other method and post the results anyways? But will concatenation help in executing a big query?
as of now concatenating the stem variables into a single variable seems to work...i concatenated and executed queries with some 200-300 line length..seems to be fine.....hope no probs arise in the long run