Tuesday, 29 November 2011

DB2 : Add New Column in Existing Table

Example:

ALTER TABLE
                DB2ADMIN.SUMMARY_1
ADD
              QlikViewScreenName VARCHAR(70)

DB2 : Alter Column Name

Example:

ALTER TABLE
                DB2ADMIN.ESERVICES_LIST
RENAME COLUMN
                SCREEN_MODULE_NAME TO QlikViewScreenName;

Saturday, 19 November 2011

QlikView : Variable with SQL Statement

table1:
LET start=Today();          //Current Date
LET end=Today();          //Current Date
SQL SelectRegistrationStatisticsByDate '$(start)' , '$(end)';


Let day1 = peek('RegistrationStatus',0,'table1');
Let day2 = peek('RegistrationStatus',1,'table1');

Let day3 = peek('RegistrationCount',0,'table1');
Let day4 = peek('RegistrationCount',1,'table1');


SQL INSERT INTO tbl_Kiosk_Statistics VALUES($(day4),$(day3));

Wednesday, 9 November 2011

DB2 : Select Yesterday Date

Current Date

SELECT DATE(CURRENT TIMESTAMP ) FROM SYSIBM.SYSDUMMY1

Yesterday Date

SELECT DATE(CURRENT TIMESTAMP - 1 DAYS) FROM SYSIBM.SYSDUMMY1