Home » Developer & Programmer » Forms » Temporary table in forms (Forms 11g)
Temporary table in forms [message #675741] Tue, 16 April 2019 02:39 Go to next message
mitanen
Messages: 6
Registered: April 2018
Junior Member
Hi everybody!

I'm having trouble using GTT (global temporary table) in forms.
I have form A and form B. In form B I have only the temporary table. In form A before calling form B, with call_form, I insert data in temporary table.
The problem is that when form B is opened I can't see anything like there is no data in the table.

On WHEN-NEW-FORM-INSTANCE I have code that says go_block...do_key('execute_query');
On PRE-QUERY I checked if I have any data in GTT. I check with a cursor that executes select count(1) from GTT. It sees the records inserted.

Anybody have any idea why I don't see the data ?

Thank you!
Re: Temporary table in forms [message #675742 is a reply to message #675741] Tue, 16 April 2019 03:08 Go to previous messageGo to next message
John Watson
Messages: 8268
Registered: January 2010
Location: Global Village
Senior Member
Is your GTT defined with ON COMMIT DELETE ROWS or PRESERVE ROWS ?
Re: Temporary table in forms [message #675743 is a reply to message #675742] Tue, 16 April 2019 03:09 Go to previous messageGo to next message
mitanen
Messages: 6
Registered: April 2018
Junior Member
ON COMMIT DELETE ROWS.
Re: Temporary table in forms [message #675744 is a reply to message #675741] Tue, 16 April 2019 03:10 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well if the count is returning a non-zero value then there is data there so the problem is either going to be:
1) the query - use get_block_property(<block_name>, last_query) after the query has executed to see exactly what was submitted to the DB and check if it makes sense
2) list items or check boxes or radio groups - if you have those and the data in the corresponding DB column doesn't match one of the values they recognize (and you don't have mapping of other values set) then the record is silently ignored.
3) the GTT is set to on commit delete rows and a commit is being issued between the count and the main query (doubt it).

Those are the most likely culprits.
Re: Temporary table in forms [message #675745 is a reply to message #675744] Tue, 16 April 2019 04:16 Go to previous messageGo to next message
mitanen
Messages: 6
Registered: April 2018
Junior Member
Thanks cookiemonster!

I tried get_block_property(<block_name>, last_query) but it doesn't show me anything. It seems that I get FRM-40505 error now. But I can't tell why. I can't see a specific error. Forms compiles OK and the FMX is generating Ok. I tried to get the error from the menu Help >> error messages but says no error to show.

I don't have any check boxes or other buttons on the block. Just fields from the DB table.
Re: Temporary table in forms [message #675746 is a reply to message #675745] Tue, 16 April 2019 05:01 Go to previous message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
Try tracing the database session and see if you can see the select it tries to run that way.
Previous Topic: Sending report as attachment from forms
Next Topic: FRM-92101
Goto Forum:
  


Current Time: Wed May 27 18:39:14 CDT 2020