Need a sanity check please. The following sql "select DATEADD(day, DATEDIFF(day, 2, GETDATE()), '20:00:00') as ADATE" runs correctly in Microsoft SQL query analyzer..
However in perl on a Win7 64bit environment, it complains with the following error "Description: MicrosoftODBC SQL Server Driver Cursor type changed".
My code can runs select and update statements against tables with no issues so I am a bit stumbled about the cursor error.
Note that I have not included my connection string but have illustrated that I am using Win32::OLE.
use Win32::OLE; $conn->{ConnectionString} = "..."; $conn->open; # open connection to the DB $state = $conn ->state; #1 means connected if($state ne "1"){... $mssql_select = "select DATEADD(day, DATEDIFF(day, 2, GETDATE()), '20 +:00:00') as ADATE"; $rs->Open( $mssql_select, $conn); my $error_collection = $conn->Errors(); my $ecount = $error_collection->Count; my ($is_message, $real_error_found); foreach my $error (in $error_collection) { #output error statements $is_message = ($error->{SQLState} eq "01000" && $error->{NativeErr +or}==0); $real_error_found=1 unless $is_message; $status = "ERROR # " . $error->{Number} . "\n Description: " . $error->{Description} . "\nSource: " . $error->{Source} . "\n"; }
Results in "Description: Microsoft ODBC SQL Server Driver Cursor type changed". Any ideas the group can provide would be appreciated.
Thank You,
AJ
In reply to Perl OLE32 MSSQL SELECT dateadd function results in “Cursor type changed” error by newbieperlperson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |