|
-
How to handel preserved words (as a columnname) into a stored procedure??
Hi out there,
Due to some history development (not mine) we had to convert and Interbase database into an Oracle environment. Some tables-columns where named "LABEL". This gave no problem into Interbase and when using a SQL editor this columns can be qeuried in Orcale. But when I want to define a cursor into a stored procedure it returns an error that it will not regognize the right datatype.
Here's the code I use;
SELECT ITEM.ITEM_CODE,
ITEM.LABEL||'_'||LPAD(ITEM.ITEM_CODE,4,0) AS TABCOL
FROM ITEM
WHERE ITEM.MODULE_CODE = xxxx
ORDER BY ITEM.ITEM_CODE;
Where to use it...
this one works
L_COLUMNS1 := L_COLUMNS1||', ANSW'||R_C_ITEM.ITEM_CODE||' NUMBER' ;
But this one is NOT
L_COLUMNS1 := L_COLUMNS1||','||R_C_ITEM.TABCOL||' NUMBER' ;
I found out that the last one is not working because the LABEL column is a preserved word in Oracle. ( replace it by one of the other columns and it will work )!!
PLEASE HELP ME OUT ON THIS
Regards
GKramer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|