473,224 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Running DDL scripts

1
Hi,

I have more than 60 tables to be created in access. I have the "create table" scripts generated out of oracle.

Please let me know how to run these scripts and if they require any modifications to be done.

Thanks
BMG
Aug 23 '07 #1

✓ answered by JKing

I've never used Oracle before so I cannot say this with certainty but I believe the answer is yes it is possible. Though the syntax maybe slightly different and the scripts may require a little tweaking. Running DDL create table statements are done through the query editor. Create a new database. Create new query and close the select table popup. Switch the view to SQL and this is where you can add your create table statement.

Here's the syntax:
Expand|Select|Wrap|Line Numbers
  1. CREATE [TEMPORARY] TABLE table (field1 type [(size)] [NOT NULL] [WITH COMPRESSION | WITH COMP] [index1] [, field2 type [(size)] [NOT NULL] [index2] [, ...]] [, CONSTRAINT multifieldindex [, ...]])
  2.  
The CREATE TABLE statement has these parts:

Part Description
table The name of the table to be created.
field1, field2 The name of field or fields to be created in the new table. You must create at least one field.
type The data type of field in the new table.
size The field size in characters (Text and Binary fields only).
index1, index2 A CONSTRAINT clause defining a single-field index.
multifieldindex A CONSTRAINT clause defining a multiple-field index.

3 7252
JKing
1,206 Expert 1GB
I've never used Oracle before so I cannot say this with certainty but I believe the answer is yes it is possible. Though the syntax maybe slightly different and the scripts may require a little tweaking. Running DDL create table statements are done through the query editor. Create a new database. Create new query and close the select table popup. Switch the view to SQL and this is where you can add your create table statement.

Here's the syntax:
Expand|Select|Wrap|Line Numbers
  1. CREATE [TEMPORARY] TABLE table (field1 type [(size)] [NOT NULL] [WITH COMPRESSION | WITH COMP] [index1] [, field2 type [(size)] [NOT NULL] [index2] [, ...]] [, CONSTRAINT multifieldindex [, ...]])
  2.  
The CREATE TABLE statement has these parts:

Part Description
table The name of the table to be created.
field1, field2 The name of field or fields to be created in the new table. You must create at least one field.
type The data type of field in the new table.
size The field size in characters (Text and Binary fields only).
index1, index2 A CONSTRAINT clause defining a single-field index.
multifieldindex A CONSTRAINT clause defining a multiple-field index.
Aug 23 '07 #2
davem22101
1 Bit
Expand|Select|Wrap|Line Numbers
  1. Sub ImportDDL()
  2.  
  3.     Dim File    As Integer
  4.     Dim Data    As String
  5.     Dim Records As Long
  6.     Dim SQLstring    As String
  7.  
  8.     File = FreeFile()
  9.     Open "C:\temp\DDL_MSAccess_2021-05-10.sql" For Input As #File
  10.  
  11.     SQLstring = ""
  12.     While Not EOF(File)
  13.         Line Input #File, Data
  14.         SQLstring = SQLstring & Data
  15.         If InStr(Data, ";") > 0 Then
  16.             Debug.Print (SQLstring)
  17.             DoCmd.RunSQL (SQLstring)
  18.             SQLstring = ""
  19.             Records = Records + 1
  20.         End If
  21.     Wend
  22.     Close #File
  23.  
  24.     Debug.Print (Records)
  25.  
  26. End Sub
May 10 '21 #3
NeoPa
32,554 Expert Mod 16PB
That's clean & tidy code Dave, but I'm not sure it deals with the fundamental issue of the scripts being in an Oracle format rather than Access. There are many points of difference between the two.
May 18 '21 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Rolfe | last post by:
Hi, I struggled, and got mod_python running on Apache/Win2k. Follow these instructions verbatim and you shouldn't have any trouble. These instructions are based on...
4
by: Peter Otten | last post by:
Is there a way to limit both width and height of a canvas text item? My current workaround seems clumsy: import Tkinter as tk root = tk.Tk() canvas = tk.Canvas(root, width=400, height=200,...
1
by: Patrick | last post by:
Hi, The company's database has multiple schema. If I want to modify a stored procedure, which is saved as a script (something like abc.sql), I opened that script in Query Analyser, made the...
3
by: Sravani | last post by:
Hi, I am setting up a new server for an already running website. The problem is the person before me ran ASP scripts on .html extension pages (The old machine is a windows 2000 server with IIS...
4
by: Nick Sinclair | last post by:
Hi all, I'm new to C. I have successfully written a small C program that acts as a "wrapper" around cgi scripts. These scripts perform admin tasks such as backing up etc. Obviously, The need...
1
by: edovale | last post by:
Hi there, I am trying to create a db on db2 and when running the scripts, which have been successfully ran before, I get the following error: DB21034E The command was processed as an SQL...
2
by: Dave Hughes | last post by:
Just noticed something rather annoying after upgrading my test box (a Linux server running DB2 UDB v8 for LUW) to fixpak 11 (for reference it was previously on fixpak 7). In the past I've relied...
6
by: Ishpeck | last post by:
I'm using Python to automate testing software for my company. I wanted the computers in my testing lab to automatically fetch the latest version of the python scripts from a CVS repository and...
24
by: Mark | last post by:
Hi, I'm new to python and looking for a better idiom to use for the manner I have been organising my python scripts. I've googled all over the place about this but found absolutely nothing. I'm...
22
by: V S Rawat | last post by:
(bringing the discussion here for php.general) I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b. http://localhost/ is E:\wamp\www\ I have put the first php script...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.