Link to home
Start Free TrialLog in
Avatar of shruti27
shruti27

asked on

create a table through pl/sql code block

i am using oracle forms, and i want to create a table and then drop it inside the pl/sql code in a 'when-button-pressed' trigger. but when i am writing the syntax, it gives a compilation error :

'encountered the symbol create when expecting the following
begin case declare exit for goto if loop mod null pragma.......'

Is there any way i can create and drop a table from inside the trigger code?
Avatar of sonicefu
sonicefu
Flag of Pakistan image

use the following to create and drop table in forms
forms_ddl(' create table ......');
Avatar of shruti27
shruti27

ASKER

oh great...this is def working :-)

just one more thing...how do i create a temporary session table through sql code.
using 'create table...' syntax it makes a normal table, while i need a temporary table for the application.

also is the syntax for dropping table also forms_ddl('drop table...'); ?
ASKER CERTIFIED SOLUTION
Avatar of sonicefu
sonicefu
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks a lot sonicefu.
forms_ddl('CREATE GLOBAL TEMPORARY TABLE temp_emp_table as select *from emp ON COMMIT PRESERVE ROWS');