Re: Insert question

2006-08-31 Thread Tom Chiverton
On Wednesday 30 August 2006 01:21, Crow T. Robot wrote:
> This may spark a huge debate, 

There's a debate needed :-)

-- 
Tom Chiverton
Helping to seamlessly maintain synergistic schemas



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.


~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251629
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Insert question

2006-08-29 Thread Crow T. Robot
This may spark a huge debate, but shouldn't you be using a seaprate
cross-join table for this?

On 8/29/06, Doug Brown <[EMAIL PROTECTED]> wrote:
>
> duuuh...Never mind!!! How bout using a different delimeter Doug
>
>
>
> - Original Message -
> From: "Doug Brown" <[EMAIL PROTECTED]>
> To: "CF-Talk" 
> Sent: Tuesday, August 29, 2006 5:37 PM
> Subject: Insert question
>
>
> > Sorry for the lame question...I am inserting a comma delimeted list and
> the list itself has commas seperating different items
> >
> >
> >
> > IE: cars,trucks & other vehicles, antiques, baby items,
> >
> > How do I insert the commas that seperate the names without sql thinking
> it
> is a seperate item for insert?
> >
> >
>
> 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251444
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Insert question

2006-08-29 Thread Doug Brown
duuuh...Never mind!!! How bout using a different delimeter Doug



- Original Message - 
From: "Doug Brown" <[EMAIL PROTECTED]>
To: "CF-Talk" 
Sent: Tuesday, August 29, 2006 5:37 PM
Subject: Insert question


> Sorry for the lame question...I am inserting a comma delimeted list and
the list itself has commas seperating different items
>
>
>
> IE: cars,trucks & other vehicles, antiques, baby items,
>
> How do I insert the commas that seperate the names without sql thinking it
is a seperate item for insert?
>
> 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251437
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: insert question

2001-11-16 Thread Jones, Becky

pascal,
this works great.  thank u.

-Original Message-
From: Pascal Peters [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 12:03 PM
To: CF-Talk
Subject: RE: insert question


I think your approach is a bit too simple. I don't know what your form
looks like, or what this test USERS NEQ "No Users" means, but it should
probably look like this.
===


SELECT  UserID, AppID
FROM qryAppToEmp2
WHERE UserID IN (#form.Users#)
AND AppID IN (#form.appID#)
ORDER BY UserID





  







INSERT INTO tblAppIAUsers
(   
AppID,
Listing_ID
)
VALUES
(
#p#,
#i#
)






Pascal Peters
Macromedia Certified Instructor
Certified ColdFusion (5.0) Advanced Developer
Certified Web Developer
LR Technologies, Belgium
Tel +32 2 639 68 70
Fax +32 2 639 68 99
Email   [EMAIL PROTECTED]
Web www.lrt.be



-Original Message-
From: Jones, Becky [mailto:[EMAIL PROTECTED]]
Sent: vrijdag 16 november 2001 14:29
To: CF-Talk
Subject: insert question


i have a list of users that you can choose from on a form to assign to
an
application(s).  
if the user is already assigned to a certain app however, i dont want
that
user to re-insert into the database. (infact, the dbase wont let that
happen
because of duplicate indexes) but if the second user isnt already
assigned
to the app...i do want him to insert.  but it doesnt seem to be working
out.
any ideas?
my qryPeople is this:


SELECT  *
FROM qryAppToEmp2
WHERE UserID IN (#form.Users#)
AND AppID IN (#form.appID#)


my insert:




INSERT INTO tblAppIAUsers
(   
AppID,
Listing_ID

)
VALUES
(

#p#,
#i#
)



 


*
This e-mail, including any attachments, is intended for the 
receipt and use by the intended addressee(s), and may contain 
confidential and privileged information.  If you are not an intended 
recipient of this e-mail, you are hereby notified that any unauthorized 
use or distribution of this e-mail is strictly prohibited. 



~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: insert question

2001-11-16 Thread Don Vawter

I would do this in a stored proc
I am not this is absolutely the most efficient but works well for me (this
is sql server)
You would then call stored proc each step of loop ove form list.
I actually have built some stored procs and functions for looping over lists
but for this application
probably just as simple to do the looping in cf.

HTH

Don


create procedure usp_update_app_listing

@appID int,  (or whatever types you are using)
@listing_id int

AS
DECLARE @foo int

set @foo=(select AppId from   tblAppIAUsers where appId = @appId and
listing_id = @listing_id )
IF @foo is null
insert into tblAppIAUsers
  (appId, listing_id)
VALUES (@appId,@listing_id)


- Original Message -
From: "Jones, Becky" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, November 16, 2001 6:28 AM
Subject: insert question


> i have a list of users that you can choose from on a form to assign to an
> application(s).
> if the user is already assigned to a certain app however, i dont want that
> user to re-insert into the database. (infact, the dbase wont let that
happen
> because of duplicate indexes) but if the second user isnt already assigned
> to the app...i do want him to insert.  but it doesnt seem to be working
out.
> any ideas?
> my qryPeople is this:
> 
> 
> SELECT *
> FROM qryAppToEmp2
> WHERE UserID IN (#form.Users#)
> AND AppID IN (#form.appID#)
> 
> 
> my insert:
>  qryPeople.UserID neq "No Users">
> 
> 
> 
> INSERT INTO tblAppIAUsers
> (
> AppID,
> Listing_ID
>
> )
> VALUES
> (
>
> #p#,
> #i#
> )
> 
> 
> 
> 
>
>
> *
> This e-mail, including any attachments, is intended for the
> receipt and use by the intended addressee(s), and may contain
> confidential and privileged information.  If you are not an intended
> recipient of this e-mail, you are hereby notified that any unauthorized
> use or distribution of this e-mail is strictly prohibited.
>
> 
~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: insert question

2001-11-16 Thread Craig Dudley

Something like this might help Becky, it will just skip the insert if a
corresponding record already exists.






BEGIN TRANSACTION

IF NOT EXISTS (select AppID from tblAppIAUsers where Listing_ID = #i# and
AppID = #p#)
BEGIN
INSERT INTO tblAppIAUsers
(AppID,Listing_ID)
VALUES
(#p#,#i#)
END

COMMIT TRANSACTION

 




Doing the loops inside the query/stored proc is beyond me atm, but it will
be possible with cursors if it's really necessary.

Cheers, Craig.


-Original Message-
From: Jones, Becky [mailto:[EMAIL PROTECTED]]
Sent: 16 November 2001 13:29
To: CF-Talk
Subject: insert question


i have a list of users that you can choose from on a form to assign to an
application(s).  
if the user is already assigned to a certain app however, i dont want that
user to re-insert into the database. (infact, the dbase wont let that happen
because of duplicate indexes) but if the second user isnt already assigned
to the app...i do want him to insert.  but it doesnt seem to be working out.
any ideas?
my qryPeople is this:


SELECT  *
FROM qryAppToEmp2
WHERE UserID IN (#form.Users#)
AND AppID IN (#form.appID#)


my insert:




INSERT INTO tblAppIAUsers
(   
AppID,
Listing_ID

)
VALUES
(

#p#,
#i#
)



 


*
This e-mail, including any attachments, is intended for the 
receipt and use by the intended addressee(s), and may contain 
confidential and privileged information.  If you are not an intended 
recipient of this e-mail, you are hereby notified that any unauthorized 
use or distribution of this e-mail is strictly prohibited. 


~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: insert question

2001-11-16 Thread Pascal Peters

I think your approach is a bit too simple. I don't know what your form
looks like, or what this test USERS NEQ "No Users" means, but it should
probably look like this.
===


SELECT  UserID, AppID
FROM qryAppToEmp2
WHERE UserID IN (#form.Users#)
AND AppID IN (#form.appID#)
ORDER BY UserID





  







INSERT INTO tblAppIAUsers
(   
AppID,
Listing_ID
)
VALUES
(
#p#,
#i#
)






Pascal Peters
Macromedia Certified Instructor
Certified ColdFusion (5.0) Advanced Developer
Certified Web Developer
LR Technologies, Belgium
Tel +32 2 639 68 70
Fax +32 2 639 68 99
Email   [EMAIL PROTECTED]
Web www.lrt.be



-Original Message-
From: Jones, Becky [mailto:[EMAIL PROTECTED]]
Sent: vrijdag 16 november 2001 14:29
To: CF-Talk
Subject: insert question


i have a list of users that you can choose from on a form to assign to
an
application(s).  
if the user is already assigned to a certain app however, i dont want
that
user to re-insert into the database. (infact, the dbase wont let that
happen
because of duplicate indexes) but if the second user isnt already
assigned
to the app...i do want him to insert.  but it doesnt seem to be working
out.
any ideas?
my qryPeople is this:


SELECT  *
FROM qryAppToEmp2
WHERE UserID IN (#form.Users#)
AND AppID IN (#form.appID#)


my insert:




INSERT INTO tblAppIAUsers
(   
AppID,
Listing_ID

)
VALUES
(

#p#,
#i#
)



 


*
This e-mail, including any attachments, is intended for the 
receipt and use by the intended addressee(s), and may contain 
confidential and privileged information.  If you are not an intended 
recipient of this e-mail, you are hereby notified that any unauthorized 
use or distribution of this e-mail is strictly prohibited. 


~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: insert question

2001-11-16 Thread Steven Lancaster

Since you are having CF do the processing and as long as Oracle is setup as
the DSN this should work fine. I have been dealing with Oracle for ten years
and it uses SQL just like SQL(database) does. I think you will find that
when you do things using CF instead of stored procedures it will go across
several platforms where if you use stored procedures it may not. One
advantage to not using stored procedures but there are many advantages to
using them.

 Steven Lancaster
 WebMaster
 Core Laboratories
 6316 Windfern
 Houston, TX 77040
 713-328-2532 (Office)
 713-328-2150 (Fax)
 832-259-3010 (Cell)
 mailto:[EMAIL PROTECTED]

 http://www.corelab.com



-Original Message-
From: Douglas L. Brown [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 10:45 AM
To: CF-Talk
Subject: Re: insert question


This is for sql, I am not real sure in regard to oracle. But the same logic.
I think the problem is really in the use of the  statements.



Doug


- Original Message -
From: "Yager, Brian T Contractor/NCCIM" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, November 16, 2001 8:29 AM
Subject: RE: insert question


> Doug,
>
> Is this for Oracle or SQL Server (or will it work for both)?
>
> Brian
>
> -Original Message-
> From: Douglas L. Brown [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 10:33 AM
> To: CF-Talk
> Subject: Re: insert question
>
>
> It looks just like my create user account, take a look and hope it helps.
>
>  
>   SELECT  email,
> password
>   FROM cust_contacts
>   WHERE email = '#email#'
>   AND  password = '#password#'
>  
>
>  
>
> 
>  
>
>
> 
>
> 
>   
>DECLARE @maxid int
>BEGIN
>SELECT  @maxid = MAX(ID)
>FROM   cust_contacts
>IF@maxid IS NULL
>SELECT   @maxid = 1
>ELSE
>SELECT   @maxid = @maxid + 1
>END
>
> INSERT INTO cust_contacts
> VALUES  ( '#custNum#',
>  @maxid,
>'#f_name#',
>'#l_name#',
>'#email#',
>'#password#' )
>   
>  
>  
>
>
>
> Doug
>
>
> - Original Message -
> From: "Jones, Becky" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Friday, November 16, 2001 5:28 AM
> Subject: insert question
>
>
> > i have a list of users that you can choose from on a form to assign to
an
> > application(s).
> > if the user is already assigned to a certain app however, i dont want
that
> > user to re-insert into the database. (infact, the dbase wont let that
> happen
> > because of duplicate indexes) but if the second user isnt already
assigned
> > to the app...i do want him to insert.  but it doesnt seem to be working
> out.
> > any ideas?
> > my qryPeople is this:
> > 
> > 
> > SELECT *
> > FROM qryAppToEmp2
> > WHERE UserID IN (#form.Users#)
> > AND AppID IN (#form.appID#)
> > 
> > 
> > my insert:
> >  > qryPeople.UserID neq "No Users">
> > 
> > 
> > 
> > INSERT INTO tblAppIAUsers
> > (
> > AppID,
> > Listing_ID
> >
> > )
> > VALUES
> > (
> >
> > #p#,
> > #i#
> > )
> > 
> > 
> > 
> > 
> >
> >
> > *
> > This e-mail, including any attachments, is intended for the
> > receipt and use by the intended addressee(s), and may contain
> > confidential and privileged information.  If you are not an intended
> > recipient of this e-mail, you are hereby notified that any unauthorized
> > use or distribution of this e-mail is strictly prohibited.
> >
> >
>
> 

~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: insert question

2001-11-16 Thread Jones, Becky

this looks like it is for one user at a time.  
i want to be able to deal with multiple users and insert only the ones that
arent already in the database.  

-Original Message-
From: Douglas L. Brown [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 11:33 AM
To: CF-Talk
Subject: Re: insert question


It looks just like my create user account, take a look and hope it helps.

 
  SELECT  email,
password
  FROM cust_contacts
  WHERE email = '#email#'
  AND  password = '#password#'
 

 


 
   




  
   DECLARE @maxid int
   BEGIN
   SELECT  @maxid = MAX(ID)
   FROM   cust_contacts
   IF@maxid IS NULL
   SELECT   @maxid = 1
   ELSE
   SELECT   @maxid = @maxid + 1
   END

INSERT INTO cust_contacts
VALUES  ( '#custNum#',
 @maxid,
   '#f_name#',
   '#l_name#',
   '#email#',
   '#password#' )
  
 
 



Doug


- Original Message -
From: "Jones, Becky" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, November 16, 2001 5:28 AM
Subject: insert question


> i have a list of users that you can choose from on a form to assign to an
> application(s).
> if the user is already assigned to a certain app however, i dont want that
> user to re-insert into the database. (infact, the dbase wont let that
happen
> because of duplicate indexes) but if the second user isnt already assigned
> to the app...i do want him to insert.  but it doesnt seem to be working
out.
> any ideas?
> my qryPeople is this:
> 
> 
> SELECT *
> FROM qryAppToEmp2
> WHERE UserID IN (#form.Users#)
> AND AppID IN (#form.appID#)
> 
> 
> my insert:
>  qryPeople.UserID neq "No Users">
> 
> 
> 
> INSERT INTO tblAppIAUsers
> (
> AppID,
> Listing_ID
>
> )
> VALUES
> (
>
> #p#,
> #i#
> )
> 
> 
> 
> 
>
>
> *
> This e-mail, including any attachments, is intended for the
> receipt and use by the intended addressee(s), and may contain
> confidential and privileged information.  If you are not an intended
> recipient of this e-mail, you are hereby notified that any unauthorized
> use or distribution of this e-mail is strictly prohibited.
>
> 

~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: insert question

2001-11-16 Thread Douglas L. Brown

This is for sql, I am not real sure in regard to oracle. But the same logic.
I think the problem is really in the use of the  statements.



Doug


- Original Message -
From: "Yager, Brian T Contractor/NCCIM" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, November 16, 2001 8:29 AM
Subject: RE: insert question


> Doug,
>
> Is this for Oracle or SQL Server (or will it work for both)?
>
> Brian
>
> -Original Message-
> From: Douglas L. Brown [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 10:33 AM
> To: CF-Talk
> Subject: Re: insert question
>
>
> It looks just like my create user account, take a look and hope it helps.
>
>  
>   SELECT  email,
> password
>   FROM cust_contacts
>   WHERE email = '#email#'
>   AND  password = '#password#'
>  
>
>  
>
> 
>  
>
>
> 
>
> 
>   
>DECLARE @maxid int
>BEGIN
>SELECT  @maxid = MAX(ID)
>FROM   cust_contacts
>IF@maxid IS NULL
>SELECT   @maxid = 1
>ELSE
>SELECT   @maxid = @maxid + 1
>END
>
> INSERT INTO cust_contacts
> VALUES  ( '#custNum#',
>  @maxid,
>'#f_name#',
>'#l_name#',
>'#email#',
>'#password#' )
>   
>  
>  
>
>
>
> Doug
>
>
> - Original Message -
> From: "Jones, Becky" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Friday, November 16, 2001 5:28 AM
> Subject: insert question
>
>
> > i have a list of users that you can choose from on a form to assign to
an
> > application(s).
> > if the user is already assigned to a certain app however, i dont want
that
> > user to re-insert into the database. (infact, the dbase wont let that
> happen
> > because of duplicate indexes) but if the second user isnt already
assigned
> > to the app...i do want him to insert.  but it doesnt seem to be working
> out.
> > any ideas?
> > my qryPeople is this:
> > 
> > 
> > SELECT *
> > FROM qryAppToEmp2
> > WHERE UserID IN (#form.Users#)
> > AND AppID IN (#form.appID#)
> > 
> > 
> > my insert:
> >  > qryPeople.UserID neq "No Users">
> > 
> > 
> > 
> > INSERT INTO tblAppIAUsers
> > (
> > AppID,
> > Listing_ID
> >
> > )
> > VALUES
> > (
> >
> > #p#,
> > #i#
> > )
> > 
> > 
> > 
> > 
> >
> >
> > *
> > This e-mail, including any attachments, is intended for the
> > receipt and use by the intended addressee(s), and may contain
> > confidential and privileged information.  If you are not an intended
> > recipient of this e-mail, you are hereby notified that any unauthorized
> > use or distribution of this e-mail is strictly prohibited.
> >
> >
>
> 
~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: insert question

2001-11-16 Thread Yager, Brian T Contractor/NCCIM

Doug,

Is this for Oracle or SQL Server (or will it work for both)?

Brian

-Original Message-
From: Douglas L. Brown [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 10:33 AM
To: CF-Talk
Subject: Re: insert question


It looks just like my create user account, take a look and hope it helps.

 
  SELECT  email,
password
  FROM cust_contacts
  WHERE email = '#email#'
  AND  password = '#password#'
 

 


 
   




  
   DECLARE @maxid int
   BEGIN
   SELECT  @maxid = MAX(ID)
   FROM   cust_contacts
   IF@maxid IS NULL
   SELECT   @maxid = 1
   ELSE
   SELECT   @maxid = @maxid + 1
   END

INSERT INTO cust_contacts
VALUES  ( '#custNum#',
 @maxid,
   '#f_name#',
   '#l_name#',
   '#email#',
   '#password#' )
  
 
 



Doug


- Original Message -
From: "Jones, Becky" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, November 16, 2001 5:28 AM
Subject: insert question


> i have a list of users that you can choose from on a form to assign to an
> application(s).
> if the user is already assigned to a certain app however, i dont want that
> user to re-insert into the database. (infact, the dbase wont let that
happen
> because of duplicate indexes) but if the second user isnt already assigned
> to the app...i do want him to insert.  but it doesnt seem to be working
out.
> any ideas?
> my qryPeople is this:
> 
> 
> SELECT *
> FROM qryAppToEmp2
> WHERE UserID IN (#form.Users#)
> AND AppID IN (#form.appID#)
> 
> 
> my insert:
>  qryPeople.UserID neq "No Users">
> 
> 
> 
> INSERT INTO tblAppIAUsers
> (
> AppID,
> Listing_ID
>
> )
> VALUES
> (
>
> #p#,
> #i#
> )
> 
> 
> 
> 
>
>
> *
> This e-mail, including any attachments, is intended for the
> receipt and use by the intended addressee(s), and may contain
> confidential and privileged information.  If you are not an intended
> recipient of this e-mail, you are hereby notified that any unauthorized
> use or distribution of this e-mail is strictly prohibited.
>
> 

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: insert question

2001-11-16 Thread Douglas L. Brown

It looks just like my create user account, take a look and hope it helps.

 
  SELECT  email,
password
  FROM cust_contacts
  WHERE email = '#email#'
  AND  password = '#password#'
 

 


 
   




  
   DECLARE @maxid int
   BEGIN
   SELECT  @maxid = MAX(ID)
   FROM   cust_contacts
   IF@maxid IS NULL
   SELECT   @maxid = 1
   ELSE
   SELECT   @maxid = @maxid + 1
   END

INSERT INTO cust_contacts
VALUES  ( '#custNum#',
 @maxid,
   '#f_name#',
   '#l_name#',
   '#email#',
   '#password#' )
  
 
 



Doug


- Original Message -
From: "Jones, Becky" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, November 16, 2001 5:28 AM
Subject: insert question


> i have a list of users that you can choose from on a form to assign to an
> application(s).
> if the user is already assigned to a certain app however, i dont want that
> user to re-insert into the database. (infact, the dbase wont let that
happen
> because of duplicate indexes) but if the second user isnt already assigned
> to the app...i do want him to insert.  but it doesnt seem to be working
out.
> any ideas?
> my qryPeople is this:
> 
> 
> SELECT *
> FROM qryAppToEmp2
> WHERE UserID IN (#form.Users#)
> AND AppID IN (#form.appID#)
> 
> 
> my insert:
>  qryPeople.UserID neq "No Users">
> 
> 
> 
> INSERT INTO tblAppIAUsers
> (
> AppID,
> Listing_ID
>
> )
> VALUES
> (
>
> #p#,
> #i#
> )
> 
> 
> 
> 
>
>
> *
> This e-mail, including any attachments, is intended for the
> receipt and use by the intended addressee(s), and may contain
> confidential and privileged information.  If you are not an intended
> recipient of this e-mail, you are hereby notified that any unauthorized
> use or distribution of this e-mail is strictly prohibited.
>
> 
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: insert question

2001-11-16 Thread Jones, Becky

it will overlook user a (he is already in the dbase) but it wont insert user
b (he is not in dbase and should get put in)

-Original Message-
From: Christopher Olive [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 10:00 AM
To: CF-Talk
Subject: RE: insert question


are you getting an error?  is the user just not getting inserted?

christopher olive, cto, vp of web development
cresco technologies, inc
410.825.0383
http://www.crescotech.com


-Original Message-
From: Jones, Becky [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 8:29 AM
To: CF-Talk
Subject: insert question


i have a list of users that you can choose from on a form to assign to
an
application(s).  
if the user is already assigned to a certain app however, i dont want
that
user to re-insert into the database. (infact, the dbase wont let that
happen
because of duplicate indexes) but if the second user isnt already
assigned
to the app...i do want him to insert.  but it doesnt seem to be working
out.
any ideas?
my qryPeople is this:


SELECT  *
FROM qryAppToEmp2
WHERE UserID IN (#form.Users#)
AND AppID IN (#form.appID#)


my insert:




INSERT INTO tblAppIAUsers
(   
AppID,
Listing_ID

)
VALUES
(

#p#,
#i#
)



 


*
This e-mail, including any attachments, is intended for the 
receipt and use by the intended addressee(s), and may contain 
confidential and privileged information.  If you are not an intended 
recipient of this e-mail, you are hereby notified that any unauthorized 
use or distribution of this e-mail is strictly prohibited. 



~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: insert question

2001-11-16 Thread Christopher Olive

are you getting an error?  is the user just not getting inserted?

christopher olive, cto, vp of web development
cresco technologies, inc
410.825.0383
http://www.crescotech.com


-Original Message-
From: Jones, Becky [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 8:29 AM
To: CF-Talk
Subject: insert question


i have a list of users that you can choose from on a form to assign to
an
application(s).  
if the user is already assigned to a certain app however, i dont want
that
user to re-insert into the database. (infact, the dbase wont let that
happen
because of duplicate indexes) but if the second user isnt already
assigned
to the app...i do want him to insert.  but it doesnt seem to be working
out.
any ideas?
my qryPeople is this:


SELECT  *
FROM qryAppToEmp2
WHERE UserID IN (#form.Users#)
AND AppID IN (#form.appID#)


my insert:




INSERT INTO tblAppIAUsers
(   
AppID,
Listing_ID

)
VALUES
(

#p#,
#i#
)



 


*
This e-mail, including any attachments, is intended for the 
receipt and use by the intended addressee(s), and may contain 
confidential and privileged information.  If you are not an intended 
recipient of this e-mail, you are hereby notified that any unauthorized 
use or distribution of this e-mail is strictly prohibited. 


~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists