I am going through few BTEQ scripts and can see DATABASENAME in unusual format.
My guess it is some parameter however not sure about it.
SELECT ... from Stage.W#GLOBAL.ABCDEF
SELECT ... FROM %DATABASENAME%
What is %SOMENAME% in BTEQ script ? Few instances I could also see '%ABCD.2%' . What does this mean ?
The first thing when we make a bteq script we used to define any parameter as #PARAMETER#.
EX: SELECT * FROM TEST_DB.PROVIDER_TBL
After paramterized the values
SELECT * FROM #TDDatabase#.#SrcTbl#
On SELECT ... FROM %DATABASENAME% it will not work.
When we use like then we use to do that '%DATABASENAME%' but in quotes.
But while selecting any value from a database you can not use as %DATABASENAME% this will give you error.
Thanks for quick reply.
However how were you passing parameters to bteq script ?
I mean how #DATABASENAME# shall be replaced by DB_STAGE in BTEQ while execution ?
I used to work with shell scripts and used shell variables to generate BTEQ dynamically with actual values replacing parameters. However haven't used parameters inside BTEQ before.
Same answer. There is no internal BTEQ parameter replacement, you must do it programatically like you did with shell scripts