Home » Developer & Programmer » Forms » Forms 10g: How to set the Database Item property for an item dynamically ? (Oracle Forms 10g)
Forms 10g: How to set the Database Item property for an item dynamically ? [message #386598] Mon, 16 February 2009 03:48 Go to next message
sammydude
Messages: 34
Registered: November 2007
Member
Hello all,

I have a requirement where I need to set the database item property of an item to TRUE/FALSE
dynamically at runtime based on certain conditions.

Earlier, in forms 6i I've used,

Set_Item_Property (<item_name>, DATABASE_ITEM, PROPERTY_TRUE);

But in Forms 10g it doesn't recognize this Database_Item property and gives a compilation error.

Have I overlooked something or has this property become obsolete in Forms 10g ?
If obsoleted what is the replacement property ?

Regards,
Sam
Re: Forms 10g: How to set the Database Item property for an item dynamically ? [message #386640 is a reply to message #386598] Mon, 16 February 2009 06:03 Go to previous messageGo to next message
cookiemonster
Messages: 12403
Registered: September 2008
Location: Rainy Manchester
Senior Member
No you can't set this in 10g.
Personally I'm amazed you could set it in 6i since changing the value would screw up queries, inserts, updates etc.
Why do you want to change that property?
Re: Forms 10g: How to set the Database Item property for an item dynamically ? [message #386645 is a reply to message #386598] Mon, 16 February 2009 06:36 Go to previous messageGo to next message
sammydude
Messages: 34
Registered: November 2007
Member
Well, I thought I had done it earlier. So I installed Forms 6i to confirm and got the same error. Sorry about the wrong info. Razz

So, here's my problem.
I need to check whether a column exists in a particular table for a given schema. Only if the column exists I need to make it a database item and save the data which user enters. If the column doesn't exist then I can ignore/hide the item which is present on the canvas.

Should I have 2 different blocks and toggle hide/unhide based on column availability?

Regards,
Sam
Re: Forms 10g: How to set the Database Item property for an item dynamically ? [message #386646 is a reply to message #386598] Mon, 16 February 2009 06:56 Go to previous messageGo to next message
cookiemonster
Messages: 12403
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'd have the column in both schemas personally - I suspect that'd be far easier to manage than the alternatives, but it depends what you're doing with it.

Otherwise - 2 datablocks would be one possibility.
Another would be to base a block on a stored procedure - then you can control whether or not this column is selected/inserted etc programatically depending on the schema.
Re: Forms 10g: How to set the Database Item property for an item dynamically ? [message #387092 is a reply to message #386646] Tue, 17 February 2009 22:04 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I doubt that you could compile and generate a form where a column which is marked as being a database column does not exist in the database at compile time.

I suppose you could determine whether the column exists and display a non-database item to hold the data. You would populate it via a 'post-query' trigger and then use a manual 'update' statement in a 'post-record' trigger to keep the database up-to-date.

David
Previous Topic: form not running
Next Topic: Java bean to call the colorpicker and set text item color from that picker
Goto Forum:
  


Current Time: Sun Dec 04 00:29:24 CST 2016

Total time taken to generate the page: 0.07385 seconds