cancel
Showing results for 
Search instead for 
Did you mean: 

run sql statement in green screen

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

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

Former Member
0 Kudos

hi Sally Power,

thanks for the link.

and you are right with the sql statement, by putting my sid in r3siddata, it works.

thanks.

regards,

kent

Former Member
0 Kudos

Hi Kent,

if you are looking for something, that reminds the old SQLs and uses a "/" for the delimiter, get the free STR(CON)SQL tool :

http://www.easymarketplace.de/strsql-sqlutil.php

If you do not receive a mail within 15 minutes, please drop me a mail, I will then reply with the user & pwd ...

Regards

Volker Gueldenpfennig, consolut international ag

http://www.consolut.de - http://www.4soi.de - http://www.easymarketplace.de

Answers (3)

Answers (3)

Former Member
0 Kudos

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

JanStallkamp
Employee
Employee
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

HI,

are you talking about which green screen?

you can execute query in i series navigator.

regards,

kaushal

Former Member
0 Kudos

hi kaushal malavia,

i am using Symtrax Telnet to access to the OS level.

any other options if i dont have iseries navigator installed ?

regards,

kent

Former Member
0 Kudos

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