Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: calling a stored procedure using DBI.pm

by aroc725 (Acolyte)
on Apr 12, 2006 at 20:28 UTC ( [id://542942]=note: print w/replies, xml ) Need Help??


in reply to Re: calling a stored procedure using DBI.pm
in thread calling a stored procedure using DBI.pm

Thanks to everyone who took the time to respond.

I think the documentation may be slightly off. Here's what appears in the documentation I was referred to:
...
$sth = $dbh->prepare("declare \@id_value int, \@id_name exec my_proc @name = 'a string', @number = 1234, @id = @id_value OUTPUT, @out_name = @id_name OUTPUT");
...

Question - isn't the backslash (\) character needed in front of every '@' character within the string containing the stored procedure call ?
  • Comment on Re^2: calling a stored procedure using DBI.pm

Replies are listed 'Best First'.
Re^3: calling a stored procedure using DBI.pm
by runrig (Abbot) on Apr 12, 2006 at 23:05 UTC
    isn't the backslash (\) character needed in front of every '@' character within the string...

    Yes it is. I think under older perls, it may have been just a warning, but now you definitely need the backslash to not try to interpolate arrays in a double quoted string (and is a fatal error under use strict if you try to interpolate a non-existant array).

Re^3: calling a stored procedure using DBI.pm
by roboticus (Chancellor) on Apr 12, 2006 at 23:47 UTC
    Yes, or you could use a single-quoted string.
Re^3: calling a stored procedure using DBI.pm
by mpeppler (Vicar) on Apr 13, 2006 at 19:19 UTC
    You are correct - the backslashes are missing, a typo in the docs which I'll correct.

    Michael

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-25 19:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found