SELECTing an Oracle constant in a view
#1
![Default](https://www.scoobynet.com/images/icons/icon1.gif)
I'm more of a SQL Server dude normally... anyone know how to do this? (If it's possible)
I'm getting:
ORA-06553: PLS-221: 'CONSTNAME' is not a procedure or is undefined
I'm getting:
ORA-06553: PLS-221: 'CONSTNAME' is not a procedure or is undefined
#6
Scooby Regular
Join Date: Jul 2000
Location: Islington
Posts: 2,145
Likes: 0
Received 0 Likes
on
0 Posts
![Default](https://www.scoobynet.com/images/icons/icon1.gif)
wouldn't it be better to maintain your constants in their own 'tblConstants' rather than coded in a package, especially when you know you'll be referencing them from SQL?
Trending Topics
#8
![Default](https://www.scoobynet.com/images/icons/icon1.gif)
Originally Posted by Fosters
or is the SQL in the package and you want to access the constant that's defined in the package that the SQL is also in?
Selecting a constant should be quicker than adding another table join to the view?
#9
Scooby Regular
Join Date: Jul 2000
Location: Islington
Posts: 2,145
Likes: 0
Received 0 Likes
on
0 Posts
![Default](https://www.scoobynet.com/images/icons/icon1.gif)
like this?
procedure ProcName(ioCursor out ref_cursor)
is
ConstantVar varchar2(3);
begin
ConstantVar := 'boll0x';
open ioCursor for
select table.*,ConstantVar
from table;
end;
procedure ProcName(ioCursor out ref_cursor)
is
ConstantVar varchar2(3);
begin
ConstantVar := 'boll0x';
open ioCursor for
select table.*,ConstantVar
from table;
end;
#11
![Default](https://www.scoobynet.com/images/icons/icon1.gif)
LOL @ boll0x
Good try, but it has to be a view not a procedure, so I can't use an intermediary variable
I don't think it's possible without placing the data in a table
Good try, but it has to be a view not a procedure, so I can't use an intermediary variable
![Frown](https://www.scoobynet.com/images/smilies/frown.gif)
Thread
Thread Starter
Forum
Replies
Last Post