Home » Developer & Programmer » Forms » Error while appending data to a data block (Oracle 6i)
Error while appending data to a data block [message #617334] Fri, 27 June 2014 09:13 Go to next message
nilanjanpal
Messages: 8
Registered: May 2014
Location: Kolkata
Junior Member
I have data block, which fetches data directly from a view in the database. After it fetches the data, my code manually adds few records to that dataset which is already fetched from the view into the data block. I am able to do that successfully.

I have a double-click trigger attached to the block. So when I double click the trigger fires and function properly. But before thr trigger fires I am getting a pop up message that "Do you want to save the changes you have made ?
". There are three options in the pop up "Yes, No, Cancel". If I press cancel, it satys in the current window, but if I press Yes/No(doesn't matter), ther trigger attached to the item functions properly and goes to the next window.

Anyone has any idea why the error is coming ? Is it due to the data I am manually adding to the data block. Please help if anyone faced this before.

Thanks!
Re: Error while appending data to a data block [message #617335 is a reply to message #617334] Fri, 27 June 2014 09:26 Go to previous messageGo to next message
cookiemonster
Messages: 13921
Registered: September 2008
Location: Rainy Manchester
Senior Member
nilanjanpal wrote on Fri, 27 June 2014 15:13

Anyone has any idea why the error is coming ? Is it due to the data I am manually adding to the data block.

Yes.
As far as forms is concerned any data that isn't got via execute_query is new/changed data and the DB needs to updated to reflect the changes.


nilanjanpal wrote on Fri, 27 June 2014 15:13
I have data block, which fetches data directly from a view in the database. After it fetches the data, my code manually adds few records to that dataset which is already fetched from the view into the data block. I am able to do that successfully.

Why are you doing this? Why not modify the view to return all the data you need, or if the view is used elsewhere create a new one?
Re: Error while appending data to a data block [message #617381 is a reply to message #617334] Sat, 28 June 2014 00:34 Go to previous messageGo to next message
nilanjanpal
Messages: 8
Registered: May 2014
Location: Kolkata
Junior Member
I need to manually add because I need to populate the data from two different database. From one database the data block is pulling the data using the query mentioned in the property palette but for the data which is available in the other database I have manually fetch and add it to the block by moving through a loop.

Please let me know your suggestion if I can achieve that in a different way. Also please note I cannot commit the data so is there a way by which I can resolve it ?
Re: Error while appending data to a data block [message #617385 is a reply to message #617381] Sat, 28 June 2014 06:17 Go to previous message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create another view, such as
create view my_view as
select <column_list>
  from <some_tables>
  where <conditions_here>
UNION ALL
select <column_list>
  from <some_tables@over_database_link>
  where <conditions_here>

Then base data block on MY_VIEW.

On the other hand, what do you plan to do with these records, once you retrieve them into the form? Will you just view (i.e. SELECT) them, or do you plan to update them, delete, possibly insert new records? Selects are trivial, but all the other actions will be rather complex (consider INSTEAD OF trigger).
Previous Topic: Call_Form issue
Next Topic: How to get 'Do you want to save changes you have made?'
Goto Forum:
  


Current Time: Wed May 01 02:39:53 CDT 2024