Connecting Tech Pros Worldwide Help | Site Map

mssql: update statement wrong or truncated

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 01:09 AM
Jochen Daum
Guest
 
Posts: n/a
Default mssql: update statement wrong or truncated

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, 01:09 AM
Jochen Daum
Guest
 
Posts: n/a
Default 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/
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.