selecting column as null from oracle
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am
selecting column as null from oracle
hi,
I want to select some of my columns as null from the database oracle like
select t1.fd_id,
t2.px_number,
null cr_code,
null pt_code
from table1 t1, table2 t2
this query works fine in sqlplus and sqldeveloper where as in datastage
it giving following error
db_Tx_data: Error when checking operator: Caught parsing exception during wrapDescribeOperator(): In field "col": Parsing parameters "max=0" for schema type "string": Max length must be positive, got: "0"
i am using datatype varchar and nullability yes for such columns.
Please provide some pointers!
Thanks,
Aruna
I want to select some of my columns as null from the database oracle like
select t1.fd_id,
t2.px_number,
null cr_code,
null pt_code
from table1 t1, table2 t2
this query works fine in sqlplus and sqldeveloper where as in datastage
it giving following error
db_Tx_data: Error when checking operator: Caught parsing exception during wrapDescribeOperator(): In field "col": Parsing parameters "max=0" for schema type "string": Max length must be positive, got: "0"
i am using datatype varchar and nullability yes for such columns.
Please provide some pointers!
Thanks,
Aruna
Re: selecting column as null from oracle
Try '' instead of null
or else
use transformer stage and create those two colums and assign them with setnull()
Regards,
Chandrakiran
or else
use transformer stage and create those two colums and assign them with setnull()
Regards,
Chandrakiran
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Just a guess.....
What happens if you try
in your source ?
What happens if you try
Code: Select all
select t1.fd_id,
t2.px_number,
CAST(null AS VarChar2(10)) cr_code,
CAST(null AS VarChar2(10)) pt_code
from table1 t1, table2 t2
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am
i will go with the suggestion provided CAST(null AS VarChar2(10)) cr_code and with below theory not sure though that it's fully correct!
oracle nulls can be identified where as for datastage null should be converted to a form or metadata datastage is aware off hence it worked once null is explicitly casted to a data type!
Thanks to all!
Aruna
oracle nulls can be identified where as for datastage null should be converted to a form or metadata datastage is aware off hence it worked once null is explicitly casted to a data type!
Thanks to all!
Aruna
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The error message suggests otherwise. Maybe you have a VarChar column in which the precision (length) field has not been filled in at all, somewhere in the job.
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.
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am