--- SAWMaster <[EMAIL PROTECTED]> wrote:
> Can someone clear this up for me?
> 
> Is DBI some sort of implementation of Win32::ODBC or is it an entity in and of 
>itself?

DBI.pm (DataBase Interface) is a generic wrapper around the various DBD (DataBase 
Driver) modules
that are available.  DBI is *usually* the standard interface for database work in 
Perl.  DBI.pm
does not care what OS you are on (unlike Win32::ODBC) and can work both with and 
without an ODBC
connection (unlike Win32::ODBC).

> The reason I ask is because Brett said this:
> 
> "I was going to suggest that also, but I think they were using Win32::ODBC,
> which I don't believe supports placeholders."
> 
> I am using DBI, so does it support placeholders?

Yes, it does.  Works very well, too.  Win32::ODBC also does not handle adding binary 
data to a
database (unless this has changed, we weren't able to do it here), is not portable, 
and is less
widely used.

As for your code problem, after instantiating a DBI object, try adding the following 
line of code:

DBI->trace( 2, 'errors.txt' );

>From the documentation:

DBI->trace($trace_level)
DBI->trace($trace_level, $trace_filename)

DBI trace information can be enabled for all handles using the
`trace' DBI class method. To enable trace information for a specific
handle, use the similar `$h-'>`trace' method described elsewhere.

Trace levels are as follows:

0 - Trace disabled.
1 - Trace DBI method calls returning with results or errors.
2 - Trace method entry with parameters and returning with results.
3 - As above, adding some high-level information from the driver
    and some internal information from the DBI.
4 - As above, adding more detailed information from the driver.
    Also includes DBI mutex information when using threaded Perl.
5 and above - As above but with more and more obscure information.

Personally, I never need to go above trace level two or three.

After you run your program, look at the error log that this generates and you will 
find the exact
SQL statement that caused the issue.  I find this easier than constantly adding 
"print" statements
to my code.

Cheers,
Curtis Poe

=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to