|
Folks,
Figured out the problem. I did not know how VARCHAR2 stores values.
Unlike a CHAR variable, Oracle does not store the trailing blanks. So,
when I tried to select against a CHAR I did not find a hit. I defined 2
VARCHAR fields in my program, trimmed out the trailing blanks and used
it my host variable.
D ITEM S 25A VARYING
D HIBC S 25A VARYING
C**************************************************
and
EVAL ITEM = %TRIMR(PSMFG#)
EVAL HIBC = %TRIMR(PSAITM)
Regards,
Ravi
Ravi wrote:
>
> Hello all,
>
> I am trying to select records from Oracle using Oracle Access Manager. I
> have created embedded SQL ILE RPG programs to do this.
> My cursor is defined as follows:
> C*
> C/EXEC SQL
> C+ DECLARE get_data CURSOR for
> C+ SELECT MODEL_NO,
> C+ CATALOG_NO,
> C+ DISTRIBUTION_NO,
> C+ DESCRIPTION_1_TXT,
> C+ DESCRIPTION_2_TXT
> C+ FROM EPR_VIEW_ATLAS_ITEM
> C+ WHERE MFG_NO = :ITEM#
> C+ AND HIBC_LIC_PROD_NO = :HIBC#
> C*
>
> I am able to connect to the remote system without a problem. I can
> select records from ORacle when I use literals in the WHERE clause. The
> problem arises when I use host variables in the WHERE clause. No records
> are selected. The host variables are defined in my RPG as Char and 15
> long. In Oracle the corresponding columns are defined as VARCHAR2 and
> 15 long. No errors are generated by the program. Is there a datatype
> mismatch? What is the equivalent data type on the AS/400 for a VARCHAR2
> ?
>
> Any help will be much appreciated......
>
> Thanks
>
> Ravi
> +---
> | This is the Midrange System Mailing List!
> | To submit a new message, send your mail to MIDRANGE-L@midrange.com.
> | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
> | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator: david@midrange.com
> +---
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.