Home » Open Source » Programming Interfaces » show oracle column names
show oracle column names [message #483098] Thu, 18 November 2010 07:23 Go to next message
dior
Messages: 25
Registered: April 2009
Junior Member
Hi,

if I have a select like:

select val1, val2, val3 from TableXY


I´m be able to show the results in a php file with:

Quote:

echo $row[0];
echo $row[1];
echo $row[2];
.

How can I show the Column Names from the Colums from TableXY to the corresponding row values?

[Updated on: Thu, 18 November 2010 07:26]

Report message to a moderator

Re: show oracle column names [message #483103 is a reply to message #483098] Thu, 18 November 2010 07:39 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
How can I show the Column Names from the Colums from TableXY to the corresponding row values?

I can't imagine how should that look like. Could you explain it (possibly with an illustration)?
Re: show oracle column names [message #483104 is a reply to message #483103] Thu, 18 November 2010 07:45 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9077
Registered: November 2002
Location: California, USA
Senior Member
http://forums.oracle.com/forums/thread.jspa?messageID=4412298
Re: show oracle column names [message #483105 is a reply to message #483098] Thu, 18 November 2010 07:52 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
How can I show the Column Names from the Colums from TableXY to the corresponding row values?


Depending on what you exactly want you can oci_fetch_assoc or oci_fetch_all instead of oci_fetch_array.
oci_field_name can also did the trick for you but requires 2 calls (one for the fields and one for the result).

Regards
Michel


[Updated on: Thu, 18 November 2010 07:56]

Report message to a moderator

Re: show oracle column names [message #483107 is a reply to message #483105] Thu, 18 November 2010 08:09 Go to previous messageGo to next message
dior
Messages: 25
Registered: April 2009
Junior Member
how it looks like!

table in the db:
value1   value2
  3        a
  2        a
  5        c


and what I need is the "Value1" and "Value2"

what i now get is only this:
  3        a
  2        a
  5        c
Re: show oracle column names [message #483109 is a reply to message #483107] Thu, 18 November 2010 08:46 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And did you try what we pointed you to?
Or do you want we write the code for you? Which by the way is written in Barbara's link and in the links I posted.

Regards
Michel

[Updated on: Thu, 18 November 2010 08:47]

Report message to a moderator

Re: show oracle column names [message #483111 is a reply to message #483109] Thu, 18 November 2010 08:58 Go to previous messageGo to next message
dior
Messages: 25
Registered: April 2009
Junior Member
what should I say? yes, please!, of course!

but I only answered to Littlefoot! sorry that I´ve read your posting at that time!

thx
Re: show oracle column names [message #483112 is a reply to message #483111] Thu, 18 November 2010 09:02 Go to previous messageGo to next message
dior
Messages: 25
Registered: April 2009
Junior Member
Oh, I forgot!! I´t work´s... Barbara and Michel... Thank you very much!! Smile
Re: show oracle column names [message #483113 is a reply to message #483112] Thu, 18 November 2010 09:08 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Sorry to be so quick to answer. Embarassed

Regards
Michel
Previous Topic: WEB ADI Error
Next Topic: ORA-17410 No more data to read from socket
Goto Forum:
  


Current Time: Thu Mar 28 13:45:38 CDT 2024