Hello,
I have an SQL proc that builds a SELECT statement in a VARCHAR variable and then executes it via a cursor.
The SQL being built has a syntax error and I am having a hard time finding it, I really need the SQL it is running to find it but I don't know how I can get a hold of it?
I've run the proc in debug and I can see the statement but I can't work with it and I can't see any option to output an EVAL to a print or anything.
I have tried creating a variable of the same type and just before the SQL variable is used in the PREPARE statement I run a SET to set my variable with the SQL but for some reason the variable isn't set - having tested it, despite it saying in my job log "variable set successfully", the variable seems to only be set if the SQLPROC finishes normally.
Any ideas?
Cheers,
Ryan
I have an SQL proc that builds a SELECT statement in a VARCHAR variable and then executes it via a cursor.
The SQL being built has a syntax error and I am having a hard time finding it, I really need the SQL it is running to find it but I don't know how I can get a hold of it?
I've run the proc in debug and I can see the statement but I can't work with it and I can't see any option to output an EVAL to a print or anything.
I have tried creating a variable of the same type and just before the SQL variable is used in the PREPARE statement I run a SET to set my variable with the SQL but for some reason the variable isn't set - having tested it, despite it saying in my job log "variable set successfully", the variable seems to only be set if the SQLPROC finishes normally.
Any ideas?
Cheers,
Ryan
Comment