× 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 think you meant Vern - not Vam - that's OK!

Your original post said that you want the column headings and then the data 
underneath. Now you have added the need to pass the file and library as 
parameters - so you do not know what you have when you compile the program.

I still strongly suggest that you look at Query Management objects. With a QM 
query you can even pass the library and file name to the query - the column 
headings will automatically be set at the top of each column of data - you do 
not have to work hard to do this.

Your SELECT statement in the QMQRY would be

SELECT * FROM &LIB/&FILE

Then, let us say that you created the QMQRY with the name YOURLIB/YOURQRY

To execute it you would use the following:

STRQMQRY QMQRY(YOURLIB/YOURQRY)           
         OUTPUT(*PRINT)                   
         DATETIME(*YES)                   
         PAGNBR(*YES)                     
         SETVAR((LIB MYLIB) (FILE MYFILE))

This results in the SELECT statement

SELECT * FROM MYLIB/MYFILE

You use the STRQM command to create these queries - be sure to change to SQL 
creation mode. And you can use QCMDEXC to run it - in fact, you can run it in 
CL, not RPG. And even better, you could create a command to prompt for the 
library and file.

HTH
Vern

-------------- Original message -------------- 
From: Jitendra Bokshe <jitendra_pb@xxxxxxxxxxx> 

Thanks Vam & bala, 

Vam , 
what you interpreted is correct. 

But I just want to use Embeded SQL, and I tried for the same but the thing is 
that in Embeded SQL we need to define host sturture array. 

If I am passing a PF(table name) & Library name as a parameter to RPGLE 
program 
(means Runtime). So how it is possible? 

One more doubt is that can we pass the parameter to SELECT Statment?? (Don't 
slap me if u think that this question is silly) 

Thanks & Regards, 
Jitendra 



__________________________________________________________ 
Yahoo! India Answers: Share what you know. Learn something new 
http://in.answers.yahoo.com/ 

-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list 
To post a message email: RPG400-L@xxxxxxxxxxxx 
To subscribe, unsubscribe, or change list options, 
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l 
or email: RPG400-L-request@xxxxxxxxxxxx 
Before posting, please take a moment to review the archives 
at http://archive.midrange.com/rpg400-l. 

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.