User Profile
Collapse
-
you may also want to colesce on nullable columns to make sure it concatanates correctly -
-
Wrap everything in a BEGIN ATOMIC, that will cause the rollback to rollback every thing. Create a SQL EXCEPTION hander and in that do your rollback. any SQL inside the BEGIN ATOMIC will get rolled backLeave a comment:
-
is there a size restriction to a SQL stored proc?
durring the build of the proc it was erroring out and i removed some blanks and un-need varables and it built further, i finally removed all comments , etc and it successfully built, is there a size restriction and/or a setting that can be increased? -
SQL PL - Continue Handler and the use of FOR LOOP
i have a stored proc that is using a FOR loop , and for each row inserts, is there a way to have a contiue handler on -803 , that will allow the for loop to contiue past that record and keep inserting?
example:
FOR V_LOOP AS
SELECT ...FROM Table A
do
Insert into Table B (....) values ( v_loop.....);
end for; -
Temp Table - check if exists
is there a way in an SQL stored proc to determine if a temp table exists before selecting from it....I have a java app. that is calling a stored proc. i want to check if Java created the table before calling the proc , if so i want to use the values in the temp table, else i will dummy them out in the proc. -
look at the CASE function.... you may have to update all 3 columns and set them back to there current value if they dont pass the case expressionLeave a comment:
-
have you tried using the merge statement.....i f matched update table a else update table bLeave a comment:
-
have you tried using Sequences....yo u could use NEXTVAL in A_SW and use PREVAL for the rows you insert into B_SWLeave a comment:
-
How have you defined your INTO varable?
it might be easier to create a varable for the null indicator...
Example:
05 WS-MNGRNO-NULL PIC S9(04) COMP VALUE +1.
in your fetch....
fetch into :WS-MGRNO :WS-MGRNO-NULL
then if WS-MGRNO-NULL is less than zero you know its null....Leave a comment:
-
DB2 trigger HELP
is there a way in a trigger to get the statement (sql) that cuased the trigger to fire?? -
DB2 triggers question
In a Trigger, is there a way to pull the actual SQL statement that caused the trigger to fire? -
SQL Stored Procs
Is there a way to set the ASUTIME limit on a SQL stored proc running on the LUW platform?
No activity results to display
Show More
Leave a comment: