Rookie Programming the Perl DBI..

Discussion in 'Perl Misc' started by Chris L., Jan 28, 2006.

  1. Chris L.

    Chris L. Guest

    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
     
    Chris L., Jan 28, 2006
    #1
    1. Advertising

  2. Chris L.

    DJ Stunks Guest

    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
     
    DJ Stunks, Jan 28, 2006
    #2
    1. Advertising

  3. Chris L.

    Guest

    "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).


    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
     
    , Jan 29, 2006
    #3
  4. Chris L.

    Xicheng Guest

    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
     
    Xicheng, Jan 30, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ulloa
    Replies:
    1
    Views:
    527
    Juha Laiho
    Jul 22, 2004
  2. Jerome Hauss
    Replies:
    0
    Views:
    172
    Jerome Hauss
    Oct 13, 2004
  3. Asby

    Mason, DBI, and DBI::Pg

    Asby, Jul 24, 2003, in forum: Perl Misc
    Replies:
    0
    Views:
    177
  4. GRLCOPM

    Help needed for perl rookie

    GRLCOPM, Dec 27, 2004, in forum: Perl Misc
    Replies:
    4
    Views:
    160
    GRLCOPM
    Dec 28, 2004
  5. swangdb

    Rookie Perl Question

    swangdb, Jun 30, 2006, in forum: Perl Misc
    Replies:
    8
    Views:
    114
    John Bokma
    Jul 1, 2006
Loading...

Share This Page