Sub String in DS UV Query

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Yuan_Edward
Participant
Posts: 73
Joined: Tue May 10, 2005 6:21 pm
Location: Sydney

Sub String in DS UV Query

Post by Yuan_Edward »

The Original Query is: SELECT @ID, FULL.TEXT, TIMESTAMP FROM RT_LOG217, And my job got the following error:

ETL_DS_JOB_LOG.SBL_ODS_CUSTOMER_ACCOUNT.tLoad.Uni_RT_LOGS_inp: DSD.BCIGetNext call to SQLFetch failed.
SQL statement:SELECT @ID, FULL.TEXT, TIMESTAMP FROM RT_LOG217
SQLSTATE=S1000, DBMS.CODE=930122
[DataStage][SQL Client][UNIVERSE]DataStage/SQL: Row length exceeds buffer size.

The columns definition is:
@ID VARCHAR(10) NULLABLE TYPE S
FULL.TEXT VARCHAR(2000) NULLABLE TYPE S
TIMESTAMP VARCHAR(254) NULLABLE TYPE S
Probably it's because FULL.TEXT is too long. So I am wondering if there is a way to truncate FULL.TEXT to 2000.

I am not aware of the UV syntax. Any comments are appreciated.
Edward Yuan
Yuan_Edward
Participant
Posts: 73
Joined: Tue May 10, 2005 6:21 pm
Location: Sydney

Re: Sub String in DS UV Query

Post by Yuan_Edward »

The standard SQL syntax works:

SELECT @ID, SUBSTRING(FULL.TEXT FROM 1 FOR 2000), TIMESTAMP FROM RT_LOG217
Edward Yuan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can edit your uvodbc.config file to set MAXFETCHBUFFSIZE to a value larger than its default of 8192 bytes.

The UniVerse/SQL syntax requires a SUBSTRING function.

Code: Select all

SELECT SUBSTRING(FULL.TEXT FROM 1 FOR 1000) FROM RT_LOG217;
Or you can override the format.

Code: Select all

SELECT FULL.TEXT FMT 'L#1000' FROM RT_LOG217;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Adding it as a separate line is correct. What was the "different error"?

I've always tried to set MAXFETCHBUFFSIZE as a power of 2, but I can't recall why, Perhaps try it with 16384.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post by joycerecacho »

Ray,

I wrote in the uvodbc.config:

[ODBC DATA SOURCES]
<localuv>
DBMSTYPE = UNIVERSE
network = TCP/IP
service = uvserver
host = 127.0.0.1
MAXFETCHBUFFSIZE = 16384

The error when I read my UV Query now is:
DSD.BCIConnect connecting to localuv, call to SQLConnect failed.
SQLSTATE=IM997, DBMS.CODE=0
[DataStage][SQL Client]An illegal configuration option was found

Do u know what is happening?

Best Regards,
Joyce A. Recacho
São Paulo/SP
Brazil
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post by joycerecacho »

Hello Guys!!!

I found what was wrong!!!!!!!

The parameter name was invalid actually.
The parameter name is "MAXFETCHBUFF" and not "MAXFETCHBUFFSIZE"!!

Now my job is running OK.

Thanks for your help, Ray.

My uvodbc.config is:

[ODBC DATA SOURCES]
<localuv>
DBMSTYPE = UNIVERSE
network = TCP/IP
service = uvserver
host = 127.0.0.1
MAXFETCHBUFF = 16384

Best Regards,
Joyce A. Recacho
São Paulo/SP
Brazil
max.madsen
Premium Member
Premium Member
Posts: 62
Joined: Tue Dec 07, 2004 7:41 am
Location: Brasil
Contact:

Post by max.madsen »

Congrats Joyce!

Now, someone can mark as resolved?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Seems appropriate - done.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It would seem that, like James, I have used up my thinking quota for the month. :oops:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply