Connecting Tech Pros Worldwide Help | Site Map

mssql: update statement wrong or truncated

  #1  
Old July 17th, 2005, 02:09 AM
Jochen Daum
Guest
 
Posts: n/a
Hi !

I have this upate statement which gets sent to MS SQL:

update MsgOutgoing set SenderResource = NULL,RecipientAddress =
'xxxxxxxxx',EarliestSentDateTime = NULL,LatestSentDateTime =
'2003-11-15 14:41:03.060',SentDateTime = '2003-11-17
11:40:06.000',RecipientResource = '313',FailCounter = 0,DeliveryMedium
= 'SMS',Content = 'can u do a job xxxxxxxx job#NOxxxxon monday urgent
my muckup sorryxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"‹° úcan' where SenderApp
= 'ROLODEX' and SenderReference = '313' and EntryDateTime =
'2003-11-15 14:41:03.060'

(replaced some data with x'es

Warning: mssql_query(): message: Line 1: Incorrect syntax near 'SMS'.
(severity 15) in /var/www/phpdbedittk/dal.php on line 175

Warning: mssql_query(): message: Unclosed quotation mark before the
character string ''. (severity 15) in /var/www/phpdbedittk/dal.php on
line 175

Warning: mssql_query(): Query failed in /var/www/phpdbedittk/dal.php
on line 175


In my opinion it looks perfectly fine.

One idea is that my query gets cut off at 255 characters, which would
then look like:

update MsgOutgoing set SenderResource = NULL,RecipientAddress =
'xxxxxxxxx',EarliestSentDateTime = NULL,LatestSentDateTime =
'2003-11-15 14:41:03.060',SentDateTime = '2003-11-17
11:40:06.000',RecipientResource = '313',FailCounter = 0,DeliveryMedium
= 'SMS

I know I can run queries bigger than 255 chars in other places.

Any ideas?

I use freetds 0.51-4 on debian woody to access the SQL server.

Jochen

--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
  #2  
Old July 17th, 2005, 02:09 AM
Jochen Daum
Guest
 
Posts: n/a

re: mssql: update statement wrong or truncated


Hi again!

On Mon, 17 Nov 2003 11:37:50 +1300, Jochen Daum
<jochen.daum@cans.co.nz> wrote:
[color=blue]
>Hi !
>
>I have this upate statement which gets sent to MS SQL:
>
>update MsgOutgoing set SenderResource = NULL,RecipientAddress =
>'xxxxxxxxx',EarliestSentDateTime = NULL,LatestSentDateTime =
>'2003-11-15 14:41:03.060',SentDateTime = '2003-11-17
>11:40:06.000',RecipientResource = '313',FailCounter = 0,DeliveryMedium
>= 'SMS',Content = 'can u do a job xxxxxxxx job#NOxxxxon monday urgent
>my muckup sorryxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"‹° úcan' where SenderApp
>= 'ROLODEX' and SenderReference = '313' and EntryDateTime =
>'2003-11-15 14:41:03.060'
>[/color]

The problem seem to be the special characters on the end of the
Content field. I can read them, but if I run an update query it fails.
The same query runs in query analyzer.

Jochen

--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Closed Thread