Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Re: Test for number or string

by nedals (Deacon)
on May 03, 2003 at 00:55 UTC ( #255209=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Test for number or string
in thread Test for number or string

Too true :)
I guess I thought there would be a simple answer to the original question.

UPDATE
Let me make sure I understand what you are saying.

I can easily download my data with no quotes in the form...

id,name,address,etc

Now I upload this same data using something like this...
my $sql = "INSERT INTO tablename VALUES(?)"; my $sth = $dbh->prepare($sql); foreach my $record (@filedata) { $sth->execute($record); }
... and I don't have to worry about quotes, etc.?

Replies are listed 'Best First'.
Re^4: Test for number or string
by Aristotle (Chancellor) on May 03, 2003 at 02:25 UTC
    Exactly that is the case. Even if you insist on quoting yourself though, you should know which columns expect numbers and which expect strings, so you don't need to examine the value either way.

    Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2021-04-20 21:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?