Hi Gurus,
Now I am able to login properly in both Batch as well as Interactive mode through BTEQ.
The problem which I am facing is with IMPORT of data to Database.
Details of the IMPORT.
.IMPORT vartext '|' FILE=/home/dsadm/Automation/fact_data_run1.txt; .REPEAT * USING REPORT_NAME (VARCHAR(50)), SUB_REPORT_NAME (VARCHAR(100)), OPTIONAL_FLAG (VARCHAR(1)), DATA_DATE (VARCHAR(20)) , PROCESS_DATE (VARCHAR(20)) , Load_START (VARCHAR(20)) , Load_END (TIMESTAMP(0)) , IS_WEEKLY (VARCHAR(20)) , IS_MONTHLY (VARCHAR(20)), FAILURE (VARCHAR(20)), FAILURE_SR (VARCHAR(20)), FAILURE_REASON (VARCHAR(1000)), RAG_STATUS (VARCHAR(20)), HAD_DELAY (VARCHAR(20)), DELAY_REASON (VARCHAR(20)), UPDATED_BY (VARCHAR(20)) INSERT INTO NDW_ETL_WORK.NDW_REPORT_FACT (REPORT_NAME, SUB_REPORT_NAME,OPTIONAL_FLAG,DATA_DATE,PROCESS_DATE,Load_START,Load_END,IS_WEEKLY,IS_MONTHLY,FAILURE, FAILURE_SR,FAILURE_REASON,RAG_STATUS,HAD_DELAY,DELAY_REASON,UPDATED_BY) values ( :REPORT_NAME, :SUB_REPORT_NAME, :OPTIONAL_FLAG, CAST(:DATA_DATE AS DATE), CAST(:PROCESS_DATE AS DATE), CAST(:Load_START AS TIME(0)), CAST(:Load_END AS TIME(0)), :IS_WEEKLY, :IS_MONTHLY, :FAILURE, :FAILURE_SR, :FAILURE_REASON, :RAG_STATUS, :HAD_DELAY, :DELAY_REASON, :UPDATED_BY );
Sample Record: [ There is end of line in the source file, i.e. cursor will point to begining of next line]
SUBSCRIBER_REPORT|SUBSCRIBER_REPORT|N|2013-03-12|2013-03-13|12:30:00 AM|04:35:00 AM|N|N|N|N|N|GREEN|N|N|SYSTEM
Table Def :
CREATE SET TABLE NDW_ETL_WORK.NDW_REPORT_FACT ,FALLBACK , NO BEFORE JOURNAL, NO AFTER JOURNAL, CHECKSUM = DEFAULT, DEFAULT MERGEBLOCKRATIO ( REPORT_NAME VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC, SUB_REPORT_NAME VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC, OPTIONAL_FLAG CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC CHECK ( OPTIONAL_FLAG IN ('Y','N') ), DATA_DATE DATE FORMAT 'YYYY-MM-DD' NOT NULL , PROCESS_DATE DATE FORMAT 'YYYY-MM-DD' NOT NULL, Load_START TIMESTAMP(0), Load_END TIMESTAMP(0), IS_WEEKLY CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC CHECK ( IS_WEEKLY IN ('Y','N') ), IS_MONTHLY CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC CHECK ( IS_MONTHLY IN ('Y','N') ), FAILURE CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC CHECK ( FAILURE IN ('Y','N') ), FAILURE_SR VARCHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC, FAILURE_REASON VARCHAR(1000) CHARACTER SET LATIN NOT CASESPECIFIC, RAG_STATUS VARCHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC, HAD_DELAY CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC CHECK ( HAD_DELAY IN ('Y','N') ), DELAY_REASON VARCHAR(1000) CHARACTER SET LATIN NOT CASESPECIFIC, UPDATED_BY VARCHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL) UNIQUE PRIMARY INDEX NDW_REPORT_FACT_UPI ( REPORT_NAME ,SUB_REPORT_NAME , DATA_DATE );
Now while executing, the BTEQ I am receiving the following error:
*** Failure 2673 The source parcel length does not match data that was defined.
Statement# 1, Info =1
*** Failure 2673 The source parcel length does not match data that was defined.
Statement# 1, Info =1
*** Warning: Out of data.
All the data sets are moving as rejected record.
Can you please suggest me on this. As now I am really stuck.
:(
Forums: