Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > DBI and xml:parser
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 20th June 20:40
bugs
External User
 
Posts: 1
Default DBI and xml:parser



i have created a script that uses the DBI and the XML::Parser modules.
i have created a connection in the main scope and then i create & execute a
statment in one of the start_handler of the xml:arser, along the lines of

$dbh = DBI->connect("my connection");
$xp = new XML:Parser(HANDLERS =>{Start => \&myStartSub}

sub myStartSub {
# creates sql statment
$dbh->do("the sql statment")
}

the problem i'm having is that the sql statment is not executing, it doesn't
return any errors.
if i move the $dbh->do("the sql statment") out of the sub it works fine, but
that's not much good to me up there, it also works if i place $dbh =
DBI->connect("my connection"); inside the sub, but i don't want to be
creating a db connection evertime i parse an element.
How do i get around this?
Mark
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666