Spaces being truncated in query / MID function gone?

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Spaces being truncated in query / MID function gone?

    SELECT COUNT(DISTINCT PRES_CYCL_ID)
    is being changed to
    SELECT COUNT(DISTINCTPRES_CYCL_ID)

    If I response.Write the query, I see the space and the query is OK. But
    somewhere along the way to the DB, the space is removed between DISTINCT and
    PRES_CYCL_ID. What could cause this behavior? Would it also be the same
    reason the MID() function stopped working, too?


    hb Guest

  2. Similar Questions and Discussions

    1. Query a field with spaces in it
      I'm currently trying to run an update on a field in an Access database. <CFSET LINENUM=LINENUM+1> <CFQUERY NAme="UpdateRecords" ...
    2. #26192 [Fbk->NoF]: The mail function out putting extra spaces between each line
      ID: 26192 Updated by: sniper@php.net Reported By: bpaulson at chieftain dot com -Status: Feedback +Status: ...
    3. #26192 [NEW]: The mail function out putting extra spaces between each line
      From: bpaulson at chieftain dot com Operating system: Linux Redhat 7.3 PHP version: 4.3.4 PHP Bug Type: Mail related Bug...
    4. function to strip spaces?
      On 05 Aug 2003, "Jason Wolfe" <jason@infuselabs.com> wrote: Director doesn't have a built in method for this. Here's one way: on trim aString...
    5. #24777 [NEW]: $_GET values truncated at %3C in query string
      From: csnyder at chxo dot com Operating system: Linux / FreeBSD PHP version: 4.3.2 PHP Bug Type: Strings related Bug...
  3. #2

    Default Re: Spaces being truncated in query / MID function gone?

    hb wrote:
    > SELECT COUNT(DISTINCT PRES_CYCL_ID)
    > is being changed to
    > SELECT COUNT(DISTINCTPRES_CYCL_ID)
    >
    > If I response.Write the query, I see the space and the query is OK.
    > But somewhere along the way to the DB, the space is removed between
    > DISTINCT and PRES_CYCL_ID. What could cause this behavior?
    That is strange. You should view the source of the page to verify that the
    sql statement actually has a space there rather than &nbsp;

    It would help to see the code that generates this string.
    > Would it
    > also be the same reason the MID() function stopped working, too?
    Huh? When did the Mid() function stop working?? What are you talking about?

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  4. #3

    Default Re: Spaces being truncated in query / MID function gone?

    > hb wrote:
    > > SELECT COUNT(DISTINCT PRES_CYCL_ID)
    > > is being changed to
    > > SELECT COUNT(DISTINCTPRES_CYCL_ID)
    > >
    > > If I response.Write the query, I see the space and the query is OK.
    > > But somewhere along the way to the DB, the space is removed between
    > > DISTINCT and PRES_CYCL_ID. What could cause this behavior?
    >
    > That is strange. You should view the source of the page to verify that the
    > sql statement actually has a space there rather than &nbsp;
    Figured this part out... Needed up update some patches on the oracle client.
    > > Would it
    > > also be the same reason the MID() function stopped working, too?
    >
    > Huh? When did the Mid() function stop working?? What are you talking
    about?

    Good question. The Mid() function in ASP VbScript no longer works. It's an
    unrecognized function.


    hb Guest

  5. #4

    Default Re: Spaces being truncated in query / MID function gone?

    hb wrote:
    > Good question. The Mid() function in ASP VbScript no longer works.
    > It's an unrecognized function.
    Show me how to reproduce the error. You may be attempting to use the Mid()
    statement, which has never been supported in vbscript:

    s = "abd"
    Mid(s,3,1) = "c"
    ' if this is VB/VBA, s now contains "abc"

    as opposed to the Mid() function:

    s = Mid("abc",3,1)
    's now contains "c"

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  6. #5

    Default Re: Spaces being truncated in query / MID function gone?

    "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:euuBkSDNEHA.1312@TK2MSFTNGP12.phx.gbl...
    > hb wrote:
    > > Good question. The Mid() function in ASP VbScript no longer works.
    > > It's an unrecognized function.
    >
    > Show me how to reproduce the error. You may be attempting to use the
    Mid()
    > statement, which has never been supported in vbscript:
    >
    > s = "abd"
    > Mid(s,3,1) = "c"
    > ' if this is VB/VBA, s now contains "abc"
    >
    > as opposed to the Mid() function:
    >
    > s = Mid("abc",3,1)
    > 's now contains "c"
    >
    > Bob Barrows
    Here's the code:

    LOC = INSTR(szStructCFG," ") 'note the double space
    if MID(szStructCfg,LOC,1) = " " THEN
    szStructCFG = LEFT(paramStructCFG,LOC-1)
    end if

    This code used to work till we rebuilt the web server (Win2k Server). Here
    is the error:
    Microsoft VBScript runtime error '800a0005'
    Invalid procedure call or argument: 'MID'



    hb Guest

  7. #6

    Default Re: Spaces being truncated in query / MID function gone?

    Take a look at the value of LOC and I think you'll see your problem.

    LOC = INSTR(szStructCFG," ") 'note the double space
    RESPONSE.WRITE "THE VALUE OF LOC IS " & LOC
    if MID(szStructCfg,LOC,1) = " " THEN
    szStructCFG = LEFT(paramStructCFG,LOC-1)
    end if

    Ray at work

    "hb" <hbranyan.SPAMBLOCK@merc.mercer.edu> wrote in message
    news:2g1p6tF3luf7U1@uni-berlin.de...
    > Here's the code:
    >
    > LOC = INSTR(szStructCFG," ") 'note the double space
    > if MID(szStructCfg,LOC,1) = " " THEN
    > szStructCFG = LEFT(paramStructCFG,LOC-1)
    > end if
    >
    > This code used to work till we rebuilt the web server (Win2k Server). Here
    > is the error:
    > Microsoft VBScript runtime error '800a0005'
    > Invalid procedure call or argument: 'MID'
    >
    >
    >

    Ray at Guest

  8. #7

    Default Re: Spaces being truncated in query / MID function gone?

    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
    message news:uZgupDFNEHA.796@TK2MSFTNGP12.phx.gbl...
    > Take a look at the value of LOC and I think you'll see your problem.
    >
    > LOC = INSTR(szStructCFG," ") 'note the double space
    > RESPONSE.WRITE "THE VALUE OF LOC IS " & LOC
    > if MID(szStructCfg,LOC,1) = " " THEN
    > szStructCFG = LEFT(paramStructCFG,LOC-1)
    > end if
    >
    > Ray at work
    I think you are right. thanks


    hb Guest

Posting Permissions

  • You may not post new threads
  • You may 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