?
Solved

Module data diagrammer

Posted on 1997-12-09
3
Medium Priority
?
1,124 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Accepted Solution

by:
tejay earned 40 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

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