Solved

How to create table and test in oracle while installation

Posted on 2004-09-03
3
180 Views
Last Modified: 2011-09-20
i have created one project in vb6 with oracle 8i 1.1.7 as backend. i want to create my database tables while i am installing my software. Can i do it with Software Package and Deployment or i have to follow any procedure. i also want to create the DSN while installation. can i check that my dsn is created or not also can i check that my tables are created or not. Can any body plz help me.
0
Comment
Question by:bnsrinivas
3 Comments
 
LVL 21

Accepted Solution

by:
MogalManic earned 110 total points
ID: 11971201
You should be able to execute the CREATE TABLE commands just like you would execute an INSERT or UPDATE statement.  I don't think you can create the actual database, so you will have to be supplied the username/password and TNS name.  Are you using ODBC?  If so, you can use the file DSN mode and create the ODBC connection (I'm not sure how that works though).

As for checking to see if the tables are already created, you can query the ALL_TABLES and/or USER_TABLES views (ALL_TABLES requires special access for your Oracle user account).  Just issue the following query:
  SELECT owner, table_name FROM user_tables WHERE table_name in (...Required table list...)
and parse the results.

You could also check for existince and access on a table by table way.  This solution would be more portable because it would work for any database:
   SELECT * FROM tablename WHERE 1=0
This statement would throw an oracle error if the table did not exist and/or the user account did not have SELECT access to the table.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

856 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