By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,874 Members | 1,058 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,874 IT Pros & Developers. It's quick & easy.

Can a pass-through query to create a table?

P: n/a
Hello
I need to get data from 4 Oracle tables and combine them into a
temporary table in my application. I get data using a pass-through
query dynamically created in code:
mySQL = "SELECT SID_SCREENING_TASKS_QUESTIONS.TASK_ID,
mySQL = mySQL & "SID_SCREENING_TASKS_QUESTIONS.ID,
mySQL = mySQL & "SID_SCREENING_QUESTIONS.TITLE, "
mySQL = mySQL & "SID_SCREENING_QUESTION_STUDENT.Points "
mySQL = mySQL & "from SID_SCREENING_TASKS_QUESTIONS,
SID_SCREENING_QUESTIONS, "
mySQL = mySQL & "SID_SCREENING_QUESTION_STUDENT "
mySQL = mySQL & "WHERE
SID_SCREENING_TASKS_QUESTIONS.ID=SID_SCREENING_QUE STIONS.ID and "
mySQL = mySQL & "SID_SCREENING_TASKS_QUESTIONS.ID=SID_SCREENING_QU ESTION_STUDENT.ID(+)
and SID_SCREENING_QUESTIONS.DELETED IS NULL AND "
mySQL = mySQL & "(SID_SCREENING_QUESTION_STUDENT.STUDENT_CODE IS NULL
OR "
mySQL = mySQL & "SID_SCREENING_QUESTION_STUDENT.STUDENT_CODE=" &
Me![txtStuCode] & ");"
If IsLive = True Then
Set myQuery = "qryScreening_live"
Else
Set myQuery = "qryScreening_test"
End If
myQuery.SQL = mySQL
Set myRSet = myQuery.OpenRecordset
When I have this recordset, I'll copy the data into a predefined table
looping through the recordset.
A question: can I create the above query so that it creates a table
with the data returned?
Thank you.
Galina
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Save the pass-through query, then create a MakeTable query based on the
saved pass-through query.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Galina" <ga****@mail.ru> wrote in message
news:ec*************************@posting.google.co m...
Hello
I need to get data from 4 Oracle tables and combine them into a
temporary table in my application. I get data using a pass-through
query dynamically created in code:
mySQL = "SELECT SID_SCREENING_TASKS_QUESTIONS.TASK_ID,
mySQL = mySQL & "SID_SCREENING_TASKS_QUESTIONS.ID,
mySQL = mySQL & "SID_SCREENING_QUESTIONS.TITLE, "
mySQL = mySQL & "SID_SCREENING_QUESTION_STUDENT.Points "
mySQL = mySQL & "from SID_SCREENING_TASKS_QUESTIONS,
SID_SCREENING_QUESTIONS, "
mySQL = mySQL & "SID_SCREENING_QUESTION_STUDENT "
mySQL = mySQL & "WHERE
SID_SCREENING_TASKS_QUESTIONS.ID=SID_SCREENING_QUE STIONS.ID and "
mySQL = mySQL & "SID_SCREENING_TASKS_QUESTIONS.ID=SID_SCREENING_QU ESTION_STUDENT.ID(+) and SID_SCREENING_QUESTIONS.DELETED IS NULL AND "
mySQL = mySQL & "(SID_SCREENING_QUESTION_STUDENT.STUDENT_CODE IS NULL
OR "
mySQL = mySQL & "SID_SCREENING_QUESTION_STUDENT.STUDENT_CODE=" &
Me![txtStuCode] & ");"
If IsLive = True Then
Set myQuery = "qryScreening_live"
Else
Set myQuery = "qryScreening_test"
End If
myQuery.SQL = mySQL
Set myRSet = myQuery.OpenRecordset
When I have this recordset, I'll copy the data into a predefined table
looping through the recordset.
A question: can I create the above query so that it creates a table
with the data returned?
Thank you.
Galina

Nov 13 '05 #2

P: n/a
Interesting... Thank you.
Galina

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message news:<zP**********************@twister01.bloor.is. net.cable.rogers.com>...
Save the pass-through query, then create a MakeTable query based on the
saved pass-through query.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Galina" <ga****@mail.ru> wrote in message
news:ec*************************@posting.google.co m...
Hello
I need to get data from 4 Oracle tables and combine them into a
temporary table in my application. I get data using a pass-through
query dynamically created in code:
mySQL = "SELECT SID_SCREENING_TASKS_QUESTIONS.TASK_ID,
mySQL = mySQL & "SID_SCREENING_TASKS_QUESTIONS.ID,
mySQL = mySQL & "SID_SCREENING_QUESTIONS.TITLE, "
mySQL = mySQL & "SID_SCREENING_QUESTION_STUDENT.Points "
mySQL = mySQL & "from SID_SCREENING_TASKS_QUESTIONS,
SID_SCREENING_QUESTIONS, "
mySQL = mySQL & "SID_SCREENING_QUESTION_STUDENT "
mySQL = mySQL & "WHERE
SID_SCREENING_TASKS_QUESTIONS.ID=SID_SCREENING_QUE STIONS.ID and "
mySQL = mySQL &

"SID_SCREENING_TASKS_QUESTIONS.ID=SID_SCREENING_QU ESTION_STUDENT.ID(+)
and SID_SCREENING_QUESTIONS.DELETED IS NULL AND "
mySQL = mySQL & "(SID_SCREENING_QUESTION_STUDENT.STUDENT_CODE IS NULL
OR "
mySQL = mySQL & "SID_SCREENING_QUESTION_STUDENT.STUDENT_CODE=" &
Me![txtStuCode] & ");"
If IsLive = True Then
Set myQuery = "qryScreening_live"
Else
Set myQuery = "qryScreening_test"
End If
myQuery.SQL = mySQL
Set myRSet = myQuery.OpenRecordset
When I have this recordset, I'll copy the data into a predefined table
looping through the recordset.
A question: can I create the above query so that it creates a table
with the data returned?
Thank you.
Galina

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.