Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

DBD::mysql driver and DELIMITER

by JayBonci (Curate)
on Jul 05, 2012 at 22:46 UTC ( [id://980174]=perlquestion: print w/replies, xml ) Need Help??

JayBonci has asked for the wisdom of the Perl Monks concerning the following question:

Here's a general snippet of code that I can't get to work. How do you set the DBD::mysql delimiter for installing functions with it? I've gotten this to work in the past, but I lost the code:
my $sth = $dbh->prepare("DELIMITER //"); $sth->execute(); exit;
DBD::mysql::st execute failed: You have an error in your SQL syntax; c +heck the manual that corresponds to your MySQL server version for the + right syntax to use near 'DELIMITER //' at line 1 at /root/test.pl l +ine 22, <FH> line 8.
root@vagrant:~# perl -MDBI -e 'DBI->installed_versions' Perl : 5.010001 (i486-linux-gnu-thread-multi) OS : linux (2.6.32-5-686) DBI : 1.612 DBD::mysql : 4.016 DBD::Sponge : 12.010002 DBD::Proxy : 0.2004 DBD::Gofer : 0.014123 DBD::File : 0.39 DBD::ExampleP : 12.010007 DBD::DBM : 0.05
This is one of those things where I'm not sure of what to google for to get the right answer. A pointer would be great. Thanks!


    --jaybonci

Replies are listed 'Best First'.
Re: DBD::mysql driver and DELIMITER
by frozenwithjoy (Priest) on Jul 06, 2012 at 04:48 UTC

    I looked around and I saw syntax like:

    $dbh->prepare("COPY $names TO ? WITH DELIMITER AS #");

    Maybe mess with yours a bit using this as a starting point? It might be as simple as writing: "DELIMITER AS //"

    Good luck!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://980174]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-19 15:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found