Home » SQL & PL/SQL » SQL & PL/SQL » My SQL script (transaction) desnt work
icon5.gif  My SQL script (transaction) desnt work [message #206368] Wed, 29 November 2006 14:49 Go to next message
Dodge
Messages: 10
Registered: November 2006
Location: Slovenia
Junior Member
Hi everyone...
I have a small problem...
I sort of made a sql script to create some tables...something like:

CREATE TABLE table1
(
column1 [datatype],
column2 [datatype]
)

CREATE TABLE table2
(
column1 [datatype],
column2 [datatype]
)

etc.

and at the end i write: commit;

The problem is ... why it doesnt work (PS im running this script in Aqua Data Studio 4.7)(?)

Thnx for any info.

Cheers
Re: My SQL script (transaction) desnt work [message #206371 is a reply to message #206368] Wed, 29 November 2006 15:03 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
CREATE TABLE statements are DDL (Data Definition Language) and don't require a commit (it's implicit).
You Also don't have a semicolon at the and of the statement or a slash on the following line which executes the statement.
I don't know what Aqua Data Studio is or more precisely, don't use third party interface tools.
Re: My SQL script (transaction) desnt work [message #206434 is a reply to message #206371] Thu, 30 November 2006 00:52 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Also, as this is some sort of pseudo-code and I don't know if you really use it or not, square brackets around datatype should not be used.

Perhaps you should post actual CREATE TABLE statements; it would make it easier to give a proper answer. Saying that "it doesn't work" doesn't help much.
Re: My SQL script (transaction) desnt work [message #206569 is a reply to message #206368] Thu, 30 November 2006 10:08 Go to previous messageGo to next message
Dodge
Messages: 10
Registered: November 2006
Location: Slovenia
Junior Member
Thnx for all your help...i was wondering...can i please get like a siple sql script for creating table...just for creating and i dont know...well if there different ways to create script for DDL and DML(?)

Really thnx again for all your help!
Re: My SQL script (transaction) desnt work [message #206571 is a reply to message #206368] Thu, 30 November 2006 10:18 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
GOOGLE is your friend, but only if you take the time & effort to use it.
Re: My SQL script (transaction) desnt work [message #206582 is a reply to message #206571] Thu, 30 November 2006 11:01 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Most questions are answered in Oracle Documentation - you'll find it at http://tahiti.oracle.com or Oracle Technology Network. This document shows how to create a table, including syntax and examples at the bottom of the page.
Re: My SQL script (transaction) desnt work [message #206604 is a reply to message #206368] Thu, 30 November 2006 15:12 Go to previous message
Dodge
Messages: 10
Registered: November 2006
Location: Slovenia
Junior Member
Well basically putting slash in new line did the trick so thnx for the tip...
Cos i tried to use semicolon but the editor didnt allow me that...slash did the trick...thnx.
Previous Topic: Create sequence and trigger with nocache
Next Topic: USING DYNAMIC SQL within PL/SQL
Goto Forum:
  


Current Time: Fri Dec 02 14:14:35 CST 2016

Total time taken to generate the page: 0.11510 seconds