Professional Web Applications Themes

mssql: update statement wrong or truncated - PHP Development

Hi ! I have this upate statement which gets sent to MS SQL: update MsgOutgoing set SenderResource = NULL,RecipientAddress = '',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 xx job#NOxon monday urgent my muckup sorryxx"‹° ú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 ...

  1. #1

    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 =
    '',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 xx job#NOxon monday urgent
    my muckup sorryxx"‹° ú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 =
    '',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.
    [url]http://sourceforge.net/projects/phpdbedittk/[/url]
    Jochen Daum Guest

  2. #2

    Default Re: mssql: update statement wrong or truncated

    Hi again!

    On Mon, 17 Nov 2003 11:37:50 +1300, Jochen Daum
    <jochen.daumcans.co.nz> wrote:
    >Hi !
    >
    >I have this upate statement which gets sent to MS SQL:
    >
    >update MsgOutgoing set SenderResource = NULL,RecipientAddress =
    >'',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 xx job#NOxon monday urgent
    >my muckup sorryxx"‹° ú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 yzer.

    Jochen

    --
    Jochen Daum - CANS Ltd.
    PHP DB Edit Toolkit -- PHP scripts for building
    database editing interfaces.
    [url]http://sourceforge.net/projects/phpdbedittk/[/url]
    Jochen Daum Guest

Similar Threads

  1. Update MSSQL table with Uploaded MS Access DB
    By bigbrain28 in forum Coldfusion Database Access
    Replies: 2
    Last Post: February 21st, 03:06 PM
  2. Help! What's wrong with my QUERY statement??
    By RuBot in forum Coldfusion Database Access
    Replies: 5
    Last Post: August 13th, 09:05 AM
  3. What is wrong with this insert statement?
    By chill84 in forum Coldfusion Database Access
    Replies: 1
    Last Post: May 13th, 02:53 PM
  4. field seperator in select / wrong statement ?
    By Kai Baumgart in forum IBM DB2
    Replies: 1
    Last Post: August 26th, 02:56 PM
  5. Replies: 0
    Last Post: July 10th, 11:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139