Delete Statement (ANYONE WANTING TO EXECUTE SQL)

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Delete Statement (ANYONE WANTING TO EXECUTE SQL)

Post by admin »

This is a topic for an orphaned message.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Everyone do yourself a favor and execute all SQL, stored-procedures, etc from a batch job rather than inside a job design. Your life will be much easier.

Its simple, just use code like the following. For SQL scripts, just stick them inside a shell script or batch file that does the connection to the database, then your SQL script. Sticking this stuff inside jobs just buries it, making it harder to manage. We all know how to write SQL scripts.

UNIXcmd = "/scriptdir/DataBaseConnectionscript.sh
SQLscript.sql"
Call DSLogInfo("UNIXcmd: ":UNIXcmd, "Msg")
Call DSExecute("UNIX", UNIXcmd, ScreenOutput,
SystemReturnCode)
If TRIM(ScreenOutput) # "" Then Call DSLogInfo(ScreenOutput,
"Msg")

NTcmd = "scriptdirDataBaseConnectionscript.bat
SQLscript.sql"
Call DSLogInfo("NTcmd: ":NTcmd, "Msg")
Call DSExecute("NT", NTcmd, ScreenOutput, SystemReturnCode)
If TRIM(ScreenOutput) # "" Then Call DSLogInfo(ScreenOutput,
"Msg")


TCLcmd = "universe command"
Call DSLogInfo("TCLcmd: ":NTcmd, "Msg")
Call DSExecute("TCL", TCLcmd, ScreenOutput,
SystemReturnCode)
If TRIM(ScreenOutput) # "" Then Call DSLogInfo(ScreenOutput,
"Msg")


-Ken







Andrew.Webb@ascentialsoftware.com on 23-Jul-2001 11:19



Please respond to datastage-users@oliver.com

To: datastage-users
cc:
Subject: RE: Delete Statement


some of the stages have post and pre sql boxes, you can execute sql before or after the stage starts or finishes.

it depends on what you want to do, and to which database.

Andrew Webb
Principal Presales Consultant
Ascential Software
Changing the Way the World Looks At Information www.ascentialsoftware.com

Mobile : +44 (0)777 5762347
Direct : +44 (0)20 8818 0717
Switchboard : +44 (0)20 8818 0700
Fax: +44 (0)20 8818 0701
Email: andrew.webb@ascentialsoftware.com
This message is intended for the sole use of the intended recipient and may contain information that is confidential and privileged and/or attorneys work product. Any review or distribution by any other person is prohibited. If you are not the intended recipient, please immediately contact the sender and delete all copies



> -----Original Message-----
> From: Nuno Pimenta [mailto:nuno.pimenta@tmn.pt]
> Sent: 23 July 2001 4:14 PM
> To: datastage-users@oliver.com
> Subject: RE: Delete Statement
>
>
>
> Or, if i want to make a alter table instruction? Where can i execute
> that?
>
>
> -----Original Message-----
> From: Nuno Pimenta [mailto:nuno.pimenta@tmn.pt]
> Sent: segunda-feira, 23 de Julho de 2001 16:03
> To: datastage-users@oliver.com
> Subject: Delete Statement
>
>
> Hi,
>
> I want to execute a delete statement, for example: delete * from tab;
>
> How and where may i execute that in DataStage?
>
> Thanks in advance,
>
>
> NSP
>
>
Locked