Monday, April 20, 2009

PL/SQL Integration

Question
--------
How is SQL within PL/SQL dealt with by Forms ?
Answer
------
Since PL/SQL blocks in a form can have Forms builtins, we
cannot send the whole block to the database.
Forms processes the cursors which PL/SQL tell it are
required for DML operations within PL/SQL within Forms.
That means SQL within PL/SQL takes advantage of the
techniques to reduced network traffic implemented in 4.5.
These changes dramatically reduce the level of traffic seen
using SQL*Forms 3.0.
To send entire blocks of PL/SQL to the DB, you can:
(1) Use Forms_DDL() built-in to send a lengthly
string which makes up a block of code you want
to be executed on the server:
Forms_DDL('begin ... end;');
(2) Call Stored procedures/functions/packages which
have the bundled DML inside them and call these
stored program units from forms.
Question
--------
How are the constants like INSERT_ALLOWED and PROPERTY_ON
dealt with by PL/SQL ?
Answer
------
All of these tokens that you pass to builtins are numeric
constants. If you write a generic procedure that sets the
properties of objects you need to make sure that the
parameters passed are typed as NUMBER to ensure that no
datatyping conflicts occur.

No comments: