Using BEFORE SQL w/user-defined SQL query file with Teradata

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

Post Reply
nguyenmk
Participant
Posts: 5
Joined: Tue Mar 14, 2006 5:06 pm

Using BEFORE SQL w/user-defined SQL query file with Teradata

Post by nguyenmk »

Hi,

I'm trying to use the user-defined SQL query file in the BEFORE SQL tab with Teradata database (via ODBC). I have a DRS stage that calls the query file as I specifed in the SQL -> Before tab:

FILE=/export/home/test.sql


the test.sql has two delete statements with two semicolons at the end of each statement I also tried with one.

I'm getting the following warning and errors:

Warning: [NCR][ODBC Teradata][Teradata Database] Syntax error: expected something between the beginning of the request and the word 'FILE'.

Error: APT_CombinedOperatorController,0: Fatal Error: SQLExecDirect: Error executing statement 'FILE=/export/home/test.sql(...)

I tested with Oracle db and it works. Am I doing something wrong with the syntax as Teradata db expecting something different? Any idea is greatly appreciated.

Thanks

Michael
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi and Welcome aboard :),
:idea: I think this is a question for your Teradata DBA
I wouldn't be surprised that an Oracle syntax is not working on a different DB :!:
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi Roy,
I have an isert statement that works fine outside of DS, but when I try to use it in the before or after tab of Teradata API, it just doesnt seem to be inserting, no warnings , the ids , passwrods connections are the same.

The jobs finish fine, is there a bug or solution for this.

Thanks
Thanks,
Vinay
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

What is the actual text in the Before tab? From your description, it looks like it actually contains the text:

FILE=/export/home/test.sql

If that is true, then I believe that is your problem. My understanding is that the Before tab is supposed to contain actual SQL, not a file reference.


Brad.

ps. What is the DRS stage? I have not heard of that before. What does it do? How are you using it? Thanks, in advance, for the info!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DRS is Dynamic RDBMS Stage. It was introduced to allow the likes of PeopleSoft to deploy canned DataStage jobs to their customers; with a DRS you dynamically choose the database connection (e.g. DB2, Oracle, ODBC, SQL Server, etc), perhaps using a job parameter to specify it.

As far as I am aware it is only available in server jobs. It is not mentioned in the Parallel Job Developer's Guide for version 7.5. Neither is it mentioned (either as a server or parallel stage type) in the 7.5 Developer's Help.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi,
I am using a SQL and not a file.

Thanks,
Thanks,
Vinay
Post Reply