🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #4132

Re: Delete row problem(Join Statement)

#4132
From: Junlin Xie
Date: Fri, 22 Mar 2002 05:32
61 lines
2985 bytes
Dear Ivan,

    Your information is very helpful, I've resolved my problem, Thank you
very much.

Junlin Xie
"Ivan Mihailov" <iradev@mail.vega.bg> wrote in message
news:3c9a4bba_2@dnews...
> Hi,
> Check this link and you will find  the answer of your question
>
> http://www.microsoft.com/mspress/books/sampchap/3445.asp
>
> Ivan
>
> "Junlin Xie" <jlxie@yahoo.com> wrote in message news:3c99721b_1@dnews...
> > Hi,
> >     I am using a TADODataSet to query data from SQL Server 7, there are
2
> > table joined in SQL, like the following:
> >
> > select od.OrderID, od.OrderDate, Cust.CustCode, od.BuyerRef, od.Brand,
> > od.ShippingMethod, od.ShipmentFrom, od.ShipmentTo, od.Consignee,
> > od.PaymentTerm, od.CreditDays, od.PriceTerm, od.ReqDeLvDate,
> od.ReqDateDes,
> > od.RealDelvDate,  od.RealDateDes, od.DelvCountry, od.PriceUnit,
> od.Quantity,
> > od.Amount, od.TotalWeight, od.TotalSize, od.Confirmation, od.Approved,
> > od.ApprovedBy, od.Status, od.OrderTypeID, od.DeptID  from Orders od left
> > join  Customers Cust on Cust.CustID = od.CustID where (od.OrderDate
> Between
> > :StartDate and :EndDate) and (od.DeptID = :DeptID or od.CustID =
:CustID)
> >
> >     When I delete a row from DataSet, I just want to delete the row in
the
> > first table(Orders), Using DataSet->Delete(), but It also delete the
> second
> > table( Customers ) row, What's wrong with me.
> >
> >     The following tracing message are from SQL Server Profiler after I
> > execute the delete operation:
> > sp_executesql N'DELETE FROM "CELDB".."Customers" WHERE "CustID"=@P1',
> N'@P1
> > varchar(12)', '2018        '
> > go
> > sp_executesql N'DELETE FROM "CELDB".."Orders" WHERE "OrderID"=@P1',
N'@P1
> > varchar(20)', 'PI02D03051          '
> >
> >     How can I delete only primary table row in a joined query?
> >
> >     by the way, I'm using BCB5 and SQL7.
> >
> > Thank you very much
> >
> > Junlin Xie
> >
> >
>
>
Technical Details
Message-ID: <3c9ac250$1_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.gamma.ru!Gamma.RU!news.tele.dk!small.news.tele.dk!213.56.195.71!fr.usenet-edu.net!usenet-edu.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3c99721b_1@dnews> <3c9a4bba_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,f7d2e7ab12e8d60e
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-03-21 21:39:12 PST
Reply-To: "Junlin Xie" <jlxie@yahoo.com>
From: "Junlin Xie" <jlxie@yahoo.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3c99721b_1@dnews> <3c9a4bba_2@dnews>
Subject: Re: Delete row problem(Join Statement)
Date: Fri, 22 Mar 2002 13:32:23 +0800
Lines: 63
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
NNTP-Posting-Host: 202.105.138.4
Message-ID: <3c9ac250$1_1@dnews>
X-Trace: dnews 1016775248 202.105.138.4 (21 Mar 2002 21:34:08 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.gamma.ru!Gamma.RU!news.tele.dk!small.news.tele.dk!213.56.195.71!fr.usenet-edu.net!usenet-edu.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews