odbc insert
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 88
- Joined: Tue Nov 28, 2006 9:33 pm
odbc insert
I have got an odbc table as input and I am doing an insert on this table through a sql and this sql is joining many tables then is it required to refer to those table columns somewhere in the input or just the sql will take care of it. basically say input is table emp and I am inserting values to this table so output is also same table emp.the sql is referring to many other tables.
I'm sorry, but you'll need to restate your question as it's not really obvious what you need help with. I can pull this piece out which seems to be the heart of the matter:
However, still not really clear what your issue is or how 'sql is referring to many other tables' is relevant.kishoreramachandran wrote:is it required to refer to those table columns somewhere in the input or just the sql will take care of it
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 88
- Joined: Tue Nov 28, 2006 9:33 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Within a Transformer stage, use a NULL-handling expression in each case - maybe create a NullToValue Transform.
But, as Craig suggested, you can do this within the extraction SQL. Depending on the database the function may be called something like NVL(). COALESCE() selects the earliest non-null value from a list of values/column references (or returns null if they are all null).
But, as Craig suggested, you can do this within the extraction SQL. Depending on the database the function may be called something like NVL(). COALESCE() selects the earliest non-null value from a list of values/column references (or returns null if they are all null).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
That was Bill, or Chuck or whatever 'nom de plume' DSGuru2B is operating under today.
As noted, you can do this in your SQL or in your job - your choice. Typical SQL solutions could include NVL or DECODE or COALESCE, for specific answers we would need to know your database.
In the job, IsNull could help or a NullToValue transform could be created, modeled after the existing NullToEmpty / NullToZero transforms.
It really depends on where these 'different values' come from.
As noted, you can do this in your SQL or in your job - your choice. Typical SQL solutions could include NVL or DECODE or COALESCE, for specific answers we would need to know your database.
In the job, IsNull could help or a NullToValue transform could be created, modeled after the existing NullToEmpty / NullToZero transforms.
It really depends on where these 'different values' come from.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Your sql query can refer or join any numnber of tables.
You don't need to have each of the tables you are refering to as an input to the transformer.
You coudld also use Oracle NVL function, which lets you substitute a value when a null value is encountered.
Check Google for the syntax for the Oracle NVL function.
You don't need to have each of the tables you are refering to as an input to the transformer.
You coudld also use Oracle NVL function, which lets you substitute a value when a null value is encountered.
Check Google for the syntax for the Oracle NVL function.
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.
O..ooo I should read the posts more in details. I am so obsessed with Oraclechulett wrote:Really? Where did anybody (other than you, that is) mention the 'O' word?narasimha wrote:You coudld also use Oracle NVL function...
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.