Page 1 of 1

modify stage error

Posted: Mon Sep 05, 2011 1:53 am
by dsscholar
Hi All,

I gave the following expression in modify stage

timestamp1 [:timestamp] = [StringToTimestamp] timestamp

old_columnname is timestamp and its a varchar field but contains timestamp value. So i am converting to timestamp datatype. Am getting the following error.

main_program: Error parsing modify adapter: Error in binding: Error in destination field selector: Expected integer, got: ":"; input:
timestamp1 [:timestamp] = [StringToTimestamp] timestamp

Please help me correcting this syntax .

Re: modify stage error

Posted: Mon Sep 05, 2011 3:32 am
by priyadarshikunal
dsscholar wrote:I gave the following expression in modify stage

timestamp1 [:timestamp] = [StringToTimestamp] timestamp
From what i remember the function is something like
TimestampFromString()

Modify stage doesn't take transformer functions.

Re: modify stage error

Posted: Mon Sep 05, 2011 4:03 am
by dsscholar
Thanks for the reply. But still getting the same error.

Posted: Mon Sep 05, 2011 8:12 am
by chulett
Similar perhaps, but not the same. As noted, the Modify stage uses different functions from the Transformer and they are all documented. Looks like what you need is timestamp_from_string().

Posted: Mon Sep 05, 2011 5:17 pm
by ray.wurlod
There are no square brackets around the new data type. These are used only to show optional syntax.

Code: Select all

timestamp1:timestamp = timestamp_from_string(timestamp_string)

Posted: Thu Sep 08, 2011 1:25 am
by dsscholar
Hi ray,

Job ran successfully. But the converted column value is null. The input string is of nvarchar datatype, which i extracted as varchar with unicode from the source itself. After that i placed modify stage to change to timestamp.

Please advise to convert nvarchar to varchar and from varchar to timestamp. Because for remaining columns, i just want to pass as varchar.

Thanks in advance.

Posted: Thu Sep 08, 2011 4:07 am
by ray.wurlod
If it's Unicode you need timestamp_from_ustring() function.

Posted: Thu Sep 08, 2011 6:37 am
by dsscholar
Source is sql server and the datatype is nvarchar. I use varchar with unicode in datastage source stage. But for all the columns am getting the following warning.. how to eliminate that.

nvarchar in sql server is nothing but varchar with unicode right? I would like to change to varchar. Any conversion needs to be done here.


Thanks in advance.

Posted: Thu Sep 08, 2011 8:08 am
by dsscholar
Warning message :

src_INTERNAL_STMTS: When checking operator: When binding output interface field "timestamp" to field "timestamp": Implicit conversion from source type "ustring[max=20]"to result type "string".

Posted: Thu Sep 08, 2011 4:55 pm
by ray.wurlod
Specify Unicode VarChar(20) rather than unbounded non-Unicode VarChar in the stage that threw the error.

Posted: Fri Sep 09, 2011 12:23 am
by dsscholar
Hi Ray,

I gave as varchar (sqltype) and unicode(extended). Still throwing the same error.

Source is sql server : datatype of columns(nvarchar)
In datastage, i use sql server enterprise stage and am using varchar with unicode to extract data.. But getting that warning message.

Posted: Fri Sep 09, 2011 5:09 am
by ray.wurlod
VarChar or VarChar(20)??

Posted: Sat Sep 10, 2011 11:06 pm
by dsscholar
you mean size 20 with varchar datatype or something as varchar(20)?

Posted: Sun Sep 11, 2011 2:08 am
by ray.wurlod
I mean precision 20 with data type VarChar.