Update using Open Command

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
neeraj
Participant
Posts: 107
Joined: Tue May 24, 2005 4:09 am

Update using Open Command

Post by neeraj »

Hi,

Can you please let me know is it possible to update the record using Open Command option?

I want to Update the record in the employee table using the command below:-


Update Employee set Name='Gaurav'

I know I can do it with user defined SQL which are available in ODBC/OCI Stages but I want to do it using Open Command option

Regards
Neeraj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why do you want to do it there? And that sql would change everyone's Name to 'Gaurav', is that really what you want?
-craig

"You can never have too many knives" -- Logan Nine Fingers
neeraj
Participant
Posts: 107
Joined: Tue May 24, 2005 4:09 am

Post by neeraj »

Yes..

I am using this appraach as per my business requirement

in the director, it looks like this

#### STAGE: ODBC_Enterprise_4
## Operator
odbcwrite
## Operator options
-db_cs [&DSProjectMapName]
-data_source 'dev'
-user 'test'
-password '[&"DBPassword"]'
-insertarraysize 2000
-table 'Test1'
-mode truncate
-open 'UPDATE Test1 SET name=\'Gaurav\'

## General options
[ident('ODBC_Enterprise_4'); jobmon_ident('ODBC_Enterprise_4')]
## Inputs
0< [] 'File_Set_0:DSLink2.v'
;
# End of OSH code

The job is running without any warning and without updating the record.

Please let me know the solution.

Regards
Neeraj
neeraj
Participant
Posts: 107
Joined: Tue May 24, 2005 4:09 am

Post by neeraj »

Hi,

It is running.. I am able to update the table.

Now what I am trying to do is to create a generic job where I will pass the table name and key columns.

Based on which the update statment can be paramterized?

like

Update #TableName#
set #TableName#.#Col1#='Test'


Has anyone done like that
Post Reply