Category Archives: Database

Temporary table creations in database

DB2 temporary table creation CREATE GLOBAL TEMPORARY TABLE TEMPPROD (SERIALNO CHAR(8) NOT NULL, DESCRIPTION VARCHAR(60) NOT NULL, MFGCOSTAMT DECIMAL(8,2) , MFGDEPTNO CHAR(3) , MARKUPPCT SMALLINT , SALESDEPTNO CHAR(3) , CURDATE DATE NOT NULL); http://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/intro/src/tpc/db2z_creationoftemporarytables.html Postgresql temporary table creation Example: CREATE TEMPORARY TABLE temp_location ( city VARCHAR(80), street VARCHAR(80) ) ON COMMIT DELETE ROWS; http://www.sqlines.com/postgresql/statements/create_temporary_table Oracle… Read More »

IN clause limit with databases – Oracle DB2

Few solutions read for ORACLE were, No issue if IN clause values comes from a sub-query  – no limit Storing the IN clause values in global temporary table and using them Using ORs in between 1000s of INs – performance impact http://www.orafaq.com/forum/t/41437/0/ https://community.oracle.com/thread/235143 Postgresql doesn’t have any limit: http://stackoverflow.com/questions/1009706/postgresql-max-number-of-parameters-in-in-clause SQL Server has higher limit: (closer… Read More »