Midrange News for the IBM i Community

Posted by: clbirk
an idea for a tool
has no ratings.
Published: 22 May 2014
Revised: 23 May 2014 - 3479 days ago
Last viewed on: 28 Nov 2023 (3847 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

an idea for a tool Published by: clbirk on 22 May 2014 view comments(2)

On this forum and at a training session I went to, some folks go and "save" a copy of the sql commands to create a table in a source (rather than simply going in inav and regenerating it).

What would be "nice" is to have a tool that would generate a single file (and its indexes (very important)) or a whole schema (library) of all the tables.

like getmesql (mytable/myschema)   which would return the create and all field definitions along with any and all "LF's" (indexes).

or you could say  getmesql(*all/myschema) which would return all tables and indexes.

Personally I don't store them, but at times I do blow away a table and rebuild it so I have to first go get the sql from inave and get the indexes.



Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Comment on: an idea for a tool
Posted: 9 years 6 months 11 days 11 hours 16 minutes ago

The RTVSQLSRC command I wrote years ago does that, but only for an indiviual file. You could do a DSPDBR over the table in question and then issue RTVSQLSRC over each corresponding object.

I think the source for RTVSQLSRC is on this site (just search for it).

It just uses the corresponding IBM i API under the covers anyway, so you could write your own.


Posted by: clbirk
Premium member *
Comment on: an idea for a tool
Posted: 9 years 6 months 10 days 13 hours 28 minutes ago

when you said years ago, I did a google search (as didn't find it here), and saw a forum posts from way back in like 2003. Of course some of the threads questioned why you would use sql instead of dds to set up a file, which to me, in this day and age, it makes no sense to use dds, only to use sql. But that is probably a hot topic.