Re: What's wrong with this query?

2008-05-17 Thread Claude Schneegans
So image name conflict won't be a problem. I see, then checking in the query is your solution. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks.

What's wrong with this query?

2008-05-16 Thread Rick Faircloth
I don't remember ever running a query like this one, so I'm not sure it's even a valid approach. But, should this run? Or do I need to run a separate query to the existing photo_filenames from hmls_photos to use as a variable? cfquery name=insert_photo datasource=c21ar

Re: What's wrong with this query?

2008-05-16 Thread Aaron Rouse
When I have done this, I used a NOT EXISTS, so something like this random example I just pulled from Google: http://archives.postgresql.org/pgsql-general/2003-06/msg01683.php On Fri, May 16, 2008 at 9:40 AM, Rick Faircloth [EMAIL PROTECTED] wrote: I don't remember ever running a query like

Re: What's wrong with this query?

2008-05-16 Thread Kris Jones
I think you'd need hash-marks (string delimiters) around photolist.name in the where clause, right? where '#photolist.name#' not in (select photo_filename from htmls_photos) -KJ I don't remember ever running a query like this one, so I'm not sure it's even a valid approach. But,

Re: What's wrong with this query?

2008-05-16 Thread Didgiman
You could always create a unique index on the photo_filename column. Wim. On Fri, May 16, 2008 at 4:57 PM, Aaron Rouse [EMAIL PROTECTED] wrote: When I have done this, I used a NOT EXISTS, so something like this random example I just pulled from Google:

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
. -Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 10:58 AM To: CF-Talk Subject: Re: What's wrong with this query? When I have done this, I used a NOT EXISTS, so something like this random example I just pulled from Google: http

Re: What's wrong with this query?

2008-05-16 Thread Aaron Rouse
: Friday, May 16, 2008 10:58 AM To: CF-Talk Subject: Re: What's wrong with this query? When I have done this, I used a NOT EXISTS, so something like this random example I just pulled from Google: http://archives.postgresql.org/pgsql-general/2003-06/msg01683.php

Re: What's wrong with this query?

