I'm sending a moderately complex t-sql script at SQL server 2k via DBD::ODBC (can't find a win32 pm for ADO), which behaves perfectly within Query Analyser.
As soon as I execute the PERL script, it kicks out errors that suggest the DBD module is having problems with the script - misreading parts of the script maybe.
Particularly, this bit:
declare @intpos int declare @intuser int declare @dtlastpost varchar(30) set @intuser = (select userid from [$dbname].[dbo].[users] where [ +name] = '$user') set @intpos = (select top 1 permissionid from [$dbname].[dbo].[sec +urity] where [userid] = @intuser order by permissionid desc) set @dtlastpost = (SELECT top 1 [PostDate] FROM [$dbname].[dbo].[ +Messages] where userid = @intuser order by postdate desc )
produces:
Couldn't execute statement: [Microsoft][ODBC SQL Server Driver][SQL Se +rver]Incorrect syntax near the keyword 'declare'. (SQL-42000)
Is it possible that I have to break this into bits and run a seperate script for each stage?
Edit planetscape - added code tags
In reply to Limitations of DBI (or) DBD::ODBC ? by s_m_b
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |