All Forums Database
bhawuk 1 post Joined 09/13
05 Sep 2013
error handiling in bteq error

hi
 
i am trying to write a bteq script which executes some select statements and exports the result to a text file on my system running on windows
here is the script
 
 .logtable SAMPLES.bteqexportLog;
.LOGON 127.0.0.1/tduser,tduser;
.begin export sessions 20;
.export outfile C:\Users\bhawuk_chauhan\Documents\ teradataexportoutput.txt MODE RECORD FORMAT TEXT;
SELECT CAST(COUNT(*) as VARCHAR(100)) FROM SAMPLES.CustomerAddress12;
.IF ERRORCODE <> 0 THEN .GOTO ins
SELECT CAST(COUNT(*) as VARCHAR(100)) FROM SAMPLES.EmployeeAddress;
SELECT CAST(COUNT(*) as VARCHAR(100)) FROM SAMPLES.ProductCategory;
SELECT CAST(COUNT(*) as VARCHAR(100)) FROM SAMPLES.SalesPerson;
SELECT CAST(COUNT(*) as VARCHAR(100)) FROM SAMPLES.Store;
.LABEL ins
SELECT CAST(COUNT(*) as VARCHAR(100)) FROM SAMPLES.EmployeeAddress;
SELECT CAST(COUNT(*) as VARCHAR(100)) FROM SAMPLES.ProductCategory;
SELECT CAST(COUNT(*) as VARCHAR(100)) FROM SAMPLES.SalesPerson;
SELECT CAST(COUNT(*) as VARCHAR(100)) FROM SAMPLES.Store;.end export;
.logoff;
 
but i am getting error like this:
 UTY0006 Input error in the IF command at position 24: ".GOTO"
i have tried many other things but i am not able to get around this error
 
kindly help me regarding this

Qaisar Kiani 337 posts Joined 11/05
06 Sep 2013

Can't see anything wrong with the .IF or .GOTO syntax....
Can you try removing the space between the \ and teradataexportoutput.txt ??
 

You must sign in to leave a comment.