Page 1 of 1

Update using Open Command

Posted: Mon Aug 30, 2010 3:38 pm
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

Posted: Mon Aug 30, 2010 3:53 pm
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?

Posted: Mon Aug 30, 2010 4:13 pm
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

Posted: Mon Aug 30, 2010 4:37 pm
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