Martin Leese wrote:

Wayne Simmons <[EMAIL PROTECTED]> wrote:

>> From the win32::ODBC documentation:
>>
>> Sql ( SQL_STRING )
>>
>> xecutes the SQL command SQL_STRING on the current connection.
>> Returns ? on success, or an error number on failure.
>>
>> Here's some basic programming knowledge. Boolean FALSE = 0, Boolean TRUE is
>> anything that is not 0. Since the function returns an error number
>> (positive or negative doesn't matter as long as it is non-zero) the
>> statement evaluates to Boolean TRUE. On success it must return 0, that's
>> the only thing that would make this work as expected, or in your case, as
>> not-expected.


So:

if ( $database_handle->Sql($statement) != 0 )
{
    # code to catch and print any errors
}

would better make clear what is going on.

Personally, I like ODBC's convention.  There is only one
way to succeed but many ways to fail.

Regards,
Martin



Thank you, Martin. I used the code as suggested, taking into account variable names, and got this error:

"Use of uninitialized value in numeric ne (!=)...An undefined value was used as if it were already
defined."


But I think everything IS defined!

--
Sincerely,

Craig Cardimon, Programmer
AUS Inc.
(Knowledge Express Data Systems; 1-800-529-5337, ext. 24)

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to