Email Us : sunilkumark11@gmail.com
Free Training > SQL PL / SQL Forms Reports Oracle Applications
< Previous Next >

 
Forms - Creating tables through forms

Built-in forms_ddl  is used to execute DDL commands using forms.
Use FORM_SUCCESS boolean function to check whether the DDL command is executed correctly or not.

Syntax
forms_ddl ( 'DDL command');

Example
Open the form builder tool Create new data block manually.
In the property palette
Name BLK1
Database
Database Data Block No

Create canvas, In the property palette 
Name CNV1

Go the layout editor of the canvas (F2)
Place a button on the canvas. In the property palette of the button
General
Name B1
Functional
Label CLICK HERE

Create trigger WHEN-BUTTON-PRESSED for the button and provide the following code and compile

begin
                forms_ddl ( 'create table temp( c1  number(3), 
                                                                                c2  varchar2(10),
                                                                                c3  date)');
                                                                                                                                                                                                               
if FORM_SUCCESS then
message (' Table created');
else
message ('Table creation  failed');
end if;
end;

Save the form with the name EXEC_DDL.fmb
Compile the form
Run the form

Click on CLICK HERE button, you will get the message "Table created".

Also check in the Oracle database ( In SQL*Plus environment).
Table will be available.

 

 


< Previous Next >