I did find some command line tools for mySQL

You can use mysqlshow to return a list of the DBs on the server and mysqladmin to create a DB.  Once that is done. It is simple SQL to create or modify the table.

After more research, I realised that I can assume that the DB is actually there.  I'm creating a DB called FormResponses which will be there when the application is deployed.  Therefore, I can get away with simple SQL to take care of the rest.  This will probably handle a lot more RDBMS since I assume SQL is SQL (although probably not :-)

Cheers and thanks,
Michel

Marc Campeau wrote:

It's must be possible depending on what RDBMS you use. In SQLServer there
are Sytems tables which you can look into for database schema issues (Tables
exists or not, columns, etc.)

Now for the creation of the database, you'd have to have a connection to the
Master Database (basically the system database holding the information for
the client database.) You could probably do an insert in the System table
where the "user" databases are defined and that would probably create a new
database.

Then with CFs undocumented tags and fucnction you could setup the connection
to that new database, then load the Tables and data.

I have already accomplished the creation of DSNs, tables and columns with CF
and SQL server, so I'm sure that part can be done. The other one, creating a
database, might be a bit tricky, I suggest you look in the documentation of
your RDBMS under System Tables.

Good luck and keep us posted, seems pretty interesting.

Marc Campeau

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Michel Rouse
> Sent: Thursday, March 21, 2002 12:21 PM
> To: Toronto CFUG
> Subject: [CFTALKTor] Databases
>
>
> I'm not sure if this is even possible (although I imagine it is)
>
> I would like to be able to check if a database exists, if not, create
> it.  Then, check if a table exists in that database, if not, create it.
> Then check if a column exists in that table, if yes, insert data into
> it, if not, create it then insert data into it.
>
> Any help would be much appreciated.
>
> Michel
>
> --
> "Put your hand on a hot stove for a minute, and it seems like
> an hour. Sit with a pretty girl for an hour, and it seems like
> a minute. That's relativity."
>
> -- Einstein, Albert
> _______________________
>
> Michel Anthony Rouse
> Webmaster
> Steltor
>
> 2000 Peel street, 4th floor
> Montreal, Quebec
> H3A 2W5
> Canada
>
> tel: +1 (514) 733-8500 x-5001
> fax: +1 (514) 733-8878
> [EMAIL PROTECTED]
> www.steltor.com
>
> Toll free in North America: 1-800-675-2991
>
>
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: Michel Rouse <[EMAIL PROTECTED]>
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED])
> http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
>
>

-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Marc Campeau" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

--
"Put your hand on a hot stove for a minute, and it seems like
an hour. Sit with a pretty girl for an hour, and it seems like
a minute. That's relativity."

-- Einstein, Albert
_______________________

Michel Anthony Rouse
Webmaster
Steltor

2000 Peel street, 4th floor
Montreal, Quebec
H3A 2W5
Canada

tel: +1 (514) 733-8500 x-5001
fax: +1 (514) 733-8878
[EMAIL PROTECTED]
www.steltor.com

Toll free in North America: 1-800-675-2991
 

Reply via email to