×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




You can specify the database name, user name, and password to connect
with as host variables.

Matt 

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Carel Teijgeler
Sent: Tuesday, April 25, 2006 1:49 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: RPG Embedded SQL connect to PC Websphere db

Kurt,

I think at compilation time you have to set the RDB of the SQLRPGLE
programme. Default is *LOCAL, which means you cannot connect to a remote
database. You have to recompile thenprogramme I fear and set those
compile options correctly, I fear.

Perhaps there is a way to have an SQLRPGLE programme that can beused to
connect to the local DB and any remote DB. I would like to know that to.

Regards,
Carel Teijgeler

*********** REPLY SEPARATOR  ***********

On 25-4-06 at 11:53 Kurt Anderson wrote:

>When I'm in interactive SQL (strsql), I can connect to the PC Websphere
db by doing:
>       connect to webdev user username using 'password'
>(I then see it change data refresh from *always to *forward, commit
from
>*none to *cs, allow copy data from *yes to *optimize, naming from *sys
>to *sql, datfmt from *mdy to *usa, and timfmt from *hms to *jis.)
>>From there I can then interact with the database.
> 
>But in RPG, I'm having issues connecting.
>I'm attempting to emulate the parenthetical above (the allow copy data
>is the compile default, and I don't know how to change the refresh to
*forward).
>C/EXEC SQL
>
>C+ Set Option COMMIT =*CS, NAMING =*SQL, DATFMT =*USA, TIMFMT =*JIS
>
>C/END-EXEC
> 
>I issue the connect (the host variables are all defined as 10a):
>C/EXEC SQL
>C+ Connect To :rdb User :userid Using :pw
>C/END-EXEC
>I then get SQL0862
>"Local program attempted to connect to a remote relational database."
>The recovery says to use the RDB parameter on the compile.  I'd rather
>not because the relational database I'm connecting to is different
>depending on what box this program is running on.
> 
>v5r2




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2026 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.