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



I have a simple SQLRPGLE program, code at the end.

When I run this command to test it
TESTSQL2 HOSTNAME(GDISYS) USER(ROB) PASSWORD(keepguessing)
where GDISYS is the name of the local machine it works fine.

However when I run this:
TESTSQL2 HOSTNAME(GDIHQ) USER(ROB) PASSWORD(keepguessing)
I get SQL0805:
Message . . . . :   SQL package TESTSQL2 in ROB not found at DRDA Server.
DSPMSGD RANGE(SQL0805) MSGF(QSYS/QSQLMSG)

One workaround is to recompile the program, tell it to build me the 
package, and move the package to the remote machine.  Surely this is not 
what you have to do if I was to try this SQL from some PC application.  So 
how do I do the same?


     D TESTSQL2        PR                  EXTPGM('TESTSQL2')
     D  x                                  like(HostName)
     D  x                                  like(UserId)
     D  x                                  like(Password)

     D dHostName       s             10a
     D dUserId         s             10a
     D dPassword       s             10a

     D TESTSQL2        PI      *ENTRY PLIST
     D  HostName                           like(dHostName)
     D  UserId                             like(dUserId)
     D  Password                           like(dPassword)

     C/EXEC SQL
     C+ Set Option
     C+     Naming    = *Sys,
     C+     Commit    = *None,
     C+     UsrPrf    = *User,
     C+     DynUsrPrf = *User,
     C+     CloSqlCsr = *EndMod
     C/END-EXEC

     C/EXEC SQL
     C+ CONNECT TO :HostName USER :Userid USING :Password
     C/END-EXEC
      /free
       dsply sqlstt;
       dsply sqlcod;
      /end-free

     C/EXEC SQL
     C+ INSERT INTO ROB/TESTSQL2 VALUES('c', 'd')
     C/END-EXEC
      /free
       dsply sqlstt;
       dsply sqlcod;
      /end-free

     C/EXEC SQL
     C+ CONNECT RESET
     C/END-EXEC
      /free
       dsply sqlstt;
       dsply sqlcod;
      /end-free


      /free
       *inlr=*on;
       return;
      /end-free


Rob Berendt
-- 
"They that can give up essential liberty to obtain a little temporary 
safety deserve neither liberty nor safety." 
Benjamin Franklin 

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.