problem with LOVs [message #84095] |
Wed, 28 January 2004 05:04 |
John Charles
Messages: 5 Registered: January 2004
|
Junior Member |
|
|
hello
I'm novice in forms and i'm getting a problem with LOVs.
The situation is like this:
Resuming my problem, I've got two tables:
table 1 (organism)
field name: name type: varchar2(50)
field name: id type: integer
field name: org_id type: varchar2(50)
FOREIGN KEY (org_id) REFERENCES organism_type (id)
table 2 (organism_type)
field name: name type: varchar2(50)
field name: id type: integer
my form is composed with two blocks
block 1
organ (based table organism)
block 2
org_type (based table organism_type)
Then, in my canvas I've two fields
text Item 1
org_type.name
text Item 2
organ.name
Each field is related with a respective LOV (LOV1 for org_type.name, LOV2 for organ.name), so that the user must choose a value from a LOV in both fields.
The problem is that I want to depend the results of the second field (organ.name) from the first field (org_type.name). In the first field, the user choose a name of a organism_type in LOV1, then I want to pick up that name and his corresponding id to filter the values of the second LOV2 (suposing there's only distinct names with distinct id's). The query of the second LOV should seems like this:
select o.name
into :organ.name
from organism o
where o.id = :org_type.id
and the values would be filtered.
When I Compile the form I get this errors:
FRM-30064: Unable to parse statement
select o.name
into :organ.name
from organism o
where o.id = :org_type.id
ORA-01745:invalid host/bind variable name
Record Group ORG
Form: ORG
FRM-30085: Unable to adjust form for output.
What am i doing wrong, and what alternatives do i have to override this problem.
Thanks and Regards.
|
|
|
Re: problem with LOVs [message #84107 is a reply to message #84095] |
Fri, 30 January 2004 00:49 |
Stef
Messages: 8 Registered: April 2003
|
Junior Member |
|
|
Do not use the "into" statement in the second LOV query.
Simply specify the target field in the lov properties and it shall work.
In addition, you can put a control on the show-lov trigger to check if the first lov has already been consulted and the :org_type.id field is already valorized.
Stef
|
|
|
|