I'd like to recall this post due to a solution presenting itself after
posting.

I was trying to track which helper table was having problems so I deleted
all entries in the MAC address table, and then ran the script again.  This
time it's working (while repopulating IPS and MACs (so far it's worked for
7000+ entries).

Thanks anyway.
Steven

-----Original Message-----
From: Steven Manross [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, May 21, 2002 9:43 AM
To: '[EMAIL PROTECTED]'
Subject: DBD::ODBC and sp that inserts data (SQL2K)


I want to use DBI/DBD with a stored procedure that calls 2 other stored
procedures.

-those other 2 stored procedures check tables and insert data if it did not
previously exist and then return the identity value to the first procedure
for purposes of normalization to insert into the main table.

When I invoke the stored procedure and it inserts data into one of the
helper tables, everything seems fine until the next "execute" in the foreach
loop, when perl returns an Invalid Cursor State (SQL-24000).

*I've tried disconnecting, reconnecting, preparing and executing from inside
the foreach loop and that seems to work, but doesn't seem like a fix to the
problem, and is pretty slow.

The stored procedure seems to invoke correctly from query analyzer.

This is very reproducable, and each time the script is invoked, it gets a
little further in processing the list of data (since it only fails when it
inserts data to one of the 2 [or both of the] helper tables).

I can truncate all of the tables, start over and get the same errors at the
same places, with the same behavior (fails after an insert to the helper
tables).

As well, I saw a similar post back in September, 2001 to this list and it
too was dealing with Inserts, but I didn't know if it would apply in my case
since my inserts are done from inside the stored procedure, and not strictly
within DBI. As well, I did employ the
finish() in case it helped.

Similar:
  Problem: http:[EMAIL PROTECTED]/msg05997.html
  Solution: http:[EMAIL PROTECTED]/msg06024.html

I wasn't able to find any more info from the archives that would lead me to
a solution.

The data is extracted from some log files for MAC addresses, IPs,
workstation names and usernames. Each time I encounter a new IP or new MAC
address the problem exerts itself. Any help would be appreciated. 

I have DBD::ODBC 0.41.

<snip>

Reply via email to