× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Yes. 
All the fields are defined with the correct data types, and the rows returned 
is SQLINTEGER.
 
The problem seems to occur when I try to return a value that is a result of a 
column function.
ie:
Sum(Dec(Days(Date(Digits(HhInDx) || SubStr(Digits(HhInDt),1,2) || '-' || 
SubStr(Digits(HhInDt),3,2) || '-'  || SubStr(Digits(HhInDt),5,2) )),7,0)) 
Inv_days
 
Thanks,
Jeff Young


----- Original Message ----
From: Grizzly Malchow <grizzlym@xxxxxxxxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Sent: Monday, August 14, 2006 1:02:52 PM
Subject: RE: SQL CLI Error


Are you receiving the error when binding or when you run the
SQlExtendedFetch function? 
Are all of the parameters you are passing/returning from the
SqlExtendedFetch the correct data types?

This is just a guess but is the variable you have defined for the number
of rows actually fetched (4th parameter) LIKE SQLINTEGER? 


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jeff Young
Sent: Monday, August 14, 2006 11:36 AM
To: midrange-l@xxxxxxxxxxxx; rpg400-l@xxxxxxxxxxxx
Subject: SQL CLI Error

I am receiving the following error when executing an SQLExtendedFetch
using the CLI interface:


Message ID . . . . . . :   MCH5003       Severity . . . . . . . :   40

Message type . . . . . :   Escape

Date sent  . . . . . . :   08/14/06      Time sent  . . . . . . :
11:53:46   


Message . . . . :   Scalar operand contains a value that is not valid.

Cause . . . . . :   The length of the invalid scalar operand is 7.  The
bit    
   offset to the invalid field is X'0001'. The operand number is 2.  The

   invalid data is X'03070000000000'.



If anyone has any idea what this is pointing to, I would appreciate any
any information.
I ran the exact statement (used cut & paste) using the iNav Run SQL
Script and it ran fine.
The data I am returning is defined in a DS with the following
attributes:

D Row DS Qualified
D Dim(Fetch_Size)
D Period Like(CdPerd)  Packed(4,0)
D WhNo Like(CdWhNo) Char 2
D PlCd Like(CdPlCd)   Char 2
D ICCd Like(CdICCd)  Char 2
D Itmn Like(CdItmn) Char 15
D AvgTyr Like(AvgTy) Packed(9,0)
D AvgLyr Like(AvgLy) Packed(9,0)

I am binding the columns as follows:
Rc = SQLBindCol( Stmt
: 1
: SQL_DECIMAL
: %Addr(Row(1).Period)
: %Len(Row(1).Period) * 256 + %DecPos(Row(1).Period)
: F1) ;
Check_Error( Rc: Env: Conn: Stmt: 'SQLBindCol(1)');
Rc = SQLBindCol( Stmt
: 2
: SQL_CHAR
: %Addr(Row(1).WhNo )
: %Size(Row.WhNo)
: F2) ;
Check_Error( Rc: Env: Conn: Stmt: 'SQLBindCol(2)');
Rc = SQLBindCol( Stmt
: 3
: SQL_CHAR
: %Addr(Row(1).PlCd)
: %size(Row.PlCd)
: F3) ;
Check_Error(Rc: Env: Conn: Stmt: 'SQLBindCol(3)');
Rc = SQLBindCol( Stmt
: 4
: SQL_CHAR
: %Addr(Row(1).ICCd)
: %Size(Row.ICCd)
: F4) ;
Check_Error(Rc: Env: Conn: Stmt: 'SQLBindCol(4)');
Rc = SQLBindCol( Stmt
: 5
: SQL_CHAR
: %Addr(Row(1).ItmN)
: %size(Row.ItmN)
: F5) ;
Check_Error(Rc: Env: Conn: Stmt: 'SQLBindCol(5)');
Rc = SQLBindCol( Stmt
: 6
: SQL_DECIMAL
: %Addr(Row(1).AvgTyr )
: %Len(Row(1).AvgTyr * 256) + %DecPos(Row(1).AvgTYr)
: F6) ;
Check_Error(Rc: Env: Conn: Stmt: 'SQLBindCol(6)');
Rc = SQLBindCol( Stmt
: 7
: SQL_DECIMAL
: %Addr(Row(1).AvgLYr)
: %LEN(Row(1).AvgLYr) * 256 + %DecPos(Row(1).AvgLYr)
: F7) ;
Check_Error(Rc: Env: Conn: Stmt: 'SQLBindCol(7)');

Thanks,

Jeff Young

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.