Home » SQL & PL/SQL » SQL & PL/SQL » Oracle 8i SQL form/subform problem
Oracle 8i SQL form/subform problem [message #21373] Tue, 30 July 2002 08:04 Go to next message
chhan
Messages: 19
Registered: June 2002
Junior Member
Hi All,

i hope someone out there can help me. i am having a problem with my Oracle8i form/subform. The relationship between my form/subform is 1:M. and this is the problem:

when i select a customer, i want my subform to display all the vehicles which belong to that customer. i can do this if i'm using SQL PLUS by typing:

select tblVehicle.VehicleRegestration, tblVehicle.VehicleOwnerID from tblVehicle, VVehicleOwner where tblVehicle.VehicleOwnerID=VVehicleOwner.VehicleOwnerID;

RESULTS:

VEHICLEREG VEHICLEOWNERID
---------- --------------
P23TCS 47
S11ETC 52
S1TON 54
T258CHB 54
T12PET 54
C144TES 47
A155SWE 47

but when i place this code in the form, it doesn't work. the code is placed in 'POST CHANGE' in VehicleOwnerID text box, below is a copy of the code(no error when compile):

begin
select Vehicleid, VehicleRegestration
into :tblVehicle.Vehicleid, :tblVehicle.VehicleRegestration
from tblVehicle
where VehicleOwnerid =:tblVehicle.VehicleOwnerid;
end;

if anyone can help or if they think this is the wrong place to place this message, please let me know.

Many thanks in advance.

Chhan
Re: Oracle 8i SQL form/subform problem [message #21625 is a reply to message #21373] Mon, 19 August 2002 06:57 Go to previous message
Nick
Messages: 64
Registered: February 2000
Member
Why don't u create a master detail relationship between Customer and customer details. Itv would create all the required queries for you.
Previous Topic: decode help
Next Topic: PL/SQL LDAP API
Goto Forum:
  


Current Time: Thu Mar 28 17:25:43 CDT 2024