3760:String not terminated before end of text

General
Enthusiast

3760:String not terminated before end of text

Hi,

In a procedure we get all the values passed to insert command using the cursor,

when i execute using dsql facing 3760 error.

insert into results values('PRCS STAT CODE','metadata','prcs', 1, 6720,'C ','X');

when I manually run the query its is working fine.

sample dsql:

dsql='insert into results values('''||TRIM(columnname)||''','''||TRIM(dbname)||''','''||TRIM(tname)||''','||nullcount||','||notnullcount||','''||TRIM(BOTH' ' FROM minval)||''','''||TRIM(BOTH' ' FROM maxval)||''');';

Is it due to any datatype issue?

Thanks,

Karthik. N

5 REPLIES
Senior Supporter

Re: 3760:String not terminated before end of text

The error message means that a string is not terminated - which means a string starts with an ' but not second ' can be found.

Do you have a SP debug or log table where the SP can insert the dsql into as a text.

In this case you would be able to see what the statement is you try to execute.

Enthusiast

Re: 3760:String not terminated before end of text

insert into results values('PRCS STAT CODE','metadata','prcs'16720,'C ','X');

This sql from log table derived from dsql.

Senior Supporter

Re: 3760:String not terminated before end of text

And I it seems to be a correct one - so you can run this?

The first ' of  'metadata'  has a different color - but I guess this doesn't mean it is a different `or ´or what ever?

Are you sure that the call of this insert generates the error message?

Can you share the SP code?

Enthusiast

Re: 3760:String not terminated before end of text

Hi Ulrich,

Issue is due to the field TRIM(BOTH' ' FROM minval), it gives the value 'C '

CHAR2HEXINT of the value gives me 004300200020002000200020  as the field is of data type char(25).

when I used substr(minval,1,1) in sp, insert whent through fine.

Is the space in char filed causing the issue? [String not terminated before end of text]

SP code:

/*    MIN  VAL START  */

SET dsql = 'DELETE FROM vals  ALL ;';

CALL DBC.SysExecSQL(dsql);

SET dsql='insert into vals sel cast(min('||column_name||') as varchar(100)) from '||dbname||'.'||tname||';';

 CALL DBC.SysExecSQL(dsql);

SEL   vlu INTO minval  FROM vals;

/*    MIN  VAL END  */

dsql='insert into results values('''||TRIM(column_name)||''','''||TRIM(dbname)||''','''||TRIM(tname)||''','||totcount||','||uniqcount||','||nullcount||','||notnullcount||','''||TRIM(BOTH' ' FROM minval)||''','''||TRIM(BOTH' ' FROM maxval)||''',0);';

Thanks,

Karthik

Senior Supporter

Re: 3760:String not terminated before end of text

I don't see the issue here right now.

Usually I don't specify the ' ' in the Trim as this is the default.

So TRIM(BOTH from maxval) should be Ok. But the syntax seems never the less correct.

Could you share the data types for the different input parameters and the ddl of the result table? Are the char fields latin or unicode?