Thomas B. Passin writes:
I want to run an SQL query, like
select * from person
Then I want to extract the column names from the returned data. In other words, I don't want to hand-code them into the result page. The "Shared.DC.ZRDB.Results.Results" objects, i.e. the objects returned by Z SQL Methods, have a method for this. I think it is "names".
Either search the mailing list archives or look into the sources. Dieter
Dieter Maurer wrote -
Thomas B. Passin writes:
I want to run an SQL query, like
select * from person
Then I want to extract the column names from the returned data. In other words, I don't want to hand-code them into the result page.
The "Shared.DC.ZRDB.Results.Results" objects, i.e. the objects returned by Z SQL Methods, have a method for this. I think it is "names".
Either search the mailing list archives or look into the sources.
I did both and didn't find it. But it turns out to be names(). Thanks to the list for helping. But it will be in your book, right? Cheers, Tom P
I remember posting this before, but something seems to have eaten it. Laurie Nason nailed it for me, many thanks Laurie. Here is a summary of the result: Given a ZSQL query named "query1", this DTML will execute the query and display a list of the column names: <dtml-let results=query1> <dtml-var "results.names()"> </dtml-let> And here it is using dtml-with: <dtml-with query1> <dtml-var "names()"> </dtml-with> Thanks to all for the help. Regards, Tom P
participants (2)
-
Dieter Maurer -
Thomas B. Passin