|
|
|
|
|
|
| Re: How to write stored function to return column name? [message #630300 is a reply to message #630297] |
Wed, 24 December 2014 04:49   |
 |
Michel Cadot
Messages: 68776 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote: SELECT TO_CHAR (COLUMN_NAME)
INTO v_date
FROM user_tab_columns
WHERE table_name = 'EMP'
AND column_name = 'HIREDATE';
1/ If you know the column name why do you query USER_TAB_COLUMNS to get the column name? The result is quite obvious
2/ COLUMN_NAME is of VARCHAR2 data type so isn't "TO_CHAR (COLUMN_NAME)" quite silly?
Quote:SELECT xxc_coluimn (i.HIREDATE)
INTO v_column
FROM emp i;
What is the meaning of this?
Quote:I am trying to do is need to return that column all the data using dynamic query
Loop on a cursor.
You have to work a little bit harder on this and first think about what you write.
What is the input? What is the output? It seems you want all the values of... of what?
[Updated on: Wed, 24 December 2014 04:50] Report message to a moderator
|
|
|
|
|
|
|
|
|
|