Solved

How to create table and test in oracle while installation

Posted on 2004-09-03
3
181 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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

713 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