Question

So I need to put this project together for school, but I'm ONLY allowed to use oracle forms builder.

I'm trying to do a simple query and assign values to the form objects based on what I get from the query, but my form items are coming up as undeclared. Does anyone know how I can modify form attributes like this? This user interface on this program is awful, so doing it through the wizards is something I'd really like to avoid if I can just make things happen in PL/SQL.

Here's what I have: enter image description here Still trying to find a working solution.

I've modified my code a bit:

DECLARE
    pmrn patient.p_mrn%TYPE;
    var_ptuple patient%ROWTYPE;
BEGIN
    pmrn := NAME_IN('MRN_FIELD');
    SELECT * INTO var_ptuple from patient WHERE patient.p_mrn = pmrn;
    :PATIENT_BLOCK.FNAME := var_ptuple.p_fname;
    :PATIENT_BLOCK.LNAME := var_ptuple.p_lname;
END;

Using the where on the data block doesn't really suit these purposes because I would like to retrieve the data based on the user input. Ie. the user needs to input the correct user ID to see their records.

Was it helpful?

Solution

Form items can be referred to as bind variables in Forms PL/SQL, e.g.

pmrn := :PATIENT_BLOCK.MRN_FIELD;
:PATIENT_BLOCK.FNAME := var_ptuple.p_fname;

etc.

Be aware, however, that you most probably don't need to write all this code. Just set the block source to be the table and execute a query on it - Forms will take care of loading the records for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top