Link to home
Start Free TrialLog in
Avatar of Debsy23
Debsy23

asked on

UNI STUDENT NEEDS HELP! - POST-CHANGE TRIGGER

This will be an easy one for any experts!

I am doing a project on Oracle at uni and only have basic knowledge of Oracle.

I want to retrieve data into 3 display items from one code.

Ie: I have a clinic code and have created 3 display items for clinic_description, start_time and end_time.

How do I write the PL/SQL for the trigger to display all data in one go? I only know how to display it for one item.

So far it looks like this:
select clinic_description
into :clinic_appoint.clinic_description
from clinic
where :clinic_appoint.clinic_code=clinic.clinic_code;

I need the start_time & end_time to display in the clinic_appoint form as well.

Thanks!
Avatar of vemul
vemul

in which table are start_time and end_time stored? let's say they are stored in tableX

u would do something like

select clinic_description, start_time, end_time
into :clinic_appoint.clinic_description,
     :clinic_appoint.start_time,
     :clinic_appoint.end_time,
from clinic, tableX
where :clinic_appoint.clinic_code=clinic.clinic_code
and :clinic_appoint.clinic_code = tableX.clinic_code;

hope u get the idea
vemul
hi debsy23,
 if the suggestion I proposed helped you and u are satisfied with it, could u please accept my comment and close this question

thanks,
vemul
Avatar of Debsy23

ASKER

Sorry vemul for not accepting the answer yet, it is only because I can't get it to work yet. All the info was stored in the same table 'clinic' so when I changed it to suit, it looked like this:

select clinic_description, start_time, end_time
into :clinic_appoint.clinic_description,
    :clinic_appoint.start_time,
    :clinic_appoint.end_time,
from clinic
where :clinic_appoint.clinic_code=clinic.clinic_code;

It says that there is a problem with 'from'. I have tried variations.
what exactly did it say the problem was?. also can I presume clinic_description, start_time, stop_time are in the same table clinic?
Avatar of Debsy23

ASKER

Yes, they are all in the same table. It said 'encountered the symbol 'from' when expecting one of the following... mod <an identifier><a double-quoted delimited-identifier><a bind-variable>current sql<a single-quoted sql string>
The symbol "<an identifier>" was substituted for FROM to continue.

Which didn't give me much insight I am afraid.
ASKER CERTIFIED SOLUTION
Avatar of vemul
vemul

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Debsy23

ASKER

Thanks so much Vemul - its such a small change, but makes all the difference.
it was actually my mistake but glad we got it figured out..

good luck
vemul