473,513 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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/
Jul 17 '05 #1
1 5021
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7017
by: Philip Mette | last post by:
I am in a crunch and need to covert this Oracle statement to MSSQL. Is there any Oracle/MSSQL experts out there that can help me? I do not understand the syntax enough to modify this. Thanks so...
2
3034
by: Steve Bishop | last post by:
I'm having problems using an update query. I get the error: Server: Msg 8152, Level 16, State 9, Procedure SP_MemberUpdate, Line 3 String or binary data would be truncated. The statement has been...
0
1104
by: sherif | last post by:
Hi, I'm making an application using C# and i connect through it to a database made by MSSQL server but i have a problem when inserting or updating in the database in arabic that each arabic...
9
5262
by: joun | last post by:
Hi all, i'm using this code to insert records into an Access table from asp.net, using a stored procedure, called qry_InsertData: PARAMETERS Long, Long, Text(20), Long, DateTime; INSERT...
6
2688
by: Matt | last post by:
I'm having difficulty with trying to update a Access memo field through an SQL statement where the value I'm trying to pass is longer than 255 characters. The field is being truncated. I'm using...
2
1367
by: Gison | last post by:
Dear all, I'm a SQL server beginner.... I want to replace description column by add on my name to every strings. Does anyone can point out where i wrong in following syntax. thanks a lot. ...
3
1907
by: grantf3 | last post by:
Hi all, I am currently trying to populate a dropbox with values from a MSSQL DB. The values that are being brought back from the table are two words - peoples full names, eg 'John Smith' (in the one...
5
2246
by: Chris Cowles | last post by:
I use an application that uses Oracle 8.1.7. All functions of the application are completed with calls to stored procedures. A data entry error occurred that caused thousands of records to be...
3
2100
by: tiptap | last post by:
Hey, I have a really confusing problem here. I'm using MSSQL & PHP. I have created a querry in MSSQL that basically shows a list of events and shows them in date order. I have written a bit of...
0
7259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7158
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7380
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.