Convert field with SQL type as BIT to Integer
Moderators: chulett, rschirm, roy
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
Convert field with SQL type as BIT to Integer
Hi,
Can anyone help me out in converting a column which has a SQL type as BIT to Integer in a transformer.
thanx,
Rohit
Can anyone help me out in converting a column which has a SQL type as BIT to Integer in a transformer.
thanx,
Rohit
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Try not doing anything at all to it.
What is the SQL data type in the imported table definition?
Remember that, within DataStage server jobs, there are no data types, so the cast may be performed implicitly and correctly for you.
What is the SQL data type in the imported table definition?
Remember that, within DataStage server jobs, there are no data types, so the cast may be performed implicitly and correctly for you.
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.
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Are you sure this is a server job? ![Confused :?](./images/smilies/icon_confused.gif)
In server jobs (by default) NULL is 10000000 (which is possibly how a "bit" is stored) so it may be possible to use as your derivation.
![Confused :?](./images/smilies/icon_confused.gif)
In server jobs (by default) NULL is 10000000 (which is possibly how a "bit" is stored) so it may be possible to use
Code: Select all
IsNull(InLink.Field)
Last edited by ray.wurlod on Wed Jun 14, 2006 4:14 pm, edited 1 time in total.
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.
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What's the source database?
Try changing the derivation of that column to and changing its data type within DataStage also to INTEGER. If it's truly a bit type this is a legal cast.
Try changing the derivation of that column to
Code: Select all
CAST(FieldName AS INTEGER)
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.
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio