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.
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
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
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,
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:
.
-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
: 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
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
:[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
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
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
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
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
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.
~|
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
?
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
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
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
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
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,
#,
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
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
=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
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#
.
-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
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
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
?
-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
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
]
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
, 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
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
#,
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
?
-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
-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
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
]
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
]
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
[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
.
-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
, 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
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
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.
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
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
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
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
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,
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
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
50 matches
Mail list logo