Home » Developer & Programmer » Forms » load data from table outside of block into non db item (ofb 11g)
icon13.gif  load data from table outside of block into non db item [message #668793] Wed, 14 March 2018 14:51 Go to next message
mattsme
Messages: 3
Registered: March 2018
Junior Member
hi,
so i have a 2 block form
first part is
student
netid with a button to execute query
second is module_registration
they are joined by student.netid=registration.netid
i have db item mcode in and populating however i have to have 4 non db items as follows

mtitle- this is in module table
fee- as is this

photo-this is stored in student as blob and retrieves from file

total fee- total for students registered modules.

how do i get the mtitle to display data from module table? i know its a trigger but i dont know the syntax.
Re: load data from table outside of block into non db item [message #668839 is a reply to message #668793] Fri, 16 March 2018 14:21 Go to previous message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Code you should use is the same as the one you'd use in (PL/)SQL to retrieve values from some table, using the appropriate WHERE condition.

Why did I mention both SQL and PL/SQL? Because you should first test it in SQL*Plus (or any other tool you use to access the database), such as

select mtitle, fee, ...
  from some_table
  where mcode = :some_mcode;

Once you're satisfied with it, copy/paste it into Forms, but - as Forms is PL/SQL, include the INTO clause and - instead of a parameter - use item's name (along with the data block it belongs to), such as


select mtitle, fee, ...
  into :student.mtitle, :student.fee, ...     --> this ...
  from some_table
  where mcode = :student.mcode;               --> ... and this
Previous Topic: trigger to retieve data into non database item
Next Topic: Not able to compile oracle forms 12c on linux
Goto Forum:
  


Current Time: Fri Apr 19 13:44:13 CDT 2024