Kind of a follow up to my self-answered question about finding the column names.
In UniVerse you can't query a file for all of its columns unless the @ phrase in your file's dictionary is set to all of the tables columns. If it isn't, how do you query a table for all of its columns' values?
So I can get the total column listing (column name & display name) using:
LIST DICT file NAME
This will return a listing of all columns and their display names. How do I then query the table for all of the columns it has?
LIST file
Will only query it for LIST file @id (@id is the only thing in @).
UPDATE
I found a blog -- a living breathing person who id using a version of UniVerse older than mine!! where he complains about the same thing, but says there is no solution shy of updating @ with all of the columns, please god someone prove him (Dan Watts) wrong.
What if you have a 200 column table and you want SELECT * to return all 200 columns? Sorry, but you’ll have to enter all 200 column names in that "@" record. And if you add, delete or rename a column, you’ll have to remember to edit that "@" record. I feel your pain! This cumbersome approach dates back to UniVerse’s ODBC driver, and I suppose they can’t change it now without breaking a lot of applications. You can find the details described in inscrutable IBM-ese in the UniVerse ODBC Guide.
LIST ALL does not work on Universe.
One thing you can do is LIST.ITEM or LIST-ITEM depending on your flavor. This will list every attribute in the file that has data in it like this:
>LIST.ITEM ACTIVITY
LIST.ITEM ACTIVITY 06:52:10pm 14 Jan 2010 PAGE 1
1
001 LEXMARK MULTI PRINT
002 THD
003 PJ
007 10355
009 Y
010 CAGNEW
011 15349
012 52111
014 1ý2ý3ý4ý5
015 Deinstall Make/ModelýDeinstall LocationýSigned Off ByýData/Voice AvailableýR
elocated Location
016 1ý2ý3ý4ý5
2
001 OMN
002 OMN
003 PJ
004 OMN*8437
005 6
009 N
010 CAGNEW
011 15349
012 51958
>
If you're looking to do something with the data then write a program and do something like this:
OPEN "ACTIVITY" TO F.ACTIVITY ELSE STOP
SELECT F.ACTIVITY
LOOP
READNEXT ID ELSE EXIT
READ R.ACTIVITY FROM F.ACTIVITY, ID THEN
..................
END
REPEAT
LIST.ITEM filename. This will return all the values
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With