This link might help you get on the right track:

    http://search.cpan.org/~timb/DBI/DBI.pm#bind_param

and look for a paragraph titled "Data Types for Placeholders" - that
shows you what stuff can be put in that 3rd bind_param argument.

HTH.

Hardy Merrill

>>> <[EMAIL PROTECTED]> 06/03/04 12:13PM >>>
Hi Mr. Bunce,

 

I am a developer recently using Perl on one of my projects. I got a
DBI
question but couldn't find solution by searching the web. I'll greatly
appreciate if you could help me out.

 

I am trying to port a C code into Perl using your DBI module. The C
code
uses ODBC API SQLBindParameter like below:

 

                        nRetVal = SQLBindParameter( m_hstmt, 1,
SQL_PARAM_INPUT, SQL_C_WCHAR, SQL_WVARCHAR,

                                                            15, 0,
Col2Values[nIndex] , 15, &lParameterSize);

 

The 4th and 5th parameter value type SQL_C_WCHAR, SQL_WVARCHAR must be
passed to the driver for Unicode support. However, your DBI module
bind_param function only provides 3 interfaces:

 

$rc = $sth->bind_param($p_num, $bind_value);

$rc = $sth->bind_param($p_num, $bind_value, $bind_type);

$rc = $sth->bind_param($p_num, $bind_value, \%attr);

 

I tried the 3rd interface, but I don't know what attributes the \%attr
expects. In ODBC.pm, I only saw attributes are NAME, NULLABLE, TYPE,
PRECISION and SCALE.

 

Would you please advise how can I use bind_param call in DBI to get
the
equivalent of the above C code.

 

Thank you in advance for your help,

Shuyan He

OCP, OCDBA

MCP, MCSD

SCJP

 

Reply via email to