Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^7: Making a regex case insensitive

by davorg (Chancellor)
on Mar 06, 2007 at 19:53 UTC ( #603496=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Making a regex case insensitive
in thread Making a regex case insensitive

I have been given:

my $sql = "EXEC $SPROC ". join ', ', ('?') x $procs{$SPROC}; my $sth = $dbh->prepare($sql); $sth->execute(@CHOICE);

But I don't understand how to apply it. Did the person that gave me this mean:

$sth->execute($Command);

No. I meant what I wrote. And I've tried twice to explain how it's used. But you seem determined not to understand :-)

Let's have one last try.

  1. Create an SQL statement containing placeholders (marked by question marks) where you later want to insert values.
  2. Compile that SQL using $dbh->prepare. This returns a statement handle ($sth).
  3. Execute the statement using $sth->execute passing it a list of values - one value for each placeholder in the SQL statement,

Does that help at all?


Comment on Re^7: Making a regex case insensitive
Select or Download Code
Re^8: Making a regex case insensitive
by Win (Novice) on Mar 07, 2007 at 15:28 UTC
    The problem that I have with this method is that it produces the following error message. Does this mean that I have to change the SPROC to only receive strings or can I make changes at the Perl level?
    Syntax error converting the nvarchar value 'x' to a column of data typ +e int.
    Update: The placeholders show as follows:
    EXEC sprocname ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? +, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
    There was a string like the following: 'ICTABYXIDNUBXdMOCqgwbQRVJNZsfgVqOFrH' which does contain a X

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (19)
As of 2015-07-01 20:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (19 votes), past polls