DTP


 
Lively discussions on the graphic arts and publishing — in print or on the web


Go Back   Desktop Publishing Forum > General Discussions > Web Site Building & Maintenance

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 03-09-2007, 03:10 AM   #3
CarlSeiler
Member
 
CarlSeiler's Avatar
 
Join Date: Oct 2005
Location: Denton, TX
Posts: 271
Default

(BTW, using MS SQL Server here, but may be moving to MySQL or PostGreSQL later)

OK, I was trying to do this all in one query, avoiding variables. But I could do something like this with variables.

Code:
 DECLARE @custactvar int;
SELECT @custactvar = custactions.custact_id WHERE cust_id = 2; 
/* I already know "2" from a previous query, but I could have a variable here */
INSERT INTO warrants (warrant_id, custact_id) VALUES
  (103,@custactvar);
/* Instead of 103, I use a variable or some function that determines next 
counter in the warrants table. I'm assuming there's a built-in function, but
 I don't know it yet. */
Am I more on track?

Anyway, with regard to duplicate cust_id's in the custactions table, yes indeed, I know that's a problem that needs to be considered, and I specifically put that kink in there since I noticed it. What I need to do is have some sort of error handling that will allow the user to either select which custaction record they want. Right now, I'm lucky in that Mary only has one entry in custactions. Down the road, I may not be so lucky.
CarlSeiler is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Needed: someone to manage a Simple Machines Forum mksf Web Site Building & Maintenance 13 04-05-2007 06:02 AM
Quark Xpress Tutor Needed Ash Mansukhani Print Design 2 10-24-2006 11:47 AM
Redesign Suggestions Needed BobRoosth Web Design 11 01-09-2006 08:57 AM
Word vs Acrobat guru needed!! ktinkel Print Production & Automation 7 05-13-2005 08:51 AM
RGB-CMYK Tutorial Needed BobRoosth Print Production & Automation 15 02-28-2005 06:44 PM


All times are GMT -8. The time now is 01:59 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Contents copyright 2004–2014 Desktop Publishing Forum and its members.