All Forums Database
Ashok.Pentapati 16 posts Joined 06/09
29 Oct 2011
Warning: EOF On Input Stream

Hi All,

 

I was trying to run bteq with below code.

 

.RUN FILE='C:\Users\dell\Desktop\Cust_BteqScript.txt';'

 

Cust_BteqScript.txt contains below text and  Login.txt contains Login information

 

.RUN FILE='C:\Users\dell\Desktop\Logon.txt';

Insert into Tbl1 Select col1 from Tbl2;

.quit

 

However after the execution of the Cust_BteqScript.txt file  ,I am getting an error that "Warning: EOF on INPUT stream".The next INSERT part is not executing.Can someone help me with this?

 

Thanks,

Ashok.

 

CarlosAL 512 posts Joined 04/08
29 Oct 2011

You may take a look at this thread:

http://forums.teradata.com/forum/tools/can-a-bteq-script-be-called-from-another-bteq-script

HTH.

Cheers.

Carlos.

Ashok.Pentapati 16 posts Joined 06/09
29 Oct 2011

Hi Carlos,

I am not sure what is causing this error.I doubt if the cursor is returning back to main script Cust_BteqScript.txt after the excution of logon file.The below script is not executing "INSEERT INTO TBL1 SELECT COL1 FROM TBL2;".Can you please have a look at it.I am posting the script and Log below:

Caller SQL:

.RUN FILE=C:\Documents and Settings\copentaa\Desktop\Core Scripts\LOGON\LOGON_EDW.txt;

 Insert into Tbl1 Select col1 from Tbl2;

.LOGOFF
.QUIT

Called SQL:

.LOGON 10.25.5.93/COASH,******;

LOG:
-----

.run file=.RUN FILE='C:\Users\dell\Desktop\Cust_BteqScript.txt;

Teradata BTEQ 12.00.00.01 for WIN32. Enter your logon or BTEQ command:

.RUN FILE=C:\Documents and Settings\copentaa\Desktop\Core Scripts\LOGON\LOGON_EDW.txt;
 Teradata BTEQ 12.00.00.01 for WIN32. Enter your logon or BTEQ command:

.LOGON 10.25.5.93/COASH,

 *** Logon successfully completed.
 *** Teradata Database Release is 13.10.01.01                  
 *** Teradata Database Version is 13.10.01.01a                   
 *** Transaction Semantics are BTET.
 *** Character Set Name is 'ASCII'.
 
 *** Total elapsed time was 1 second.
 
 BTEQ -- Enter your DBC/SQL request or BTEQ command:
 *** Warning: EOF on INPUT stream.
 BTEQ -- Enter your DBC/SQL request or BTEQ command:

 

Thanks,

Ashok.

Ashok.Pentapati 16 posts Joined 06/09
31 Oct 2011

Hi All,

Can anyone help me with this please?

 

Thanks,

Ashok.

CarlosAL 512 posts Joined 04/08
31 Oct 2011

Here is an example:

 

 BTEQ -- Enter your SQL request or BTEQ command:
CREATE SET TABLE MY_DB.PRUEBA01 (ID_N INTEGER NOT NULL,
                                 C_TXT VARCHAR(25) NOT NULL)
UNIQUE PRIMARY INDEX PRUEBA01_UPI(ID_N)
;

 *** Table has been created.
 *** Total elapsed time was 1 second.
 

File CALLER.btq:
 

.RUN FILE conexion;

INSERT INTO MY_DB.PRUEBA01 (ID_N, C_TXT) VALUES (0,'Caller');

.RUN FILE CALLED1.btq;

.QUIT ERRORCODE

File CALLED1.btq:

INSERT INTO MY_DB.PRUEBA01 (ID_N, C_TXT) VALUES (1,'Called1');

.RUN FILE CALLED2.btq;

File CALLED2.btq:

INSERT INTO MY_DB.PRUEBA01 (ID_N, C_TXT) VALUES (2,'Called2');

Execution:

C:\Process>bteq < CALLER.btq
BTEQ 13.10.00.01 Mon Oct 31 10:48:11 2011

+---------+---------+---------+---------+---------+--- ------+---------+----
.RUN FILE conexion;
+---------+---------+---------+---------+---------+--- ------+---------+----
.logon my_db/my_user,

 *** Logon successfully completed.
 *** Teradata Database Release is 12.00.02.46
 *** Teradata Database Version is 12.00.02.46
 *** Transaction Semantics are BTET.
 *** Session Character Set Name is 'ASCII'.

+---------+---------+---------+---------+---------+--- ------+---------+----
 *** Warning: EOF on INPUT stream.
+---------+---------+---------+---------+---------+--- ------+---------+----

INSERT INTO MY_DB.PRUEBA01 (ID_N, C_TXT) VALUES (0,'Caller');

 *** Insert completed. One row added.
 *** Total elapsed time was 1 second.

+---------+---------+---------+---------+---------+--- ------+---------+----

.RUN FILE CALLED1.btq;
+---------+---------+---------+---------+---------+--- ------+---------+----

INSERT INTO MY_DB.PRUEBA01 (ID_N, C_TXT) VALUES (1,'Called1');

 *** Insert completed. One row added.
 *** Total elapsed time was 1 second.

+---------+---------+---------+---------+---------+--- ------+---------+----

.RUN FILE CALLED2.btq;
+---------+---------+---------+---------+---------+--- ------+---------+----
INSERT INTO MY_DB.PRUEBA01 (ID_N, C_TXT) VALUES (2,'Called2');

 *** Insert completed. One row added.
 *** Total elapsed time was 1 second.

+---------+---------+---------+---------+---------+--- ------+---------+----
 *** Warning: EOF on INPUT stream.
+---------+---------+---------+---------+---------+--- ------+---------+----

.QUIT ERRORCODE
 *** You are now logged off from the DBC.
 *** Exiting BTEQ...
 *** RC (return code) = 0

C:\Process>

Results:

 BTEQ -- Enter your SQL request or BTEQ command:
SELECT * FROM  MY_DB.PRUEBA01;

 *** Query completed. 3 rows found. 2 columns returned.
 *** Total elapsed time was 1 second.

       ID_N  C_TXT
-----------  -------------------------
          2  Called2
          1  Called1
          0  Caller

 

HTH.

Cheers.

Carlos.
 

You must sign in to leave a comment.