Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AS/400 'SELECT 1' Equivalent

I'm trying to help a friend troubleshoot connection problems with an AS/400. He'd like to run a query against the AS/400 that will always return a record, (similar to a SELECT 1 against MSSQL).

He's attempted running SELECT 1 but without luck ... I'm assuming that the AS/400 expects a FROM TableName ...

Can anyone provided assistance? Is there a system table/file that always exists that he can run a SELECT TOP 1 (or it's equivalent) against? I've never interacted with an AS/400 so I'm a bit out of my element ... was hoping SO could give me a quick answer ...

Thanks in advance!

like image 638
cookbr Avatar asked Mar 16 '10 13:03

cookbr


2 Answers

I'm pretty certain it's DB2 running on those boxes (they're called iSeries now, by the way) so you can give:

select * from sysibm.sysdummy1

a shot. This should return a single column IBMREQD, set to Y.

like image 193
paxdiablo Avatar answered Oct 03 '22 06:10

paxdiablo


table QSQPTABL can also be used for this.

like image 22
Mohamed Avatar answered Oct 03 '22 07:10

Mohamed