push button associated with record [message #586089] |
Mon, 03 June 2013 06:55 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
NewToOracle10g
Messages: 34 Registered: April 2009 Location: Adelaide
|
Member |
|
|
I have a data block in which I am displaying 15 records at a time. The query for the block is complex with 3 tables and multiple joins. There is no primary key associated with each record, but I'm storing rowid in a hidden field. I have a push button in each row/ record. When user double clicks on it, I want to get the rowid in the record and pass it to pl/sql.
Also there is one column in table which is stored as char (ex, Y/N) but when I display in the table it should be Yes/ No. How to achieve this?
|
|
|
|
Re: push button associated with record [message #586130 is a reply to message #586091] |
Mon, 03 June 2013 18:29 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
NewToOracle10g
Messages: 34 Registered: April 2009 Location: Adelaide
|
Member |
|
|
Initially I was working in .net. And in gridview when we press button we can access entire record as selectedrow. So in oracle forms I'm not getting if button is pressed how does it know which record to access because button is non database item.
yes/ no I am not inserting in table but just displaying. but if i write decode in select statement, it is giving some error. So wanted to know which trigger should be used if i want to modiffy values before displaying.
|
|
|
Re: push button associated with record [message #586149 is a reply to message #586130] |
Tue, 04 June 2013 02:12 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Quote: if button is pressed how does it know which record to access
As you have a button in every record, :SYSTEM.TRIGGER_RECORD system variable will tell you which record you are in.
Quote:yes/ no (...) if i write decode in select statement, it is giving some error
You, of course, understand that it is quite difficult to debug code you can't see and fix "some errors".
As you display "Yes/No" for "Y/N", do that in a query that is block's source. DECODE is the right way to do that, such asselect decode(yn_column, 'Y', 'Yes', 'N', 'No') yn_item,
...
from ...
[Updated on: Tue, 04 June 2013 02:12] Report message to a moderator
|
|
|
Re: push button associated with record [message #586157 is a reply to message #586149] |
Tue, 04 June 2013 03:58 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Littlefoot wrote on Tue, 04 June 2013 08:12Quote: if button is pressed how does it know which record to access
As you have a button in every record, :SYSTEM.TRIGGER_RECORD system variable will tell you which record you are in.
Assuming the button is in the same datablock as the items in the grid you don't even need to do that. Just reference the datablock items directly, forms knows which record you're in.
Littlefoot wrote on Tue, 04 June 2013 08:12
Quote:yes/ no (...) if i write decode in select statement, it is giving some error
You, of course, understand that it is quite difficult to debug code you can't see and fix "some errors".
As you display "Yes/No" for "Y/N", do that in a query that is block's source. DECODE is the right way to do that, such asselect decode(yn_column, 'Y', 'Yes', 'N', 'No') yn_item,
...
from ...
If you do that you need to make the item that displays Yes/No a non database item. It's far simpler to make the item a list item that displays Yes/No but stores Y/N.
[Updated on: Tue, 04 June 2013 03:59] Report message to a moderator
|
|
|
|
|
|
|