Page 1 of 1

Dynamic prepared Sql using routines

Posted: Tue Dec 11, 2007 9:36 am
by Ush
Has anyone created user-defined dynamic SQL in routine. I have a lookup table that contains the name of the column I need to update. I want to pass the column name to my update statement.

I want this to be done only using routines

Thanks

Posted: Tue Dec 11, 2007 9:45 am
by ArndW
Posting the same question more than once won't get you any additional or bette ranswers. In fact, chances are that you've lowered your chances.

Posted: Tue Dec 11, 2007 12:21 pm
by rodre
Do a search using SQLExecDirect or SQLAllocStmt or SQLNumResultCols. It can be done but it is pretty extensive code I found out.

Posted: Wed Dec 12, 2007 1:31 am
by ray.wurlod
Search the forum for "BCI". The DataStage BASIC SQL Client Interface (BCI) is a set of DataStage functions that mimic the ODBC API functions. You can do whatever you like (in an SQL realm) with these.

SQL Client Interface Guide

Posted: Thu Dec 13, 2007 7:32 am
by CharlesNagy
There is an SQL_Client_Interfac_Guide.pdf which may have come with your Datastage documentation on your installation disc. This has an SQL client Interface demonstration program on it which may show you how to do it.