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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting Relational Algebra into SQL - Multiple SQL Queries

Status
Not open for further replies.

ems

Programmer
Mar 23, 2001
13
IE
Hi,

I am creating a CAL on Relational Algebra. For the quiz section, the user will be typing in the Relational Algebra query. I must convert that to SQL..here is one for Union:

Dim SQL1 As String
Dim SQL2 As String
Dim SQL3 As String

SQL1 = "INSERT INTO temp SELECT * FROM Books"
Adodc1.RecordSource = SQL1
Adodc1.Refresh

SQL2 = "INSERT INTO temp SELECT * FROM Papers"
Adodc2.RecordSource = SQL2
Adodc2.Refresh

SQL3 = "SELECT DISTINCT * INTO result1 FROM temp"
Adodc3.RecordSource = SQL3
Adodc3.Refresh
End Sub

However I amgetting all sorts of errors.
It won't let me run the 3 queries using the same tables...

Has anyone done something similar?
Thanks in advance
 
Do the Books and Papers tables have the same number and type of columns?

It's tedious, but I find that explicitly telling it which columns to select and insert into make finding datatype mis-matches much easier to find.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top