Query within a Routine

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sengs
Participant
Posts: 55
Joined: Thu Nov 24, 2005 12:51 am

Query within a Routine

Post by sengs »

Hi,
How to write a SQL query within a routine..Please provide me some examples.
Thanks,
Sengs
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

A database query can be called in a routine by using a DSExecute() call to your operating system to call whatever command you use at your terminal window to issue SQL queries.

It usually is much better (and more efficient) to do this with the appropriate DataStage database connection stage.
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post by ameyvaidya »

Hi Sengs,
what you are looking for are called BCI functions.
This <a href="http://66.34.129.47/viewtopic.php?t=978 ... +functions"> link</a> leads to an example post. You can search for others.
From what I've read in DSXchange, its usually too complex to use these functions. Work arounds involving getting data in hashed files and using BASIC functions on them are easier to develop
IHTH
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
Post Reply