NO DATA FOUND [message #165814] |
Sun, 02 April 2006 03:58 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
juicyapple
Messages: 92 Registered: October 2005
|
Member |
|
|
I add a Post-Text-Item trigger on a item textfield, if user key in A item, it query stock table for value of ind, if ind = Y, it will set date textfield as required and enabled. When I run the form and query for data, it shows error
POST-TEXT-ITEM trigger raised unhandled exception ORA-01403
ORA-01403: no data found
the codes are as below,DECLARE
ind stock._ind%TYPE;
BEGIN
SELECT ind
INTO ind
FROM stock
WHERE item = :form1.item;
IF ind = 'Y' THEN
Set_item_property('stock.date',
required,
property_true);
Set_item_property('stock.date',
enabled,
property_true);
ELSE
Set_item_property('stock.date',
required,
property_false);
Set_item_property('stock.date',
enabled,
property_false);
END IF;
END;
I am not sure is the problem because of the null value of ind in stock table. Please advise and give some guide on solving this.
Thanks.
Upd-mod: Please format your code and palce between 'code' tags.
[Updated on: Mon, 03 April 2006 02:36] by Moderator Report message to a moderator
|
|
|
Re: NO DATA FOUND [message #165847 is a reply to message #165814] |
Mon, 03 April 2006 01:25 ![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) |
pallavigs
Messages: 37 Registered: March 2006 Location: India
|
Member |
|
|
Hi,
In a host language program, all records have been fetched. The return code from the fetch was +4, indicating that all records have been returned from the SQL query.
Try terminate processing for the SELECT statement.
May be this will be helpful.
Pal.
|
|
|
|
Re: NO DATA FOUND [message #165887 is a reply to message #165847] |
Mon, 03 April 2006 03:38 ![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) |
juicyapple
Messages: 92 Registered: October 2005
|
Member |
|
|
I have to query from stock table to get the value of ind and thus to determine item property in form1.
Is the problem because of null value return from the select statement? I know the problem is because of it but I don't know why...
Please advise.
|
|
|
|
|
|
|
|
Re: NO DATA FOUND [message #166405 is a reply to message #166402] |
Thu, 06 April 2006 03:10 ![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/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Then the code should be SELECT ind
INTO ind
FROM stock
WHERE item = :mtransac.item;
Have you signed on? Have you tested your code at the SQL*Plus prompt having signed on using the same userid?
David
[Updated on: Thu, 06 April 2006 03:12] Report message to a moderator
|
|
|
Re: NO DATA FOUND [message #166409 is a reply to message #165814] |
Thu, 06 April 2006 03:40 ![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) |
juicyapple
Messages: 92 Registered: October 2005
|
Member |
|
|
yes, when I query from sqlplus,
SQL> select ind from stock
2 where item='1002825';
W
-
SQL>
But when I put the codes in Post-Text-Item trigger on a item textfield, I still get the error
POST-TEXT-ITEM trigger raised unhandled exception ORA-01403
ORA-01403: no data found
DECLARE
ind stock.ind%TYPE;
BEGIN
SELECT ind
INTO ind
FROM stock
WHERE item = :mtransac.item;
IF ind = 'Y' THEN
Set_item_property('mtransac.date',
required,
property_true);
Set_item_property('mtransac.date',
enabled,
property_true);
ELSE
Set_item_property('mtransac.date',
required,
property_false);
Set_item_property('mtransac.date',
enabled,
property_false);
END IF;
END;
|
|
|
Re: NO DATA FOUND [message #166498 is a reply to message #165814] |
Thu, 06 April 2006 12:02 ![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) |
M0nst3r
Messages: 38 Registered: February 2006 Location: Wherever the Money Is
|
Member |
|
|
DECLARE
ind stock.ind%TYPE;
BEGIN
SELECT ind
INTO ind
FROM stock
WHERE item = :mtransac.item;
IF ind = 'Y' THEN
Set_item_property('mtransac.date',
required,
property_true);
Set_item_property('mtransac.date',
enabled,
property_true);
ELSE
Set_item_property('mtransac.date',
required,
property_false);
Set_item_property('mtransac.date',
enabled,
property_false);
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
Set_item_property('mtransac.date',
required,
property_false);
Set_item_property('mtransac.date',
enabled,
property_false);
WHEN OTHERS THEN
Set_item_property('mtransac.date',
required,
property_false);
Set_item_property('mtransac.date',
enabled,
property_false);
END;
|
|
|
|
|