Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CREATE CURSORS 1

Status
Not open for further replies.

rclarke

Technical User
May 14, 2001
78
GB
Heelo I am having serious problems with a bit of SQL and Cursors

The sienario

I have three tables.

1. Test Set Details (this contians a set of tests)
2. Test Detials(This contians a list of all the different tests)
3.Test Results(which hold the results of the tests applied)

My problem is I need to get a Line number and testID from Test Set Detail.

I also need Type and shortdescription from test details.

and I need Result and Comments from the Test Results table

All are linked by testID

what is the best way to do this

I so far have created a cursor with these fields in but I hve no idea whether this is the right way to go about it not .

Please help

Thanks in advance

Rachel

 
Hi Rachel,

For a particular testID:

SELECT ts.line, ts.testID, td.type, td.shortdescription, tr.result, tr.comments FROM testsetdetails ts, testdetails td, testresults tr WHERE ts.testID = myID and td.testID = myID and tr.testID = myID INTO CURSOR resultcursor

Jim
 
Rachel

The Query wizard would probably give you what you need, and you could examine the code produced which will give you an idea of how it all works.

Chris :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top