Re: bind_param question
On Tue, 21 Jun 2005, Keith Jackson wrote:
> Is there a way to assign the data type by column, then doing the execute
> with the value?
Yup, you can use the standard bind_param and the use execute() in your loop
like this:
$sth->bind_param(1, undef, SQL_INEGER);
>
> foreach (@( $myArrayHash) ){
# the $sth->bind_param(1, undef, SQL_INTEGER) is sticky so this execute
# remembers and $myArrayHash{'min'} is bound as an integer.
> $sth->execute($myArrayHash{'min'},$myArrayHash{'code'});
> ....
> }
>
HTH,
-r
.
Relevant Pages
- RE: SQL Server not inserting all rows from single long statement
... >From Books Online explaination of EXECUTE: ... or nvarchar data type with a maximum value of the server's available ... characters for char or varchar data type strings. ... If the string is greater ... (microsoft.public.sqlserver.server) - DataType TABLE questions
... Then I grab the records making sure I did not grab the ones in ... that I must execute a query that is generated by parameters. ... doesn't work with data type TABLE's. ... It always says I must declare the ... (microsoft.public.sqlserver.server) - Re: Why arent data types in SqlParameters validated?
... why is an exception *not* thrown on this line: ... Ideally, this wouldn't even compile, let alone execute. ... if the data type parameter in this constructor is not ... best practice for accomplishing type safety when setting up store procedures ... (microsoft.public.dotnet.framework.adonet) - INSERT/SELECT and DataType Mismatch
... I get a "Datatype mismatch in criteria expression" error when i execute ... Parameters are in the good order and are of the good data type. ... (borland.public.delphi.database.ado) - Re: Are you guys sure about + in this sp
... You're still not evaluating that SQL; all you're doing is preparing the ... string. ... You need to EXECUTE it. ... > Parameter '@strSQL' has an invalid data type. ... (microsoft.public.sqlserver.programming) |
|