?
Solved

create a table through pl/sql code block

Posted on 2007-12-02
5
Medium Priority
?
3,204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
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 set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

771 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