Home » Developer & Programmer » Forms » Data Block items- duplicates for one column?
Data Block items- duplicates for one column? [message #171537] Wed, 10 May 2006 06:42 Go to next message
SaraC
Messages: 81
Registered: August 2005
Member
Hi

I have a data block that reads from a database table.

I want to have the data from one of the table columns in 2 of the items on screen (one is hidden) so that I can uhave historical data for comparing data when updates occur. Is this possible
or will I have to create a view on the table, selecting the column twice in the select list?

I have just used the same column in both at the moment but when it tries to do the update I get ORA-00957: duplicate column name
error on the UPDATE statement. Is there anything I can do to bypass this e.g a property or something...

Thanks

[Updated on: Wed, 10 May 2006 07:06]

Report message to a moderator

Re: Data Block items- duplicates for one column? [message #171560 is a reply to message #171537] Wed, 10 May 2006 07:10 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Create a non-database item in your block and in the Post-Query trigger populate the non-database item from the database item, for example
begin
  :blk.itm_ndb := :blk.itm;
end;

David
Re: Data Block items- duplicates for one column? [message #171566 is a reply to message #171537] Wed, 10 May 2006 07:16 Go to previous messageGo to next message
SaraC
Messages: 81
Registered: August 2005
Member
Have tried something and think it works - well get other errors but seems to miss this error.

Have made the hidden row a non- database item. Then a post_query trigger copies the database item into the non database item :TAG_XREF.ORIG_START := :TAG_XREF.START_DATE;

Assuming that this will copy for all rows that my query retrieves - is that correct?
Re: Data Block items- duplicates for one column? [message #171578 is a reply to message #171566] Wed, 10 May 2006 08:05 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Be careful with the nomenclature that you use. Its an 'item', or perhaps a 'column', it is not a 'row'.

Yes, it will do each row as it is retrieved. To test it, display the non-database ITEM on your canvas.

David
Re: Data Block items- duplicates for one column? [message #171594 is a reply to message #171537] Wed, 10 May 2006 08:51 Go to previous message
SaraC
Messages: 81
Registered: August 2005
Member
Thanks didnt see your solution until after I tried it.

I used "row" because I have a number of items on the page representing a "row" from the table

Thanks for your help
Previous Topic: HRMS API not allowed in Forms 6i?
Next Topic: Enable Win_API in forms 6i
Goto Forum:
  


Current Time: Fri Sep 20 06:44:15 CDT 2024