Re: Designer/2000, generated forms & PL/SQL?

From: John King <jbking_at_erols.com>
Date: 1997/12/01
Message-ID: <65vq5r$erh$1_at_winter.news.erols.com>#1/1


Hi Phil:

There are a couple of things that you can do. One is use a template. A template attaches to each form that you generate from des2k, so any pl/sql program units (or anything else) that you define in the template is included.
You specify the template to attach in the preferences.

Another way is to use libraries. Libraries are stored separately from the form in a .pll file and can be attached to the form via the MODLIB preference. Also, the code in a library can be modified without having to recompile the forms that reference it. Each program unit that you define in the library referenced by the MODLIB preference will be included in the des2k generated form.

A trick I use for triggers is to define "trigger hooks" for each WHEN, POST and PRE trigger in my template. The "trigger hook" consists of a call to a procedure, which I define in a standard library. I place any code that I will ALWAYS want to execute for that trigger in the corresponding procedure for that trigger in my standard library. If I do not want any code to be executed, I use NULL in the corresponding procedure. Then, if I want to add or override any code for any trigger, all I have to do is create a program unit in another library with the name of the trigger's "trigger hook" procedure and attach that library to the form module in des2k using the MODLIB preference. The code attached using the MODLIB preference will replace the code defined in the standard library (if it has the same program unit name, otherwise it is added).

The code is always attached at the form level, so if you're trying to validate a specific item in a specific block...you have to trap that occurrence by testing the value of the :system.trigger_item global variable. There is no way to attach the code at the block or item level, that I'm aware of without post-generation changes.

This method is not without its problems, though. If des2k generates a trigger of the same type at a lower level, then your trigger at the form level will not fire...so you have to be careful. There is a preference that allows you to specify that a trigger should fire (before, after, override) the same trigger at a higher level. However, I have not been successful in getting this to work in any other mode than override through des2k.

Good Luck.

John King
programmer/analyst
National Card Control, Inc.
jbking_at_erols.com

Phil Perucci wrote in message <34832ebc.2013104_at_news.mindspring.com>...
>Hi,
>
>It seems like Oracle does not provide a way to add PL/SQL code
>to Designer/2000 generated forms in any useful way. Am I missing
>something?
>
>In Designer/2000, it is easy enough to produce Forms45 forms
>or *server*-side PL/SQL, but there does not seem to be any
>way to link PL/SQL "modules" to Forms45 "module" triggers.
>What am I missing?
>
>In one of my Designer/2000 books, I see a "trick" which
>involves calling a button definition in a template from an
>item defined as a button, but must one resort to such "tricks"?
>
>
Received on Mon Dec 01 1997 - 00:00:00 CET

Original text of this message