SQL CONNECT not allowed in embedded RPG - IBM AS400

This is a discussion on SQL CONNECT not allowed in embedded RPG - IBM AS400 ; I'm trying to do a CONNECT (Type 2) in RPG: c/exec sql c+ connect to remotesys user userid password 'passsword' c/end-exec The statement doesn't make it through the SQL precompiler: SQL0084 30 19 Position 9 SQL statement not allowed. What's ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: SQL CONNECT not allowed in embedded RPG

  1. SQL CONNECT not allowed in embedded RPG

    I'm trying to do a CONNECT (Type 2) in RPG:

    c/exec sql
    c+ connect to remotesys user userid password
    'passsword'
    c/end-exec

    The statement doesn't make it through the SQL precompiler:

    SQL0084 30 19 Position 9 SQL statement not
    allowed.


    What's wrong with it?

  2. Re: SQL CONNECT not allowed in embedded RPG

    Jonathan Ball wrote:
    > I'm trying to do a CONNECT (Type 2) in RPG:
    >
    > c/exec sql
    > c+ connect to remotesys user userid password 'passsword'
    > c/end-exec
    >
    > The statement doesn't make it through the SQL precompiler:
    >
    > SQL0084 30 19 Position 9 SQL statement not allowed.
    >
    >
    > What's wrong with it?


    Is 'password' valid? The reference shows USING:

    http://publib.boulder.ibm.com/infoce...fzmstcon2t.htm

    --
    Karl Hanson

  3. Re: SQL CONNECT not allowed in embedded RPG

    Karl Hanson wrote:

    > Jonathan Ball wrote:
    >
    >> I'm trying to do a CONNECT (Type 2) in RPG:
    >>
    >> c/exec sql
    >> c+ connect to remotesys user userid password 'passsword'
    >> c/end-exec
    >>
    >> The statement doesn't make it through the SQL precompiler:
    >>
    >> SQL0084 30 19 Position 9 SQL statement not allowed.
    >>
    >>
    >> What's wrong with it?

    >
    >
    > Is 'password' valid? The reference shows USING:


    That's actually what I have: USING. I wasn't looking
    at the actual source when I posted the message.


    >
    > http://publib.boulder.ibm.com/infoce...fzmstcon2t.htm
    >
    >
    > --
    > Karl Hanson


  4. Re: SQL CONNECT not allowed in embedded RPG

    What kind of remote system? If it ain't DB/2, then the user xxxx using
    'xxxxx' is not going to work. Please do post here when you find the answer
    though.

    -Paul


    "Jonathan Ball" wrote in message
    news:NLFih.1673$yx6.610@newsread2.news.pas.earthli nk.net...
    > Karl Hanson wrote:
    >
    >> Jonathan Ball wrote:
    >>
    >>> I'm trying to do a CONNECT (Type 2) in RPG:
    >>>
    >>> c/exec sql
    >>> c+ connect to remotesys user userid password 'passsword'
    >>> c/end-exec
    >>>
    >>> The statement doesn't make it through the SQL precompiler:
    >>>
    >>> SQL0084 30 19 Position 9 SQL statement not allowed.
    >>>
    >>>
    >>> What's wrong with it?

    >>
    >>
    >> Is 'password' valid? The reference shows USING:

    >
    > That's actually what I have: USING. I wasn't looking at the actual
    > source when I posted the message.
    >
    >
    >>
    >> http://publib.boulder.ibm.com/infoce...fzmstcon2t.htm -
    >> -
    >> Karl Hanson




  5. Re: SQL CONNECT not allowed in embedded RPG

    Try doing it inside a STRSQL session. If it works there I think it should
    compile.

    Sam

    "Jonathan Ball" wrote in message
    news:GxEih.1648$w91.487@newsread1.news.pas.earthli nk.net...
    > I'm trying to do a CONNECT (Type 2) in RPG:
    >
    > c/exec sql
    > c+ connect to remotesys user userid password 'passsword'
    > c/end-exec
    >
    > The statement doesn't make it through the SQL precompiler:
    >
    > SQL0084 30 19 Position 9 SQL statement not allowed.
    >
    >
    > What's wrong with it?




  6. Re: SQL CONNECT not allowed in embedded RPG

    P. Raulerson wrote:
    > What kind of remote system? If it ain't DB/2,


    It is. It's from one i5 to another (actually, one i5
    partition to another on the same box.)


    > then the user xxxx using
    > 'xxxxx' is not going to work. Please do post here when you find the answer
    > though.
    >
    > -Paul
    >
    >
    > "Jonathan Ball" wrote in message
    > news:NLFih.1673$yx6.610@newsread2.news.pas.earthli nk.net...
    >> Karl Hanson wrote:
    >>
    >>> Jonathan Ball wrote:
    >>>
    >>>> I'm trying to do a CONNECT (Type 2) in RPG:
    >>>>
    >>>> c/exec sql
    >>>> c+ connect to remotesys user userid password 'passsword'
    >>>> c/end-exec
    >>>>
    >>>> The statement doesn't make it through the SQL precompiler:
    >>>>
    >>>> SQL0084 30 19 Position 9 SQL statement not allowed.
    >>>>
    >>>>
    >>>> What's wrong with it?
    >>>
    >>> Is 'password' valid? The reference shows USING:

    >> That's actually what I have: USING. I wasn't looking at the actual
    >> source when I posted the message.
    >>
    >>
    >>> http://publib.boulder.ibm.com/infoce...fzmstcon2t.htm -
    >>> -
    >>> Karl Hanson

    >
    >


  7. Re: SQL CONNECT not allowed in embedded RPG

    P. Raulerson wrote:
    > What kind of remote system? If it ain't DB/2, then the user xxxx using
    > 'xxxxx' is not going to work. Please do post here when you find the answer
    > though.
    >


    Got it.

    When it's embedded in a program, the CONNECT has to use
    host variables instead of literals:

    c/exec sql
    c+ connect to :rmtsys user :rmtuser using :rmtusrpwd
    c/end-exec

    If you're issuing the command from STRSQL or an iSeries
    Nav SQL script processor window, you can use the literals.


    > "Jonathan Ball" wrote in message
    > news:NLFih.1673$yx6.610@newsread2.news.pas.earthli nk.net...
    >> Karl Hanson wrote:
    >>
    >>> Jonathan Ball wrote:
    >>>
    >>>> I'm trying to do a CONNECT (Type 2) in RPG:
    >>>>
    >>>> c/exec sql
    >>>> c+ connect to remotesys user userid password 'passsword'
    >>>> c/end-exec
    >>>>
    >>>> The statement doesn't make it through the SQL precompiler:
    >>>>
    >>>> SQL0084 30 19 Position 9 SQL statement not allowed.
    >>>>
    >>>>
    >>>> What's wrong with it?
    >>>
    >>> Is 'password' valid? The reference shows USING:

    >> That's actually what I have: USING. I wasn't looking at the actual
    >> source when I posted the message.
    >>
    >>
    >>> http://publib.boulder.ibm.com/infoce...fzmstcon2t.htm -
    >>> -
    >>> Karl Hanson

    >
    >


+ Reply to Thread