Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS400 query results in a text file ??

Status
Not open for further replies.

jones54

Programmer
Sep 2, 2003
23
IE
Hi,

I posted a question yeterday about query version control. I haven't come across any solution to this problem therefore we have decided to include the queries in an executable and pass them to AS400. We will version control this executable!

Maybe someone can help me with this approach.

Is it possible to submit a query from an application to AS400 and instead of getting back a resultset, the results of the query are returned in a text file???
=> submit a query and a file withthe results is generated.

Appreciate any help,
Thanks
 
If you create a query using Query/400, the results can be in a physical file, on the display, or on the printer. However, you can genarate a comma-separated file (.csv) from Query's output file using the command CPYTOIMPF.


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Thank You for the reply flapeyre.

Your solution will generate the query results in a text file, however the command will have to be set up as an AS400 job to run automatically or else be invoked from Query/4.

We actually have files generated by an overnight job at the moment. What we now want to do is get rid of this overnight job and embed the SQL queries in a VB executable. These queries will then be submitted to AS/400. Instead of getting back a results set, I would like files to be generated by the query and stored in a network folder. The executable will then access these files.

Do you have an ideas on how this might be implemented? [if it is possible in the first case!]I have checked out the web but haven't come across anything.

Thanks
 
It may be possible to do what you want, but I'm not sure how. My own preference would be to have as much processing done by the AS/400 as possible. Having VB get the data via ODBC or somesuch just slows things down.



"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top