× 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.



- only one CONNECT in the program
- the service program itself has no sql statements. it just calls another rpg 
which does the CONNECT TO.
- naming is both *sys 
- activation group is *caller

thanx for any help

mihael

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im 
Auftrag von BirgittaHauser
Gesendet: Freitag, 12. Januar 2007 19:00
An: 'RPG programming on the AS400 / iSeries'
Betreff: AW: sql connect to in a service program

Hi,

Just a few questions: 
In the service program is there more than one connect to the database?
Did you already execute an SQL-Statement in the service program (before
executing your connect statement)?
You said, it works as long as the procedure is embedded in a program. Does
the program run in the same activation group as the caller?
When compiling the program and the service program, did you specify the same
naming in the create command (or through a SET OPTION Statement)? Which one
*SQL or *SYS?

... to be honnest I have some ideas, what could be happened, but I'm not
sure how it really works.
But may be my questions will help. 

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok) 

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Knezevic, Mihael
Gesendet: Friday, January 12, 2007 09:56
An: RPG programming on the AS400 / iSeries
Betreff: AW: sql connect to in a service program


i don't think that it is coincidental because if i put the procedure out of
the service program and into the main/calling program everything works fine.

fyi: the user running the job and the user in the connect statement are not
the same. 

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von rob@xxxxxxxxx
Gesendet: Donnerstag, 11. Januar 2007 17:04
An: RPG programming on the AS400 / iSeries
Betreff: Re: sql connect to in a service program

It might be coincidental.  I read the text on SQL7022.  You may have 
multiple CONNECTs.  Perhaps you already have a connection going from a 
previous SET CONNECT?  If that is the case then you probably are in the 
second condition of the help

DSPMSGD SQL7022 QSQLMSG
1. Display message text
Message . . . . :   User &1 not the same as current user &2.  
Cause . . . . . :   One of the following occurred.  
    -- User &1 was specified in a CONNECT statement that specified the 
local 
  relational database name. The user specified is not the same as the 
current 
  job user &2.  
    -- User &1 was specified in a CONNECT statement and a connection using 
&2 
  already exists to the specified relational database using connection 
method 
  *DUW.  
Recovery  . . . :   If connecting to the local relational database, change 
the
  statement so the user specified on the CONNECT is the same as the 
current 
  job user ID.  
    If connecting to a remote relational database, either use the SET  
  CONNECTION statement to use the existing connection or end the current   

  connection and issue the CONNECT statement with the new user id.

Rob Berendt

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.