Solved

Module data diagrammer

Posted on 1997-12-09
3
1,075 Views
Last Modified: 2008-02-01
Hi,
I am using Designer 1.2. with my Oracle 7.2 database.
In a multiple form application, I have a transaction form
which allows the user to only query a base table and update
a particular field.

When that form is run, it goes directly to normal mode, and not to
'Query' Mode, as required by the business.
So I added a ENTER_QUERY statement in the When_new_form_instance.

When that form is invoked after any other transaction,(presumably
after initializing global variable cg$do_auto_query) it works properly.
But when it is called straight from the main form, straight after
starting the application, and queried, it gives a message
'variable global.cg$do_auto_query does not exist'.

How can I tell my Module Data diagrammer to generate my form to start in
Query mode?
Can somebody help me?.Any help would be greatly appreciated.
Lakshmanan.
0
Comment
Question by:lakshmanan_k
  • 2
3 Comments
 

Accepted Solution

by:
tejay earned 20 total points
Comment Utility
Hi Lakshmanan!

I had th same problem. The problem is that the Forms Generator will add code AFTER your code. But the generated code is needed to initialize the Form. Your only chance is to add
your code after the generation or - like me - set only a flag
in the WNFI-Trigger and write your code in the WWA-Trigger
(When-Window-Activated) dependent on the flag like this:

BEGIN
  if var.my_flag then
    do_key('enter_query');
    var.my_flag := FALSE;
  end if;
END;

HTH, TeJay  
0
 

Author Comment

by:lakshmanan_k
Comment Utility
Hi TeJay,
Your solution is to start the form in Enter_qury mode or in Normal mode.
The poblem is that the form searches for a Global variable mentioned in the question which originats the error message.


0
 

Expert Comment

by:tejay
Comment Utility
Maybe, I need to be more accurate with my postings!

If you add this code as the WNFI-Trigger (When-New-Form-Instance)
of your template:

a)
Do_Key('Enter_Query');

or
b) (not recommended)
Enter_Query;

the genereted code will be added after your code

[Start of WNFI-Trigger in generated Form]
Do_Key('Enter_Query'); -- Version a)
-- Enter_Query;        -- Version b)
/* CGGN$CALL_GENERATOR_CODE */
/* Execute the WHEN-NEW-FORM-INSTANCE code that was created by Forms */
/*   Generator                                                       */
BEGIN
  CGBS2$.SET_COORD_STYLE( 'P' );
  CGBS2$.SET_QRY_ON_ENTRY( 'Y' );
  BEGIN
    CG$WHEN_NEW_FORM_INSTANCE;
  EXCEPTION
    WHEN OTHERS THEN
      CGTE$OTHER_EXCEPTIONS;
  END;
END;
[End of WNFI-Trigger in generated Form]

This trigger calls CG$WHEN_NEW_FROM_INSTANCE

[Start of CG$WHEN_NEW_FROM_INSTANCE]
/* CG$WHEN_NEW_FORM_INSTANCE */
PROCEDURE CG$WHEN_NEW_FORM_INSTANCE IS
BEGIN
/* CGLY$INIT_CANVASES */
/* Call procedure to ensure correct canvases are visible */
BEGIN
  CGLY$CANVAS_MANAGEMENT;
END;

/* CGBS$STARTUP */
/* Perform start-up processing for Block Synchronisation */
BEGIN
  /* Set the defaults for the globals */
  default_value('A', 'GLOBAL.CG$QUERY_MODE');
  /* Set the relations to the default query mode */
  CGBS$.SET_RELATIONS( :GLOBAL.CG$QUERY_MODE );
  /* Set the query mode items */
  CGBS$SET_QUERY_MODE( :GLOBAL.CG$QUERY_MODE );
END;
END;
[End of CG$WHEN_NEW_FROM_INSTANCE]

As you see, the default_value of :global.cg$query_mode is set here

Depending on your Form this global variable will be needed in of the Triggercodes

KEY-ENTQRY        (Do_Key('Enter_Query'))
ON-POPULATE-QUERY (Enter_Query und Master-Detail-Form)

So, my solution was to add the following code

in the WNFI-Trigger:
:global.my_val := 'TRUE'

in the WWA-Trigger:
if :global.my_val = 'TRUE' then
  Do_Key('Enter_Query');
  :global.my_val := 'FALSE';
end if;

or

in the WNFI-Trigger:
default_value('A', 'GLOBAL.CG$QUERY_MODE');
Do_Key('Enter_Query');

Maybe, you can also use the WNBI-Trigger.
I didn't check that.
HTH, TeJay




0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now