2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-17 09:25:32 +00:00
cheat.sheets/sheets/_db2/sqlpl

9 lines
383 B
Plaintext
Raw Normal View History

2019-08-06 03:56:57 +00:00
--Create a compound statement Anonymous block
BEGIN DECLARE val SMALLINT; SET val = 1; WHILE (val <= 5) DO INSERT INTO tbl5 VALUES (val, val); SET val = val + 1; END WHILE; END @
--Perform a reorg via ADMIN_CMD (Sometimes required after “alter table”)
CALL SYSPROC.ADMIN_CMD('REORG TABLE tbl1')
---Call a stored procedure with an IN and an OUTPUT parameter
CALL prc1(5, ?)