Solved

Module data diagrammer

Posted on 1997-12-09
3
1,080 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
ID: 1081111
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
ID: 1081112
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
ID: 1081113
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

895 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

13 Experts available now in Live!

Get 1:1 Help Now