How to get a list of tables in another volume/application? (AREV Specific)
At 01 FEB 2008 04:34:17PM Michael Slack wrote:
Hello:
I'm working in AREV 3.12. I've been directed to create a proof of concept application to see about exporting some of our data into SQL tables. Yes, I know about OpenInsight 8 and have a good idea that if we had it, this wouldn't be an issue. But we don't have it and I have no pull to get it (as much as I'd like to). Such is life.
The actual application I'm writing is fairly straight forward. I'm writing it as a stand alone application. It's simple enough to attach antother volume/application and do a setfile to a table and go from there.
What I would like to do is to create a list of the tables in a selected volume/application, more or less on the fly. That is where my problem lies. I can't seem to find a way of doing that. That's not entirely true, I know I can do a SETFILE to the REVMEDIA in the target application but I would prefer not going that route if I can help it. I don't want to open myself up to possible programming/logic errors on my part that messes that data up (and then would cause me a world of headaches).
Is there any way to just get a list of tables in an another application? Being able to filter the list based on things like application and location would be nice.
If anyone can point me in the right direction, that would be a big help.
Thanks,
Michael Slack
At 01 FEB 2008 05:57PM Victor Engel wrote:
REVMEDIA belongs to the SYSPROG application, so you don't need to know the other application name, if that's what you're worried about. If you don't want to setfile to it and browse through it, I don't know what else you could do.
At 02 FEB 2008 12:42PM Warren Auyong wrote:
The only way really is to parse the REVMEDIA file for any given volume.
Kludge method: Pdisk the output from "LISTMEDIA volume (P" and read the DOS file parsing out the files.
More elegant methods would involve using SETFILE/SETALIAS or system subroutines and RTPs and reading the REVMEDIA files directly. It probably would not be prudent to detail these methods in an open forum.
At 04 FEB 2008 04:53AM Aaron Kaplan wrote:
As the others have said, there's not really a programatic way to do this in ARev. You'll need to go direct to the REVMEDIA file to obtain the file list.
You can SETFILE to the system, or you can use the ATTACH_REVMEDIA program found in Disk 4 of the Advanced Revelation Developer Utilities.
The REVMEDIA file is just another LH file, so unless something actually writes to the file, you can't cause any corruption.
As far as I recall, ARev didn't have a 'LIST_VOLUME_SUB' or other process to pull back the information. It would process the information direct from the REVMEDIA file and display it in a the popup (for a generic LISTMEDIA) or actually attach the files.
Revmedia, Volume 2, Issue 8 has an example on how to use RTP49 to get the file handle. However, there's an error in the code as displayed.
FS=D
should probably be
FS=C
which is code that worked for me.
At that point, you have have the handle you need to SELECT into the REVMEDIA file.
At 04 FEB 2008 03:21PM Michael Slack wrote:
Thanks for the information. I was hoping for a simpler way but not this time.
Again thanks,
Michael Slack
At 04 FEB 2008 03:59PM Aaron Kaplan wrote:
Well, there is a simpler way in OpenInsight… :)
At 11 FEB 2008 06:45AM Eric wrote:
At 13 FEB 2008 05:59PM DSig wrote:
Michael,
Since you already have multi developer license of OI you could simply attach the tables and view the files that way. Then use warehousing tools to simply move data over to SQL.
If you want some help with that give me a shout