[thelist] CF / SQL problem

rudy limeback r937 at interlog.com
Tue, 21 Dec 1999 21:40:00 -0500


hi scott

>   <cfset qryString = Insert(" AND mailcodeTB.department LIKE
>   '#department#%'", qryString, Len(qryString))>

no jeff, that's not an extraneous %, that's the wildcard character

scott, i think what you are trying to do with the insert function is slick

i would've done it the old fashioned, dare i say brute force, way, by
concatenating the to-be-appended bit to the original string, something like

   <cfset qryString = "#qryString#" + " AND et cetera">

(don't go with that, i haven't tested it, got no cf server here at home)

i *think* what's happening is that the blank which is at the front of the
appended string is overlaying the last character of the original string,
the D at the end of sacramentoTB.sacID -- hence, syntax error, ain't gots
no column called sacI

Len(qryString) points to the last character, and that's where you are
"inserting"

you can fix the problem by adding a blank to the end of the original string

either that, or specify Len(qryString)+1 for the position where to insert
the append string

if that don't fix it, i'm stumped too

___________________
rudy limeback
http://www.interlog.com/~r937/
http://evolt.org/