Solved

create a table through pl/sql code block

Posted on 2007-12-02
5
3,174 Views
Last Modified: 2013-12-12
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?
0
Comment
Question by:shruti27
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:sonicefu
ID: 20393752
use the following to create and drop table in forms
forms_ddl(' create table ......');
0
 

Author Comment

by:shruti27
ID: 20393769
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...'); ?
0
 
LVL 13

Accepted Solution

by:
sonicefu earned 500 total points
ID: 20393784
* You can perform almost all DDL operations through forms_ddl.

*Yes,  You can create temporary table using this,
create global temporary table tableName (column1 (number), ......) on commit preserve rows;
 
* Yes you can drop table using forms_ddl('drop table tableName');
0
 

Author Comment

by:shruti27
ID: 20393789
thanks a lot sonicefu.
0
 
LVL 13

Expert Comment

by:sonicefu
ID: 20393790
forms_ddl('CREATE GLOBAL TEMPORARY TABLE temp_emp_table as select *from emp ON COMMIT PRESERVE ROWS');
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now