By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 865 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

mssql: update statement wrong or truncated

P: 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/
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi again!

On Mon, 17 Nov 2003 11:37:50 +1300, Jochen Daum
<jo*********@cans.co.nz> wrote:
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'


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/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.