How to write Pre SQL in ODBC stage
Moderators: chulett, rschirm, roy
How to write Pre SQL in ODBC stage
Hi All,
I am using Datastage with Netezza combination. To connect to netezza, I am using ODBC connection. When I use ODBC stage, I can not see "Pre and Post SQL" options.
Is there a way to use this feature?
Thanks in Advance for help.
I am using Datastage with Netezza combination. To connect to netezza, I am using ODBC connection. When I use ODBC stage, I can not see "Pre and Post SQL" options.
Is there a way to use this feature?
Thanks in Advance for help.
Two links to the ODBC stage, ordered properly, with the delete link being sent first. Constrain the delete link to only send the first row to the target, for example using @OUTROWNUM=1.
Last edited by chulett on Thu Sep 15, 2011 7:50 am, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Thanks Craig.. It worked.
The only problem is, I am loosing one record. If I use @OUTROWNUM=1 then that record is sent to the delete link and thus not get inserted into target table.
For Now- I am storing that one record in Seq file and inserting back into target.
Is there a better way to handle that one record as well?
Is there a way to change output execution order?
Thanks.
The only problem is, I am loosing one record. If I use @OUTROWNUM=1 then that record is sent to the delete link and thus not get inserted into target table.
For Now- I am storing that one record in Seq file and inserting back into target.
Is there a better way to handle that one record as well?
Is there a way to change output execution order?
Thanks.
Last edited by palak08 on Thu Sep 15, 2011 10:37 am, edited 2 times in total.
You shouldn't be losing anything, that constraint should only be on the delete link and there shouldn't be any constraint on the normal loading link. Records don't have to go down one link or the other, they can go down any number of links.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: