-- Licensed Materials - Property of IBM
-- IBM Cognos Products: ccllogging
-- (C) Copyright IBM Corp. 2005, 2010
-- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 

create table COGIPF_EDITQUERY (
	HOST_IPADDR 	varchar (15) NULL ,
	HOST_PORT 	int NULL ,
	PROC_ID 	int NULL ,
	LOCALTIMESTAMP 	datetime NULL ,
	TIMEZONE_OFFSET int NULL ,
	SESSIONID 	varchar (255) NULL ,
	REQUESTID 	varchar (255) NOT NULL ,
	STEPID 		varchar (255) NULL ,
	SUBREQUESTID 	varchar (255) NULL ,
	THREADID 	varchar (255) NULL ,
	COMPONENTID 	varchar (64) NULL ,
	BUILDNUMBER 	int NULL ,
	LOG_LEVEL 	int NULL ,
	TARGET_TYPE 	varchar (255) NULL ,
	QUERYPATH 	varchar (512) NULL ,
	STATUS 		varchar (255) NULL ,
	ERRORDETAILS 	varchar (2000) NULL ,
	RUNTIME 	int NULL ,
	QUERYNAME 	varchar (255) NULL ,
	PACKAGE 	varchar (255) NULL ,
	MODEL 		varchar (255) NULL 
)

sp_rename 'COGIPF_NATIVEQUERY', 'COGIPF_NATIVEQUERY_OLD'

create table COGIPF_NATIVEQUERY (
	HOST_IPADDR 	varchar (15) NULL ,
	HOST_PORT 	int NULL ,
	PROC_ID 	int NULL ,
	LOCALTIMESTAMP 	datetime NULL ,
	TIMEZONE_OFFSET int NULL ,
	SESSIONID 	varchar (255) NULL ,
	REQUESTID 	varchar (255) NOT NULL ,
	STEPID 		varchar (255) NULL ,
	SUBREQUESTID 	varchar (255) NULL ,
	THREADID 	varchar (255) NULL ,
	COMPONENTID 	varchar (64) NULL ,
	BUILDNUMBER 	int NULL ,
	LOG_LEVEL 	int NULL ,
	REQUESTSTRING 	ntext NULL 
)

insert into COGIPF_NATIVEQUERY (HOST_IPADDR, HOST_PORT, PROC_ID, LOCALTIMESTAMP, TIMEZONE_OFFSET, SESSIONID, REQUESTID, STEPID, SUBREQUESTID, THREADID, COMPONENTID, BUILDNUMBER, LOG_LEVEL, REQUESTSTRING ) select HOST_IPADDR, HOST_PORT, PROC_ID, LOCALTIMESTAMP, TIMEZONE_OFFSET, SESSIONID, REQUESTID, STEPID, SUBREQUESTID, THREADID, COMPONENTID, BUILDNUMBER, LOG_LEVEL, REQUESTSTRING from COGIPF_NATIVEQUERY_OLD

drop table COGIPF_NATIVEQUERY_OLD

