Solved

create a table through pl/sql code block

Posted on 2007-12-02
5
3,179 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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.

911 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

18 Experts available now in Live!

Get 1:1 Help Now