Page 1 of 1

Posted: Wed Sep 27, 2006 2:15 pm
by samsuf2002
this is due to low memory adding an environment variable

add APT_DISABLE_COMBINATION and set it as true might help try it

Posted: Wed Sep 27, 2006 2:15 pm
by ArndW
The Field() function only has 3 parameters, the string, the delimiter and the occurrence number.

Posted: Wed Sep 27, 2006 3:24 pm
by ray.wurlod
The Field() function may have three or four arguments, Arnd. The fourth is number of fields to return.

However, I do not believe that the third argument for Field() can legally be a string; it must be an integer. Therefore, assuming that you've read the entire source record (RecIn) as a VarChar and want to return the second comma-delimited field from it, the correct specification is

Code: Select all

Field(InLink.RecIn, ",", 2, 1) 
or more simply

Code: Select all

Field(InLink.RecIn, ",", 2)

Did not work

Posted: Wed Sep 27, 2006 3:36 pm
by venkat_kp
Thank you all for the info. But still the result is the same

Yes read the entire source record (RecIn) as a VarChar and want to return the A, second comma-delimited field from it.

When Field(InLink.RecIn, ",", 2, 1) is used it's pulling only
"
"
"
"
"
"
and with Field(InLink.RecIn, ",", 2) job is getting aborted with
the previous messages.

Posted: Wed Sep 27, 2006 3:53 pm
by ray.wurlod
You need to reduce the string so that it can fit into Char(1). Since you're reading the entire line as a single string, the Field() function is returning the quote characters as well as the quoted value. Therefore you also need to Trim() the quote characters from the result of the Field() function.

Posted: Wed Sep 27, 2006 4:30 pm
by keshav0307
And what is stopping you to read as comma delimited with double quote

Posted: Wed Sep 27, 2006 7:38 pm
by ray.wurlod
The fact (already stated) that the entire record has been read as a single string, presumably because the file contains more than one record type. Note the name of the field that is being attempted to be extracted.

Posted: Thu Sep 28, 2006 2:05 am
by ArndW
ray.wurlod wrote:The Field() function may have three or four arguments, Arnd. The fourth is number of fields to return.
I shouldn't have tried that without having a BASIC to check; for some reason I thought that PX didn't allow the 4th arg. But the arguments were incorrectly ordered as well in the OP.

After removing the quotes in the source it worked

Posted: Thu Sep 28, 2006 10:22 am
by venkat_kp
After removing the quotes in the source and retyping the derivation (Field(InLink.RecIn, ",", 2) it worked.

Thank you all.