Solved

create a table through pl/sql code block

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
use lov values 2 72
Oracle - Query link database loop 8 54
oracle collections 2 29
PL/SQl Expanding the WHERE statement in query 3 34
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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 shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

733 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