So this works fine to tell me the current directory:
cfset DirPath=#GetDirectoryFromPath(GetCurrentTemplatePath())#
cfset CurrentDirectory=#ListLast(DirPath, \)#
I find however that if my directory is called MyDirectory, the value
returned for the variable CurrentDirectory is all lowercase, ie
SQL comparisons are case insensitive, unless you tell it otherwise.
You can probably get the proper case if you go through a java.io.File
instance, and use the canonicalPath method.However, CF may be doing this
already, and the canonical path according to your JRE is all lower case
(since case is
case sensitivity in the database depends on the DB, Oracle is case sensitive
for example.
Paths are usually case insensitive in Windows but Java is case sensitive so
there are situations where differences in case can be a problem.
Specifically, CFMX can generate a Wrong name error when calling a
It will only break on case-sensitive DBs like ORACLE. But even then you
can convert the strings to lowercase
WHERE LOWER(directory) = cfqueryparam cfsqltype=cf_sql_varchar
value=#Lcase(variables.CurrentDirectory)#
(or whatever the lowercase function is on the DB)
Pascal
PS As Barney and I
Bob Haroche wrote:
Even though the value of directory stored in the DB is
MyDirectory, the query works with the variable passed as
mydirectory. No problem, but I'm wondering if this is going to break
if I try it some day on another DB like MS SQL.
I would probably insert the data in upper
On Mon, 21 Jun 2004 21:20:41 +0200, Pascal Peters [EMAIL PROTECTED] wrote:
It will only break on case-sensitive DBs like ORACLE. But even then you
can convert the strings to lowercase
WHERE LOWER(directory) = cfqueryparam cfsqltype=cf_sql_varchar
value=#Lcase(variables.CurrentDirectory)#
Dave Carabetta wrote:
On Mon, 21 Jun 2004 21:20:41 +0200, Pascal Peters [EMAIL PROTECTED] wrote:
It will only break on case-sensitive DBs like ORACLE. But even then you
can convert the strings to lowercase
WHERE LOWER(directory) = cfqueryparam cfsqltype=cf_sql_varchar
7 matches
Mail list logo