Rookie Programming the Perl DBI..

C

Chris L.

Hi All,
I am currently interfacing my Perl app with My SQL Server5.0 through
the Perl DBI. I felt confident in what I was doing until today. I was
trying to add a feature where I would need to create a new database in
My SQL... and then realized I had no idea as to how (through Perl and
DBI).
Can I write a Perl application utilizing the DBI to CREATE a database
(not a table)??
Thank you so much for your expertise.
Chris
 
D

DJ Stunks

Chris said:
Hi All,
I am currently interfacing my Perl app with My SQL Server5.0 through
the Perl DBI. I felt confident in what I was doing until today. I was
trying to add a feature where I would need to create a new database in
My SQL... and then realized I had no idea as to how (through Perl and
DBI).
Can I write a Perl application utilizing the DBI to CREATE a database
(not a table)??
Thank you so much for your expertise.
Chris

I take it you're also a rookie reader? What level googler are you?
Have you heard of documentation?

But, since I'm feeling charitable, I'll give you a hint:

$dbh->do()

Good luck with your total rookie-ness.

-jp
 
X

xhoster

Chris L. said:
Hi All,
I am currently interfacing my Perl app with My SQL Server5.0 through
the Perl DBI. I felt confident in what I was doing until today. I was
trying to add a feature where I would need to create a new database in
My SQL... and then realized I had no idea as to how (through Perl and
DBI).

Do you know how to create a database without using Perl and DBI? If so,
then just taking that knowledge and doing the obvious will probably work.
If it doesn't, show us what you tried and what errors you received.
Can I write a Perl application utilizing the DBI to CREATE a database
(not a table)??

I think you can. IIRC, You can't use bind variables for the db name.

Xho
 
X

Xicheng

Chris said:
Hi All,
I am currently interfacing my Perl app with My SQL Server5.0 through
the Perl DBI. I felt confident in what I was doing until today. I was
trying to add a feature where I would need to create a new database in
My SQL... and then realized I had no idea as to how (through Perl and
DBI).

For MySQL server5.0, I guess you can either use a driver handle ($drh)
to create a new database, or use a database handle($dbh) to connect to
any existing database, and then issue $dbh->do('CREATE DATABASE
my_db');

check out perldoc DBD::mysql, and take a look at "Server
Administration" section.
Good luck,
Xicheng
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top