Home » SQL & PL/SQL » SQL & PL/SQL » can I convert a variable of table%rowtype to varchar2 type?
can I convert a variable of table%rowtype to varchar2 type? [message #2125] Sat, 22 June 2002 21:20 Go to next message
keane
Messages: 23
Registered: June 2002
Junior Member
hi,
I wanna convert a variable of table%rowtype to a variable of varchar2 type. But I don't know the columns of table. Is it possible? thanks a lot!

keane
Re: can I convert a variable of table%rowtype to varchar2 type? [message #2140 is a reply to message #2125] Mon, 24 June 2002 03:11 Go to previous messageGo to next message
John R
Messages: 156
Registered: March 2000
Senior Member
No.

A Rowtype is a composite record, with one item for each column in the table, and as such is almost certainly not the same as a varchar2.

What you might be able to do is to concatenate the various items together and put the result into a varchar2.
******ONE MORE QUESTION*******Re: can I convert a variable of table%rowtype to varchar2 type? [message #2143 is a reply to message #2125] Mon, 24 June 2002 05:11 Go to previous message
keane
Messages: 23
Registered: June 2002
Junior Member
I come out a way to concatenate the various items together and put the result into a varchar2. that is, firstly, get the columns of the table by query the user_tab_columns view, then according to the columns to get the various items from the rowtype variable. Is it a good way? One more problem is , if we want to concatenate two varchar2, we can use || sign, but what about integer and boolean values? thanks a lot.
keane
Previous Topic: Printer handling
Next Topic: ORA-2287 sequence not allowed here
Goto Forum:
  


Current Time: Wed Apr 24 19:07:25 CDT 2024