Help with Bteq IMPORT

Database
N/A

Help with Bteq IMPORT

I am written a script using .IMPORT . But it gives error as below. Please suggest.

.logon ${DB_SERVER}/${DB_USER},${DB_PASSWORD}

database edwdv3e_work_in;

.EXPORT FILE=see.txt
.IMPORT VARTEXT ' ' FILE=Tablenames.txt

.REPEAT *

USING Name (VARCHAR(17))

show sel * from (:Name);

.EXPORT RESET
.label exit_point
.logoff
.quit errorlevel
EOF

It gives the following error:
+---------+---------+---------+---------+---------+---------+---------+----

show sel * from (:Name);
$
*** Failure 3707 Syntax error, expected something like a name or a Unicode
delimited identifier or a 'SELECT' keyword or '(' between '(' and ':'.
Statement# 1, Info =20
*** Total elapsed time was 1 second.

The .txt file has name of Tables like
ABC
XYZ

Please suggest.....

2 REPLIES
Enthusiast

Re: Help with Bteq IMPORT

You cannot replace the tablename with a host variable. You can only use it for column values. Example:

select *
from tableName
where columnName = :Name;

Enthusiast

Re: Help with Bteq IMPORT

Better option would be to run the test file in loop (in the platform on which you are triggering bteq) and call bteq import inside the loop.