2008-05-16 Thread Claude Schneegans
I don't remember ever running a query like this one, so I'm not sure it's even a valid approach. My approach is to rename every file using CreateUUID Functions53.html#1102827() function. to make sure there is no duplicate problem. -- ___ REUSE CODE! Use

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 11:01 AM To: CF-Talk Subject: Re: What's wrong with this query? I think you'd need hash-marks (string delimiters) around photolist.name in the where clause, right? where '#photolist.name#' not in (select photo_filename from htmls_photos

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
for duplicates and reject them? ??? Rick -Original Message- From: Didgiman [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 11:04 AM To: CF-Talk Subject: Re: What's wrong with this query? You could always create a unique index on the photo_filename column. Wim. On Fri, May 16

RE: What's wrong with this query?

2008-05-16 Thread Dave Watts
Not being so well-versed in indexing (just starting using those in MySQL 5), I don't understand how having a unique index on the photo_filename column will prevent an insert of a duplicate value. Is that function a part of creating a unique index? Does it cause MySQL 5 to screen

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
Sorry for not stating the db... it's MySQL 5. -Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 11:08 AM To: CF-Talk Subject: Re: What's wrong with this query? Rick, I do not know what database you are using but your posted example

Re: What's wrong with this query?

2008-05-16 Thread Qasim Rasheed
index? Does it cause MySQL 5 to screen inserts for duplicates and reject them? ??? Rick -Original Message- From: Didgiman [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 11:04 AM To: CF-Talk Subject: Re: What's wrong with this query? You could always create a unique

Re: What's wrong with this query?

2008-05-16 Thread Wim Lemmens
I'm not that familiar with MySQL, but by definition (on Oracle at least) a unique index will reject any query that tries to insert a duplicate value and throws an error. You can catch that error in your application. Wim. ~|

Re: What's wrong with this query?

2008-05-16 Thread Azadi Saryev
mysql has an extremely useful extension to standard sql: ON DUPLICATE KEY UPDATE ... check out mysql ref manual for details - it sounds like what you may want to use... Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Rick Faircloth wrote: Tried that at the same time I put the where

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
? pseudocode and if you find a duplicate value, just skip it, and go on to the next value /pseudocode -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 11:19 AM To: CF-Talk Subject: RE: What's wrong with this query? Not being so

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
16, 2008 11:10 AM To: CF-Talk Subject: Re: What's wrong with this query? I don't remember ever running a query like this one, so I'm not sure it's even a valid approach. My approach is to rename every file using CreateUUID Functions53.html#1102827() function. to make sure

Re: What's wrong with this query?

2008-05-16 Thread Aaron Rouse
a duplicate value, just skip it, and go on to the next value /pseudocode -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 11:19 AM To: CF-Talk Subject: RE: What's wrong with this query? Not being so well-versed in indexing (just starting

Re: What's wrong with this query?

2008-05-16 Thread Qasim Rasheed
PROTECTED] Sent: Friday, May 16, 2008 11:04 AM To: CF-Talk Subject: Re: What's wrong with this query? You could always create a unique index on the photo_filename column. Wim. On Fri, May 16, 2008 at 4:57 PM, Aaron Rouse [EMAIL PROTECTED] wrote: When I have done this, I used

Re: What's wrong with this query?

2008-05-16 Thread Wim Lemmens
cftry cfquery datasource=#request.yourDsn# insert into hmls_photos (photo_filename, photo_mls_number) values (cfqueryparam cfsqltype=cf_sql_varchar value=#photolist.name#, cfqueryparam cfsqltype=cf_sql_varchar value=#listfirst(photolist.name,

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
#, cfqueryparam cfsqltype=cf_sql_varchar value=#listfirst(photolist.name, '_')#) -Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 11:33 AM To: CF-Talk Subject: Re: What's wrong with this query? Looks like the process for MySQL is very similar

Re: What's wrong with this query?

2008-05-16 Thread Kris Jones
PROTECTED] Sent: Friday, May 16, 2008 11:33 AM To: CF-Talk Subject: Re: What's wrong with this query? Looks like the process for MySQL is very similar to the Oracle one I posted a link to earlier and someone else wrote an example of. http://forums.macrumors.com/showthread.php?t=403320

Re: What's wrong with this query?

2008-05-16 Thread Aaron Rouse
=cf_sql_varchar value=# photolist.name#, cfqueryparam cfsqltype=cf_sql_varchar value=#listfirst( photolist.name, '_')#) -Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 11:33 AM To: CF-Talk Subject: Re: What's wrong

Re: What's wrong with this query?

2008-05-16 Thread Claude Schneegans
Can you be a little more explicit about how you do that, Claude? I've never used CreateUUID before. I rename the file when it is uploaded. Ie: CFSET fileName = #CreateUUID()#.temp CFIF fileUpload NEQ !--- File received --- CFFILE ACTION=Upload FILEFIELD=#fileUpload#

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
. -Original Message- From: Wim Lemmens [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 11:41 AM To: CF-Talk Subject: Re: What's wrong with this query? cftry cfquery datasource=#request.yourDsn# insert into hmls_photos (photo_filename, photo_mls_number

Re: What's wrong with this query?

2008-05-16 Thread Richard Dillman
Wouldnt you put an IF at the begining of the statement? cfquery name=insert_photo datasource=c21ar IF NOT EXISTS (SELECT PHOTO_FILENAME FROM HMLS_PHOTOS WHERE PHOTO_FILENAME = cfqueryparam cfsqltype=cf_sql_varchar value=#photolist.name#) INSERT INTO HMLS_PHOTOS

Re: What's wrong with this query?

2008-05-16 Thread Claude Schneegans
So how do I modify the query, which now looks like this... This is it, a unique index will detect the error, but it will not solve it. Checking if the file already exists will not solve the problem either. So better make sure the file name is unique first and eliminate the possibility of a

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
? -Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 12:02 PM To: CF-Talk Subject: Re: What's wrong with this query? Your attempt though does not match the syntax used in the link I provided. It is failing because of the SQL after your WHERE EXISTS. Also

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
Thanks for the explanation and code, Claude! -Original Message- From: Claude Schneegans [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 12:03 PM To: CF-Talk Subject: Re: What's wrong with this query? Can you be a little more explicit about how you do that, Claude? I've

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
] Sent: Friday, May 16, 2008 12:06 PM To: CF-Talk Subject: Re: What's wrong with this query? So how do I modify the query, which now looks like this... This is it, a unique index will detect the error, but it will not solve it. Checking if the file already exists will not solve the problem

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
, May 16, 2008 12:05 PM To: CF-Talk Subject: Re: What's wrong with this query? Wouldnt you put an IF at the begining of the statement? cfquery name=insert_photo datasource=c21ar IF NOT EXISTS (SELECT PHOTO_FILENAME FROM HMLS_PHOTOS WHERE PHOTO_FILENAME

Re: What's wrong with this query?

2008-05-16 Thread Aaron Rouse
Subject: Re: What's wrong with this query? Your attempt though does not match the syntax used in the link I provided. It is failing because of the SQL after your WHERE EXISTS. Also your SELECT should be pulling out the two values you want to insert into the table, just like how

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
#, cfqueryparam cfsqltype=cf_sql_varchar value=#listfirst(photolist.name, '_')#) Am I still missing something? -Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 12:43 PM To: CF-Talk Subject: Re: What's wrong with this query? You

Re: What's wrong with this query?

2008-05-16 Thread Aaron Rouse
? -Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 12:43 PM To: CF-Talk Subject: Re: What's wrong with this query? You want to insert values into two columns, photo_filename and photo_mls_number, but you are only selecting out one value and on top

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
-Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 1:26 PM To: CF-Talk Subject: Re: What's wrong with this query? Yes you are, you added code to what I put in my last email. Why do you have the VALUES part on there? The SELECT from dual is handling

Re: What's wrong with this query?

2008-05-16 Thread Claude Schneegans
I don't want to rename the files and include them, I want to avoid adding the files to the directory completely. I see, but what if two users want to enter two different images having the same file name? -- ___ REUSE CODE! Use custom tags; See

RE: What's wrong with this query?

2008-05-16 Thread Rick Faircloth
] Sent: Friday, May 16, 2008 2:12 PM To: CF-Talk Subject: Re: What's wrong with this query? I don't want to rename the files and include them, I want to avoid adding the files to the directory completely. I see, but what if two users want to enter two different images having the same file

RE: WHAT'S WRONG WITH THIS QUERY?

2005-10-20 Thread Andy Matthews
] Sent: Wednesday, October 19, 2005 6:04 PM To: CF-Talk Subject: WHAT'S WRONG WITH THIS QUERY? Hello, This query works fine with Access. With SQL server it creates an error. Here's the query: UPDATE NewProduct INNER JOIN OldProduct ON NewProduct.dealerpartno = OldProduct.dealerpartno SET

RE: WHAT'S WRONG WITH THIS QUERY?

2005-10-20 Thread Kerry
[mailto:[EMAIL PROTECTED] Sent: Wednesday, October 19, 2005 6:04 PM To: CF-Talk Subject: WHAT'S WRONG WITH THIS QUERY? Hello, This query works fine with Access. With SQL server it creates an error. Here's the query: UPDATE NewProduct INNER JOIN OldProduct ON NewProduct.dealerpartno

RE: WHAT'S WRONG WITH THIS QUERY?

2005-10-20 Thread Andy McShane
. -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: 20 October 2005 14:17 To: CF-Talk Subject: RE: WHAT'S WRONG WITH THIS QUERY? I was always under the impression that you couldn't join tables in anything other than a SELECT query. !//-- andy matthews web

RE: WHAT'S WRONG WITH THIS QUERY?

2005-10-20 Thread Dawson, Michael
, October 20, 2005 8:17 AM To: CF-Talk Subject: RE: WHAT'S WRONG WITH THIS QUERY? I was always under the impression that you couldn't join tables in anything other than a SELECT query. !//-- andy matthews web developer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737

WHAT'S WRONG WITH THIS QUERY?

2005-10-19 Thread Nomad
Hello, This query works fine with Access. With SQL server it creates an error. Here's the query: UPDATE NewProduct INNER JOIN OldProduct ON NewProduct.dealerpartno = OldProduct.dealerpartno SET NewProduct.details = OldProduct.details Much appreciate any help in debuging. Thanks in

Re: WHAT'S WRONG WITH THIS QUERY?

2005-10-19 Thread Barney Boisvert
Did you try this (or something like it)? update newproduct set details = (select details from oldproduct where dealerpartno = newproduct.dealerpartno) cheers, barneyb On 10/19/05, Nomad [EMAIL PROTECTED] wrote: Hello, This query works fine with Access. With SQL server it creates an error.

Re: WHAT'S WRONG WITH THIS QUERY?

2005-10-19 Thread Nomad
Thanks Barney, This one works. But wonder why the other one doesn't. Thought it would be good to know. Ben - Original Message - From: Barney Boisvert [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Thursday, October 20, 2005 12:22 PM Subject: Re: WHAT'S WRONG

Re: WHAT'S WRONG WITH THIS QUERY?

2005-10-19 Thread Barney Boisvert
I don't belive multi-table UPDATE statements are a standard SQL feature. I'm kind of surprised that Access supports them. Subqueries (subselects), on the other hand, are a standard feature. cheers, barneyb On 10/19/05, Nomad [EMAIL PROTECTED] wrote: Thanks Barney, This one works. But

What's wrong with this query?

2001-02-16 Thread Terri Stocke
Okay, I give up. Can someone take a peek at this query and tell me what's wrong? I keep getting an Oracle error, "Invalid column name". If I take the line out "AND TO_CHAR(SUG_SUGGESTIONS.STATUS_DATE, 'DD-MON-YY') = #variables.comparisondate#" I have no problems. Oh, curse

Re: What's wrong with this query?

2001-02-16 Thread Ryan
Doesn't #variables.comparisondate# need to be quoted? I think it might be trying to find a field called 16-Feb-01. Ryan At 14:26 2/16/01 -, you wrote: Okay, I give up. Can someone take a peek at this query and tell me what's wrong? I keep getting an Oracle error, "Invalid column

RE: What's wrong with this query?

2001-02-16 Thread John Stanley
Dont you need quotes around the comparison date ? And is "MON" a valid month argument ? cfset comparisondate = #dateformat(now() - 7, 'DD-MMM-YY')# cfquery name="accepted_ideas" datasource="CF_3IS" SELECT SUG_SUGGESTIONS.SUGGESTION_ID, SUG_SUGGESTIONS.SUGGESTION_NAME,

RE: What's wrong with this query?

2001-02-16 Thread Peter J. MacDonald
x123 Fax: 401.727.4998 Portable: 401.965.3661 E-MAIL: [EMAIL PROTECTED] Web Page: www.creatcomp.com -Original Message- From: Terri Stocke [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 09:27 To: CF-Talk Subject: What's wrong with this query? Okay, I give up. Can someone take

Re: What's wrong with this query?

2001-02-16 Thread Terri Stocke
Ryan, You da man. Thanks! ;) Terri Original Message Follows From: Ryan [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Subject: Re: What's wrong with this query? Date: Fri, 16 Feb 2001 08:38:08 -0600 Doesn't #variables.comparisondate# need to be quoted? I