Click here to Skip to main content
15,895,709 members
Home / Discussions / Database
   

Database

 
Generalraising event from SQL-Server to C# Pin
TehMedic29-Nov-04 21:07
TehMedic29-Nov-04 21:07 
GeneralRe: raising event from SQL-Server to C# Pin
Colin Angus Mackay30-Nov-04 5:30
Colin Angus Mackay30-Nov-04 5:30 
GeneralADO connection to NT Personal Oracle Pin
Member 155378429-Nov-04 18:13
Member 155378429-Nov-04 18:13 
GeneralRecord is killed after UPDATE Pin
realmontanakid29-Nov-04 11:04
realmontanakid29-Nov-04 11:04 
GeneralRe: Record is killed after UPDATE Pin
realmontanakid29-Nov-04 20:43
realmontanakid29-Nov-04 20:43 
GeneralCopy rows from one table from another Pin
Luis Alonso Ramos29-Nov-04 9:23
Luis Alonso Ramos29-Nov-04 9:23 
GeneralRe: Copy rows from one table from another Pin
Edbert P29-Nov-04 10:56
Edbert P29-Nov-04 10:56 
GeneralRe: Copy rows from one table from another Pin
Luis Alonso Ramos29-Nov-04 11:22
Luis Alonso Ramos29-Nov-04 11:22 
Thanks for your reply.

I use SELECT to get the quote info (customer information and employee) into local variables and then I insert those into my Orders table.

My QuoteItems table has several fields (ID_item (identity PK), ID_quote, Description) and my Items table has those fields plus others (ID_item (identity PK, different from QuoteItems'), ID_order (newly created order), Description, Produced (must be set to false on record insertion)).

I can create the new Orders record based on my Quotes record. Then I need to select all records from QuoteItems with a specific ID_quote and insert corresponing records into the Items table, copying some fields, and setting others to an arbitrary value (like the ID_order field).

I remember seeing a query like this:
UPDATE Items SET Field=value WHERE id_item IN (SELECT id_item FROM Orders WHERE ID_order=1);
I don't know the exact syntax, and whether I could apply it here, but I would believe my answer would somewhere close to that.

I hope I have explained myself better. Thanks for your help,

-- LuisR




Luis Alonso Ramos
Intelectix - Chihuahua, Mexico

Not much here: My CP Blog!

GeneralRe: Copy rows from one table from another Pin
Luis Alonso Ramos30-Nov-04 8:14
Luis Alonso Ramos30-Nov-04 8:14 
GeneralRe: Copy rows from one table from another Pin
Edbert P30-Nov-04 10:49
Edbert P30-Nov-04 10:49 
GeneralRe: Copy rows from one table from another Pin
Luis Alonso Ramos30-Nov-04 13:25
Luis Alonso Ramos30-Nov-04 13:25 
GeneralRe: Copy rows from one table from another Pin
Edbert P30-Nov-04 15:11
Edbert P30-Nov-04 15:11 
GeneralRe: Copy rows from one table from another Pin
Luis Alonso Ramos30-Nov-04 15:23
Luis Alonso Ramos30-Nov-04 15:23 
GeneralSQL statement help Pin
ruifernandes2429-Nov-04 7:29
ruifernandes2429-Nov-04 7:29 
GeneralRe: SQL statement help Pin
Gerald Schwab29-Nov-04 7:58
Gerald Schwab29-Nov-04 7:58 
GeneralDataSet 2 Xml - element order problem Pin
Xabatcha29-Nov-04 3:18
Xabatcha29-Nov-04 3:18 
QuestionOREIGN KEY REFERENCES? Pin
HahnTech28-Nov-04 12:42
HahnTech28-Nov-04 12:42 
AnswerRe: OREIGN KEY REFERENCES? Pin
Christian Graus28-Nov-04 13:46
protectorChristian Graus28-Nov-04 13:46 
GeneralRe: OREIGN KEY REFERENCES? Pin
HahnTech28-Nov-04 14:54
HahnTech28-Nov-04 14:54 
GeneralRe: OREIGN KEY REFERENCES? Pin
Christian Graus28-Nov-04 18:13
protectorChristian Graus28-Nov-04 18:13 
GeneralRe: OREIGN KEY REFERENCES? Pin
Edbert P28-Nov-04 18:44
Edbert P28-Nov-04 18:44 
GeneralRe: OREIGN KEY REFERENCES? Pin
HahnTech28-Nov-04 23:23
HahnTech28-Nov-04 23:23 
AnswerRe: OREIGN KEY REFERENCES? Pin
Mike Dimmick29-Nov-04 1:00
Mike Dimmick29-Nov-04 1:00 
GeneralRe: OREIGN KEY REFERENCES? Pin
HahnTech29-Nov-04 12:00
HahnTech29-Nov-04 12:00 
AnswerRe: OREIGN KEY REFERENCES? Pin
Chris Meech29-Nov-04 7:16
Chris Meech29-Nov-04 7:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.