You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
714 B
Plaintext

6 years ago
--Put a lock at table level
5 years ago
LOCK TABLE tbl1 IN EXCLUSIVE MODE
6 years ago
--Execute a query without regard of commit rows
5 years ago
SELECT * FROM tbl1 WITH UR --RR,RS,CS
6 years ago
--Execute a query with only 5 rows
5 years ago
SELECT * FROM tbl1 FETCH FIRST 5 ROWS ONLY
6 years ago
--Perform a query to a dummy table (dual)
SELECT 'Any string' FROM SYSIBM.SYSDUMMY1
--Perform a query calling a function
5 years ago
SELECT HEX(col2) FROM tbl5
6 years ago
--Call a function
VALUES HEX('AnyText')
--Perform a cast
VALUES CAST('123' AS INTEGER)
--Concatenate
VALUES 'AnyText' || 5
VALUES 'AnyText' concat 5
--Escape a single quote in a text field
VALUES 'Sinead o''Connor'
--Query the database catalog
SELECT * FROM SYSCAT.TABLES
SELECT * FROM SYSCAT.TABAUTH
SELECT * FROM SYSCAT.ROUTINES