Click to See Complete Forum and Search --> : Forms_DDL compile package...


horstb
07-18-2002, 09:57 AM
Hi all,
I'm using Forms 4.5, Oracle7 Server Release 7.3.3.0.0.
I have a Forms application that is supposed to switch
a package in the database from an old version to a new Version and back(if necessary).
There are two files say in directory C:\temp named like
"newVers.sql" and "oldVers.sql"
containing the proper code to create or replace the packages.
I created a Canvas with two buttons each with something like the following code in the WHEN-BUTTON-PRESSED trigger:
FORMS_DDL('@c:\temp\newVers.sql');
If I issue the command directly in SQL+, everything works fine so the content of the .sql files is not the problem.
If I press the button in the Forms application I get the error ORA-00900, invalid SQL statement.
Can anybody tell me where I'm going wrong?

thanks in advance
horst borscht

stecal
07-18-2002, 08:03 PM
Try it this way - where you assign a string name to your path

DECLARE
procname VARCHAR2(30);
BEGIN
IF :global.flag = 'TRUE' THEN
procname := 'c:\path\file_name';
ELSE
procname := 'c:\path\other_file_name';
END IF;

Forms_DDL('run '|| procname );

IF NOT Form_Success THEN
Message('procname failied);
ELSE
Message('procname successful');
END IF;

END;


Any valid PL/SQL block may be executed, and *should* include semicolons where appropriate. PL/SQL statements, including calls to stored procedures, must be enclosed in a valid BEGIN/END block structure. There is no need to end the PL/SQL block with a slash '/' character. While perhaps improving readability of code, there is no need to pay attention to line breaks in the string which you pass as a command to Forms_DDL().