ODBC Connector Stage options

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

vputta
Premium Member
Premium Member
Posts: 47
Joined: Wed Oct 08, 2008 7:35 am
Location: Charlotte

ODBC Connector Stage options

Post by vputta »

Hi- We are using Datastage 8.1. I am using ODBC connector stage to read data. But am unable to see "Read Select statement from file" option in the stage. Is this option available only in later versions of Datastage but not in 8.1?

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I can't check at the moment but it isn't always a discrete option. In some stages you specify "User Defined" and then put "{FILE} <path to sql file>" in where the SQL itself would normally be. Should be documented if that's how it works there.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vputta
Premium Member
Premium Member
Posts: 47
Joined: Wed Oct 08, 2008 7:35 am
Location: Charlotte

Post by vputta »

I have tried specifying the file path in the Select statement box of ODBC connector stage but it didn't work.
The Oracle connector has the specific option to pick the select query from a file. So, if am using ODBC connector is there any other way to pick the query from a file?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Only whatever is documented - did you check? And since I can't tell from your reply, you have to actually include {FILE} at the front of the pathname rather than just the path - did you? Or it might be "{FILE}=", don't recall off the top of my head.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vputta
Premium Member
Premium Member
Posts: 47
Joined: Wed Oct 08, 2008 7:35 am
Location: Charlotte

Post by vputta »

I have mentioned this in the Select statement-

#SOURCE_QRY_PATH#/selectdynamic.sql

I am passing the source query path during runtime. As I have said this is working in Oracle connector but not in ODBC connector. Plz lemme know if this is correct?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted (twice now) you must include the text {FILE} before the pathname... otherwise all you have is an invalid SQL statement.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Examples here: viewtopic.php?t=124375
-craig

"You can never have too many knives" -- Logan Nine Fingers
vputta
Premium Member
Premium Member
Posts: 47
Joined: Wed Oct 08, 2008 7:35 am
Location: Charlotte

Post by vputta »

Thanks for the info. I have tried the below approaches but it's not working.

{FILE}#SOURCE_QRY_PATH#
{FILE}/#SOURCE_QRY_PATH#

Is there any other way to get this resolved?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Define 'not working'... what happens? What error message(s) do you see? What settings are you using in the stage?
-craig

"You can never have too many knives" -- Logan Nine Fingers
vputta
Premium Member
Premium Member
Posts: 47
Joined: Wed Oct 08, 2008 7:35 am
Location: Charlotte

Post by vputta »

I a using ODBC connector stage to read data rom oracle 10g table and writing the data into dataset.

ODBC Connector stage ---> Dataset

Select stmt in ODBC- {FILE}/#SOURCE_QRY_PATH#

Using Run time column propagation.

run time value passing to the parameter SOURCE_QRY_PATH - /home/dsadm/select.sql
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Interesting... you managed to not answer any of the questions I asked.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vputta
Premium Member
Premium Member
Posts: 47
Joined: Wed Oct 08, 2008 7:35 am
Location: Charlotte

Post by vputta »

Sorry. This is the error message am getting.

ODBC_Connector_80: ODBC function "SQLPrepare" reported: SQLSTATE = HY000: Native Error Code = 0: Msg = [IBM(DataDirect OEM)][ODBC Oracle Wire Protocol driver]General error. setStmtType failed
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

... and exactly what settings are you using in the stage?
-craig

"You can never have too many knives" -- Logan Nine Fingers
vputta
Premium Member
Premium Member
Posts: 47
Joined: Wed Oct 08, 2008 7:35 am
Location: Charlotte

Post by vputta »

am using normal connection settings, transaction record cnt- 2000, session array size- 2000 and am not defining any before/afte SQL.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't see anything in the documentation that indicates that the ODBC Connector supports reading SQL from a file. Unless someone here knows otherwise, time to involve your official support provider it would seem, see what they say your options are.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply