ORA-01036: illegal variable name/number

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
elias.shaik
Participant
Posts: 51
Joined: Sat Dec 09, 2006 3:32 am

ORA-01036: illegal variable name/number

Post by elias.shaik »

Hi all,

In a server job i have a sequential file as source and oracle table as lookup table.

And using transformer we are doing lookup on oracle table.

The problem is,job is aborting with below error .
"ORA-01036: illegal variable name/number" .

But we are able to do view data properly from oracle referece table.

Please suggest.

Thanks,
Elias.
------------
Elias
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Have you got any user-defined sql?

can you post your sql?
elias.shaik
Participant
Posts: 51
Joined: Sat Dec 09, 2006 3:32 am

Post by elias.shaik »

Here is the SQL query i have used.

select FSCL_YR_NUM , TO_CHAR(cal_dt, 'YYYY-MM-DD') from TBLNAME

And data type for FSCL_YR_NUM is integer and data type for cal_dt is Varchar2(10).

Cal_dt is my key column used for doing lookup.

Thanks,
Elias.
------------
Elias
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Where is your field positions for reference key?
dxk9
Participant
Posts: 105
Joined: Wed Aug 19, 2009 12:46 am
Location: Chennai, Tamil Nadu

Post by dxk9 »

Try this query:

select FSCL_YR_NUM , TO_CHAR(cal_dt, 'YYYY-MM-DD') as cal_dt from TBLNAME.


Regards,
Divya
dxk9
Participant
Posts: 105
Joined: Wed Aug 19, 2009 12:46 am
Location: Chennai, Tamil Nadu

Post by dxk9 »

Try this query:

select FSCL_YR_NUM , TO_CHAR(cal_dt, 'YYYY-MM-DD') as cal_dt from TBLNAME.


Regards,
Divya
elias.shaik
Participant
Posts: 51
Joined: Sat Dec 09, 2006 3:32 am

Post by elias.shaik »

In columns tab it is 2nd column.

If it is not answering your question then i must have misunderstood the question.


Thanks,
Elias.
------------
Elias
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Make a copy of the job and set it to 'auto generated'.

You will see either :1, :2 etc or '?' in place of your source keys linking to reference.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No "where" clause? That means the key column is illegal, that or you need to add the clause and bind the Key into it as noted by position. And ensure your selected columns match the columns defined in the stage. Exactly.
-craig

"You can never have too many knives" -- Logan Nine Fingers
elias.shaik
Participant
Posts: 51
Joined: Sat Dec 09, 2006 3:32 am

Post by elias.shaik »

we have changed the query to auto generated query and

SELECT TO_CHAR(CAL_DT, 'YYYY-MM-DD HH24:MI:SS'),FSCL_YR_NUM FROM TBLNAME WHERE CAL_DT=TO_DATE(:1, 'YYYY-MM-DD HH24:MI:SS')

But the job is giving different kind of errors.Just want to know whether we can use oracle stage (OCI) stage as reference table to do lookup in server job.

Can someone pls conform this.

Thanks,
Elias[/b]
------------
Elias
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

elias.shaik wrote:But the job is giving different kind of errors.
What kind of errors ?

Post the unedited error so others can assist.
dxk9
Participant
Posts: 105
Joined: Wed Aug 19, 2009 12:46 am
Location: Chennai, Tamil Nadu

Post by dxk9 »

Hi,
elias.shaik wrote: SELECT TO_CHAR(CAL_DT, 'YYYY-MM-DD HH24:MI:SS'),FSCL_YR_NUM FROM TBLNAME WHERE CAL_DT=TO_DATE(:1, 'YYYY-MM-DD HH24:MI:SS')
"where" clause is ideally not required for input table or reference table. So it should not make a difference. Try it with alias name for the 1st field in the query, Oracle stage will expect a alias name same as the name that you mention in the columns field.




Regards,
Divya
elias.shaik
Participant
Posts: 51
Joined: Sat Dec 09, 2006 3:32 am

Post by elias.shaik »

Issue is resolved

We have used timestamp format in columns tab.

Query is auto generated.

Code: Select all

SELECT TO_CHAR(CAL_DT, 'YYYY-MM-DD HH24:MI:SS'),FSCL_YR_NUM FROM TBLNAME WHERE CAL_DT=TO_DATE(:1, 'YYYY-MM-DD HH24:MI:SS') 
Date format wasn't working.

Thanks to all for your support.

Thanks,
Elias.
------------
Elias
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

dxk9 wrote:"where" clause is ideally not required for input table or reference table. So it should not make a difference. Try it with alias name for the 1st field in the query, Oracle stage will expect a alias name same as the name that you mention in the columns field.
Unfortunately, a couple of problems with this. First, a where clause is very much ideally required for a reference lookup (which is what is being discussed here) and makes a huge difference. It changes the behaviour from a static lookup to one driven by the input row data.

Secondly, the 'alias' comment is applicable to PX but not to Server. The Server product couldn't care less about column names in your select - it goes strictly by column position.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply