Page 1 of 1

delete universe records from DS function

Posted: Tue Sep 30, 2003 12:55 am
by xli
Hi,

I have a universe table containing log information, I want to delete records from it in terms of Batch job name, I tried the following code

*************************************************
JobHandle = DSJ.ME
JobName = DSGetJobInfo(JobHandle,DSJ.JOBNAME)

Cmd = "DELETE FROM BJOB_STATUS WHERE Batch_JobName = '" : JobName : "'"
Call DSLogInfo("The sql is " : Cmd, RoutineName)
Execute Cmd Capturing Msg
Call DSLogInfo(Msg, RoutineName)
**************************************************
I found it doesn't work.

Thanks in advance for your advice

xiong[8)]

Posted: Tue Sep 30, 2003 2:20 am
by Optico
Hi Xiong,

You haven't exactly included a lot of detail as to what is not working, but I do have a couple of suggestions for you :

Have you remembered the include : $INCLUDE DSINCLUDE JOBCONTROL.H
in your code ?

DSJ.ME is the jobhandle for the current job so you don't do the line:
JobHandle = DSJ.ME
Instead the next line should look like this:
JobName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)

HTH



B. Sorensen,
Optico IT ApS

Posted: Tue Sep 30, 2003 9:48 am
by kduke
xiong

Delete from works fine. I think you forgot the ';'.

Kim.

Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com

Posted: Tue Sep 30, 2003 4:21 pm
by xli
kim, you are right, I forgot";" in my code.

Thanks for your all advices.

xiong