Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 9th, 2004, 07:24 PM
hudo hudo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 97 hudo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 23 m 19 sec
Reputation Power: 5
access name and value of double-clicked item

Hello,

I'd like to switch to a determined canvas-tab if I double-click on a specified item in a form. For example, my primary form displays the table scott.emp .By Double-clicking on a SAL-Item it should switch to the second/another tab where all records from scott.emp are displayed, which fulfill a where-condition which is written in the Block WHEN-MOUSE-DOUBLECLICK Trigger (lets say all entries with sal >= clicked sal-value).

By Double-clicking on a DEPTNO-Item it should switch to the second/another tab where all records from scott.emp are displayed, which fulfill a where-condition which is written in the Block WHEN-MOUSE-DOUBLECLICK Trigger (lets say all entries with deptno >= clicked deptno-value).... etc..

This is the code of the trigger:
---------------------------------------------------------

DECLARE
the_button_pressed VARCHAR2(1);
--my_current_value_dept VARCHAR(2);
--my_current_value_emp VARCHAR(10);

cur_blk VARCHAR2(40) := :SYSTEM.CURSOR_BLOCK;
cur_rec NUMBER;
--top_rec NUMBER;
bk_id BLOCK;


L_STR VARCHAR2(2000) :=' WHERE 1=1 ';

my_current_item VARCHAR2(100);
my_current_value VARCHAR2(100);

BEGIN

bk_id := FIND_BLOCK( cur_blk);
cur_rec := GET_BLOCK_PROPERTY( bk_id ,CURRENT_RECORD);
--my_current_value := cur_rec;

--my_current_value := :SYSTEM.CURRENT_VALUE;
--my_current_value_dept := :EMP.DEPTNO;
--my_current_value_emp := :EMP.SAL;


my_current_item := :SYSTEM.CURSOR_ITEM;
my_current_value := :SYSTEM.CURSOR_VALUE;
message('System_item'||:SYSTEM.CURSOR_ITEM||' '||my_current_item);
message('System_value'||:SYSTEM.CURSOR_VALUE||' '||my_current_value);

the_button_pressed := :SYSTEM.MOUSE_BUTTON_PRESSED;

-- L_STR := L_STR ||' AND '||my_current_item ||' = '||my_current_value;

L_STR := L_STR ||' AND '||my_current_item ||' LIKE ''%'||my_current_value ||'%''';


GO_BLOCK('EMP2');
CLEAR_BLOCK(NO_VALIDATE);

SET_BLOCK_PROPERTY('DEPT1', DEFAULT_WHERE, L_STR);
EXECUTE_QUERY;


END;

The message-lines display always the correct values for my_current_item and
my_current_value but then follows the error FRM-40505.

Another problem: I use the "complicated statement" with LIKE as a workaround because in some other forms occured some errors with the "simple statement" (with some values it did not work, I prooved also, if there are some "spaces" in the "not working values", but that was alright)

How can I access the name and the value of the double-clicked item to use it afterwards in the default-where clause ??

What may be the reason that "some values are not working" (so I used the LIKE statement as a workaround) ??

Thanks in advance

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > access name and value of double-clicked item


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway