Solved

Module data diagrammer

Posted on 1997-12-09
3
1,089 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

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.

Question has a verified solution.

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

Suggested Solutions

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to recover a database from a user managed backup

777 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