Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to create table and test in oracle while installation

Posted on 2004-09-03
3
Medium Priority
?
187 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 440 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Six Sigma Control Plans
Screencast - Getting to Know the Pipeline

971 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