Subject | Pass Column Number as Variable |
---|---|
Author | Muthu Annamalai |
Post date | 2006-12-09T02:57:27Z |
I have the following stored procedure and I am not able to pass a
variable to the upper function in the select. I need to pass integer
value as per requirement. When I pass integer value directly in stored
procedure and compile, it compiles, but when i pass integer variable it
says column unknown.
FOR
SELECT VENDOR, DEPARTMENT, CATEGORY,ITEMSTYLE,PRICE,ITEMSTYLE.ID,
BARCODE
FROM DEPARTMENT, CATEGORY, ITEM, ITEMSTYLE, VENDOR
WHERE ITEMSTYLE.ITEMID = ITEM.ID AND
ITEM.VENDORID = VENDOR.ID AND
ITEM.CATEGORYID = CATEGORY.ID AND
CATEGORY.DEPTID = DEPARTMENT.ID AND
UPPER(DEPARTMENT) LIKE UPPER(:SEARCHCHAR) ||'%'
ORDER BY 1,2,3,4
INTO :VENDOR, :DEPARTMENT, :CATEGORY, :ITEMSTYLE, :PRICE, :ITEMSTYLEID
, :BARCODE
DO SUSPEND;
Thanks,
Muthu Annamalai
variable to the upper function in the select. I need to pass integer
value as per requirement. When I pass integer value directly in stored
procedure and compile, it compiles, but when i pass integer variable it
says column unknown.
FOR
SELECT VENDOR, DEPARTMENT, CATEGORY,ITEMSTYLE,PRICE,ITEMSTYLE.ID,
BARCODE
FROM DEPARTMENT, CATEGORY, ITEM, ITEMSTYLE, VENDOR
WHERE ITEMSTYLE.ITEMID = ITEM.ID AND
ITEM.VENDORID = VENDOR.ID AND
ITEM.CATEGORYID = CATEGORY.ID AND
CATEGORY.DEPTID = DEPARTMENT.ID AND
UPPER(DEPARTMENT) LIKE UPPER(:SEARCHCHAR) ||'%'
ORDER BY 1,2,3,4
INTO :VENDOR, :DEPARTMENT, :CATEGORY, :ITEMSTYLE, :PRICE, :ITEMSTYLEID
, :BARCODE
DO SUSPEND;
Thanks,
Muthu Annamalai