DBD::Sybase with MS SQL insert problem



I'm using DBD::Sybase against a MS SQL database. This configuration
does not support ? placeholders, so I'm stuck with the kluge described
below.

I'm seeing a strange result after executing the following query:

my $query = <<"ENDQUERY"
BEGIN
DECLARE \@Counter int
DECLARE \@siteurl sc_url
set \@Counter = 0
WHILE (\@counter < 100)
BEGIN
SET \@siteurl = 'http://dummy-host.nonexist' + LTRIM(STR(\@Counter))
+ '.com/'
Insert INTO DBName.dbo.tablename
(url,
created,
source_id) VALUES
(\@siteurl,GETUTCDATE(), 4)
-- dummy, now , me
SET \@Counter = \@Counter + 1
END
END
ENDQUERY
;

The table only gets filled with 57 or 58 rows! There are no errors
returned, nor does anything negative show up with DBI->trace(2).

The 50-odd rows all are filled with the correct data. I can run the
script again starting at @Counter=58 and add another 57 or so rows.

.



Relevant Pages

  • Re: "my" variables and recursive regexp strangeness
    ... > I have something strange happening with a recursive regexp compiled ... > It works fine when the sub parts of it are global variables, ... to declare the variables in the same statement that uses them, ...
    (comp.lang.perl.misc)
  • Re: Assign dynamic sql result to variable
    ... where userid = @userid ... >>declare @actionCount int ... Am I stuck with ...
    (microsoft.public.sqlserver.programming)
  • Re: copy email to a task in vba
    ... If that looks too strange for you then you ... could also declare it in the Formular as a public member. ... Dim fm as Form1 ... You have to declare the variable in a standard module as public to pass ...
    (microsoft.public.office.developer.outlook.vba)
  • Re: PInvoke question (caling conventions of C DLLs)
    ... "Anonymous" schrieb ... is the Python DLL. ... I have noticed something strange. ... When I declare the functions in ...
    (microsoft.public.dotnet.languages.vb)
  • Re: PInvoke question (caling conventions of C DLLs)
    ... the Python DLL. ... I have noticed something strange. ... When I declare the functions in VB6 ...
    (microsoft.public.dotnet.languages.vb)