🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #11147

Simple SQL question (I guess)

#11147
From: Sergio Gonzalez
Date: Tue, 03 Dec 2002 18:05
35 lines
1947 bytes
hello there! I'm a very begginer in SQL and have this problem.
Just in case: I'm using IB 6.5 with Delphi 7
Sorry if this message is too large. And sorry for my English!

I have these tables
1) ITEMS (id, description)
2) TCOST (tcost_id, description)
2) COST (id, tcost_id, percent) (id is FK to ITEMS and tcost_id is FK to
TCOST)

ie:

ITEMS
1        SCREW
2        HAMMER

TCOST
1        TAX
2        SHIPPING

COST
1    1    nnn%
1    2    nnn%
2    1    nnn%
2    2    nnn%

Each time I insert a record in TCOST, I need to insert one record per each
row being in ITEM in the table COST.

Can I do that with a simple SQL instruction? How can I do it?
I supose that I should write a trigger in TCOST (after insert)

THanks.

Sergio.
Technical Details
Message-ID: <3decf30f@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!sn-xit-08!supernews.com!38.144.126.76.MISMATCH!feed2.newsreader.com!newsreader.com!newshosting.com!news-xfer1.atl.newshosting.com!news-out.nuthinbutnews.com!propagator2-sterling!news-in-sterling.newsfeed.com!news-in.nuthinbutnews.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114a0e,9ff790979c64f2be,start
X-Google-Attributes: gid114a0e,public
X-Google-ArrivalTime: 2002-12-03 10:10:07 PST
Reply-To: "Sergio Gonzalez" <shg@sion.com>
From: "Sergio Gonzalez" <shg@sion.com>
Newsgroups: borland.public.interbase.sql
Subject: Simple SQL question (I guess)
Date: Tue, 3 Dec 2002 15:05:34 -0300
Lines: 42
Organization: SG
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 200.69.38.90
Message-ID: <3decf30f@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1038938895 200.69.38.90 (3 Dec 2002 10:08:15 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!sn-xit-08!supernews.com!38.144.126.76.MISMATCH!feed2.newsreader.com!newsreader.com!newshosting.com!news-xfer1.atl.newshosting.com!news-out.nuthinbutnews.com!propagator2-sterling!news-in-sterling.newsfeed.com!news-in.nuthinbutnews.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail