Home » Developer & Programmer » Forms » Odd problem (Block based on View)
Odd problem (Block based on View) [message #130043] Wed, 27 July 2005 19:06 Go to next message
Tafer
Messages: 64
Registered: July 2005
Location: Here!
Member
Introduction:
Forms 6i Patch #13, Windows XP SP2

"Complex" view with "instead of" trigger. (View_X):
- 2 tables.
- Outer Join. (With one table)
- Function (In the Where, pretty complex)

Another not so complex view with "instead of" Trigger. (View_Banana):
- 1 Table.
- Function (In the Select, could be substituted with a join)

2 Blocks, one based in View_X (Block_X) and the other based on View_Banana (Block_Banana).

What I'm doing:
Block/layout Wizard to create the blocks, nothing else.

Problem:
Block_Banana: allows inserts, updates, deletes without problem.
Block_X: FRM-40602 Cannot insert into or update data in a view

Now, View_X - Outer Join = No problem.
But, View_X + Outer Join = 2 delightful days of endless pain. (Of course, the Outer Join is necessary)

Any help?





[Updated on: Wed, 27 July 2005 19:08]

Report message to a moderator

Re: Odd problem (Block based on View) [message #130050 is a reply to message #130043] Wed, 27 July 2005 21:21 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Search this forum for 'user_updatable_columns'. There are three threads. See if they answer your questions.

Reread the SQL documentation on Views and updatable columns. I have a hunch that outer joins may inhibit updating through views.

Can you get the data from the 'outer join' table in a post-query trigger instead?

David
Re: Odd problem (Block based on View) [message #130174 is a reply to message #130050] Thu, 28 July 2005 09:48 Go to previous messageGo to next message
Tafer
Messages: 64
Registered: July 2005
Location: Here!
Member
Sorry, I didn't mention this before, but I can update the view without problem through normal SQL. (Store Procedures/Function/Packages, etc...)

And when I search the USER_UPDATABLE_COLUMNS for the respective view, every single column is in condition to be inserted/modified/deleted.

I'll try the search function, but any help will be greatly appreciated.

Edit:
I checked the previous threads about updatable views, and I couldn't find anything useful.

I can't use the post-query triggers, because in this specific form, time is extremely important.

Now, I found a workaround to this problem, but I don't want to use it. (Because it add extra coding to the form that is already on the Instead of trigger)

The idea is to create the on_lock/on_update/on_delete triggers (Insert is not Necessary).

[Updated on: Thu, 28 July 2005 10:14]

Report message to a moderator

Re: Odd problem (Block based on View) [message #130222 is a reply to message #130174] Thu, 28 July 2005 19:17 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Verify that the item definitions in block_x and block_banana have insert and update turned on.

If you have the same column names in both views then you could try just changing the data source for the block instead of having two blocks. In that way when testing the form's update capability you know that you have the same item definitions.

David
Re: Odd problem (Block based on View) [message #130226 is a reply to message #130222] Thu, 28 July 2005 19:26 Go to previous messageGo to next message
Tafer
Messages: 64
Registered: July 2005
Location: Here!
Member
djmartin wrote on Thu, 28 July 2005 19:17

Verify that the item definitions in block_x and block_banana have insert and update turned on.

If you have the same column names in both views then you could try just changing the data source for the block instead of having two blocks. In that way when testing the form's update capability you know that you have the same item definitions.

David



View_X and View_Banana are completely different. (And so are the blocks)

I was using View_Banana for testing updatable views. But view_x is the important.
Re: Odd problem (Block based on View) [message #130229 is a reply to message #130226] Thu, 28 July 2005 19:37 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Okay ... then verify that you have the items 'turned on' to insert and update. If you had used the block creation wizard they may have been defined 'off'.

David
Re: Odd problem (Block based on View) [message #130361 is a reply to message #130043] Fri, 29 July 2005 09:31 Go to previous messageGo to next message
Tafer
Messages: 64
Registered: July 2005
Location: Here!
Member
Insert and update are allowed.

Hey!, Thanks anyway... I had to implement the ON_LOCK/ON_UPDATE/ON_DELETE form triggers to do what I wanted.

Sad stuff:

ON_UPDATE:

begin
update view_x
set ...;
end;
Re: Odd problem (Block based on View) [message #130520 is a reply to message #130361] Sun, 31 July 2005 19:36 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Thanks for the feedback.

David
Previous Topic: Missing MENUDEF.MMB
Next Topic: starting forms server
Goto Forum:
  


Current Time: Thu Sep 19 12:05:17 CDT 2024