Skip to Content
avatar image
Former Member

run sql statement in green screen

dear as/400 guru,

i wonder how to execute sql statement in green screen ?

my statement would be something as below

select mandt from sapr3.usr02 where bname='kent';

basically i want to check my id "kent" is available in which clients in an instance. and i was advised to run above sql statement.

comment and advice will be highly appreciated.

thanks

regards,

kent

as/400 newbie

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    May 27, 2008 at 09:45 AM

    Hi Kent,

    You can find IBM's doc. for the QShell SQL Utility at http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/index.jsp?topic=/rzahz/rzahzdb2utility.htm

    The format is a bit different in that utility then in STRSQL or SQLUTIL but I think the problem with your statement is that the library name is incomplete; it should read:

    db2 "select mandt from r3siddata.usr02 where bname='kent';"

    where sid is the system id of your SAP system.

    Regards,

    Sally Power

    Dev. Support for SAP in IBM i

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 27, 2008 at 08:51 AM

    HI,

    are you talking about which green screen?

    you can execute query in i series navigator.

    regards,

    kaushal

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      you can not execute select on normal telnet mode.

      might be some functionality required.

      I'm using i seires navigator to execute query

      regards,

      kaushal

  • May 27, 2008 at 09:07 AM

    Hi Kent.

    If you are on the green screen try command STRSQL. If that is not available you can try SQLUTIL. If that is not available too you can use the following:

    - Start the Shell QSH

    You can enter SQL-Statements after the prompt:

    $
    db2 "<sql-statement>"

    Best regards,

    Jan Stallkamp

    PS:

    Please don't call people 'gurus' in your postings. Some don't like it.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi jan,

      thanks for your PS advice.

      when i execute the commands u provided, it prompted below

      Command SQLUTIL in library *LIBL not found.

      Command STRSQL in library *LIBL not found.

      for

      qsh

      > db2 "select mandt from sapr3.usr02 where bname='kent';"

      after enter nothing happen. i wonder if the sql statement is correct.

      regards,

      kent

  • avatar image
    Former Member
    Sep 04, 2008 at 08:53 PM

    Kent,

    You can use Mocha to connect to AS/400 and login as <SID>ADM

    Once you are in the green screen at the commeand level type: strsql

    It will open an SQL Utility for you

    Then you can run: select mandt, bname from usr02 where bname='<USER ID>'

    Thank You

    Reg,

    Kishore

    Add comment
    10|10000 characters needed characters exceeded