Home All Groups Group Topic Archive Search About

Need help in writting query....

Author
14 Jul 2006 1:10 PM
Mukut
All,
I am eagerly looking for your kind help in a specific problem as
described below:

I have
source table S(suaId,subId), Destination table D(duaPId,dubPId).
Also having tables  UA(duaPId,suaId)  &   UB(dubPId,subId).

while loading data, process takes suaId and looks for it in UA.suaId
column.If it is found,
process picks the corresponding value from UA.duaPId column and pastes
it in D.duaPId column. In the same way, D.dubPId column is populated
with the value from UB. dubPId column.
Now, the data has been loaded.
How do I check whether data has been loaded properly? I need to check
UA.duaPId & UB.dubPId have been resolved and ultimately pasted to the
destination table.
Would you please suggest any query for this? It will be great if a
single query does the job.
Fyi,all Ids are unique.

P.S
Previously I had
Source table SS(ssId,…..) and Destination table DD(PId,ssId,….)
Data flow:     SS.ssId---------DD.ssId
PId is unique and generated automatically.
ssId is also unique.
After data loading, I checked using the following query:

select s.ssId,d.ssId
from
SS s left outer join DD d
on  s.ssId= d.ssId
where d.ssId is NULL

This returns nothing which explain that for every SS.ssId a matching
ssId is present at tableDD .Therefore data loading is successful.



Thanks for your time………

Author
14 Jul 2006 1:30 PM
ML
Please provide proper DDL, sample data and expected results, so that we can
help you find a solution to your problem.

See:
http://www.aspfaq.com/etiquette.asp?id=5006


ML

---
http://milambda.blogspot.com/
Author
14 Jul 2006 2:52 PM
Arnie Rowland
It's not clear if you are inserting data into 2 or more tables and are
trying to verify that ALL the inserts succeed.

If so, then by using a TRANSACTION and proper error handling, if the stored
procedure completes successfully, you can be assured that all data inserts
were successful. It would not be necessary to execute the LEFT JOIN query to
see if anything was missing.

Please provide DDL, and some sample data in the form of INSERT statements,
and a clarification about your desired outcome so that we may better assist
you.

--
Arnie Rowland*
"To be successful, your heart must accompany your knowledge."



"Mukut" <hidev***@gmail.com> wrote in message
news:1152882623.624063.115480@s13g2000cwa.googlegroups.com...
All,
I am eagerly looking for your kind help in a specific problem as
described below:

I have
source table S(suaId,subId), Destination table D(duaPId,dubPId).
Also having tables  UA(duaPId,suaId)  &   UB(dubPId,subId).

while loading data, process takes suaId and looks for it in UA.suaId
column.If it is found,
process picks the corresponding value from UA.duaPId column and pastes
it in D.duaPId column. In the same way, D.dubPId column is populated
with the value from UB. dubPId column.
Now, the data has been loaded.
How do I check whether data has been loaded properly? I need to check
UA.duaPId & UB.dubPId have been resolved and ultimately pasted to the
destination table.
Would you please suggest any query for this? It will be great if a
single query does the job.
Fyi,all Ids are unique.

P.S
Previously I had
Source table SS(ssId,...) and Destination table DD(PId,ssId,..)
Data flow:     SS.ssId---------?DD.ssId
PId is unique and generated automatically.
ssId is also unique.
After data loading, I checked using the following query:

select s.ssId,d.ssId
from
SS s left outer join DD d
on  s.ssId= d.ssId
where d.ssId is NULL

This returns nothing which explain that for every SS.ssId a matching
ssId is present at tableDD .Therefore data loading is successful.



Thanks for your time...

AddThis Social Bookmark Button