Hi Guys,
I have written a stored procedure having couple of insert and delete statements
example:
delete from mastertable1; //delete the records from master table
insert into mastertable1 select *from temptable1;
delete from temptable1; //delete the records from temp table
delete from mastertable2;
insert into mastertable2 select *from temptable2;
delete from temptable2;...
User Profile
Collapse
-
get the latest changed records
Hi,
I hava a table with the following information
[code=sql]
CREATE TABLE TEMP1 (REFID INT, REVISION INT, FIELDNAM VARCHAR(10), VALUE VARCHAR(10));
INSERT INTO TEMP1 VALUES(1001, 0, 'A', 'A2');
INSERT INTO TEMP1 VALUES(1001, 0, 'C', 'C2');
INSERT INTO TEMP1 VALUES(1001, 0, 'E', 'E2');
INSERT INTO TEMP1 VALUES(1002, 0, 'A', 'A3');
INSERT INTO TEMP1 VALUES(1002, 0, 'B', 'B2');
... -
Help ... Rollback Transaction
I am new to db2 and want to know more about rollback and exception handling....
I am using AS/400 operations navigator to write the stored procedures.
I am trying this by using SAVEPOING and ROLLBACK but no luck... please help me out.....
Declare exit handler for sqlexception set nerror = sqlcode;
insert into empmaster (empname) values('test');
set emp_id = identity_val_lo cal();
savepoint a on... -
Rowset string concatenation
I have a table with the following information
can anybody...Code:CREATE TABLE TEST2 (ID1 INT, NAM1 VARCHAR (20), PLANT VARCHAR (20)) INSERT INTO TEST2 VALUES(1,'AA1','P1') INSERT INTO TEST2 VALUES(1,'AA1','P2') INSERT INTO TEST2 VALUES(1,'AA1','P3') INSERT INTO TEST2 VALUES(1,'AA1','P4') INSERT INTO TEST2 VALUES(1,'AA1','P5') INSERT INTO TEST2 VALUES(2,'AA2','P6') INSERT INTO TEST2 VALUES(2,'AA2','P2')
No activity results to display
Show More