|
Re: Select...AS.. .From error in oracle forms [message #208291 is a reply to message #208289] |
Sat, 09 December 2006 02:17 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/67693.png) |
saadatahmad
Messages: 452 Registered: March 2005 Location: Germany/Paderborn
|
Senior Member |
![saadatahmad](/forum/theme/orafaq/images/yahoo.png)
|
|
hi,
SELECT AS is compatible in Oracle forms as well. However, it'll not work unless you don't include an INTO clause in your code.
Your code should be like this.
DECLARE
v_plan_code NUMBER;
v_desc VARCHAR2(100);
BEGIN
select distinct(PLAN_CODE) As PROD_ID,DESCRIPTION
INTO v_plan_code, v_desc
from gtr_plan
WHERE ......
PLAN_CODE and DESCRIPTION should return only one value. Otherwise you'll get an error. If the query returns more than one rows, use cursor instead of simple variable.
regards,
Saadat Ahmad
[Updated on: Sat, 09 December 2006 02:18] Report message to a moderator
|
|
|
|
|
|