Home > Archive > PERL Miscellaneous > January 2006 > Rookie Programming the Perl DBI..
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Rookie Programming the Perl DBI..
|
|
| Chris L. 2006-01-27, 9:57 pm |
| 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
| |
| DJ Stunks 2006-01-28, 3:57 am |
| Chris L. wrote:
> 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
| |
| xhoster@gmail.com 2006-01-28, 9:57 pm |
| "Chris L." <chrisliapis@gmail.com> wrote:
> 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
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
| |
| Xicheng 2006-01-30, 6:59 pm |
| Chris L. wrote:
> 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
|
|
|
|
|