I often will use STRSQL, develop the statement that works (like select
coname from company where cokey = '123'), and then change it to be embedded,
like:

/ free
Exec SQL
Select coname into :Wkconame from company where cokey = :wkkey;



On Thu, Nov 12, 2009 at 11:23 AM, John Allen <jallen@xxxxxxxxxxx> wrote:

I have finally got the opportunity to learn embedded SQL in RPG ILE.

I have been searching on the web for the most basic example I can find for
my application
but everything I find has more then I need (I think) and it is confusing.



I find I can learn much quicker by seeing an example.

Does anyone have or can anyone point me to an example that does the
following (No more, no extra stuff that will confuse me)



I have a physical file with 10 fields (COMPANY)

The unique key field (Company Number) is two character field (Alpha),
The 5th field in the company file is a variable length field (Company
Name).

The only parameter I have coming in is the key value.



I would like to use SQL to retrieve the record for the key value (Company
Nbr) and get the value in the 5th field (Company Name) and place it in a
work field.



No updating, No deleting, just take the key value retrieve the company name
and place it in a work field



I know this is very easy to do with a simple chain, but I believe we could
do a lot more with embedded SQL in other programs
so I want to learn how to do this with SQL. Then hopefully all the other
examples on the web will make sense to me.





Thanks in advance

John



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



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.