|
-
May 8th, 2006, 09:26 AM
#1
Thread Starter
Addicted Member
Experts in Recordsets , Plz Help
How do I select an entire table and insert it in a new table which exists in a different database?
I'm trying to export a table from ACCESS file to Oracle Table using VB recordset but I don't want to loop in a recordset , I just want to INSERT the entire table
Is thie possible ?
-
May 8th, 2006, 10:00 AM
#2
PowerPoster
Re: Experts in Recordsets , Plz Help
I don't know about Oracle, but I use this code to archive records from one database to another (SQL Server 2000).
VB Code:
sql = "INSERT INTO ARCHIVE.DBO.INVENTORYHISTORYARCHIVE SELECT * FROM INVENTORYHISTORY WHERE [XACTDTE] <= " & "'" & glbDate & "'"
CnxnTechSQL.Execute sql
of course, you have to be connected to both databases before this can be executed.
-
May 8th, 2006, 10:06 AM
#3
Thread Starter
Addicted Member
Re: Experts in Recordsets , Plz Help
 Originally Posted by Pasvorto
VB Code:
sql = "INSERT INTO ARCHIVE.DBO.INVENTORYHISTORYARCHIVE SELECT * FROM INVENTORYHISTORY WHERE [XACTDTE] <= " & "'" & glbDate & "'"
CnxnTechSQL.Execute sql
Can you please explain what is [XACTDTE] means and what is glbDate means?
-
May 8th, 2006, 10:08 AM
#4
Re: Experts in Recordsets , Plz Help
Can't you open Access and attach the Oracle tables (don't import just attach) and create a query in Access that does the insert (if this is a one time only action)?
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
May 8th, 2006, 10:09 AM
#5
Re: Experts in Recordsets , Plz Help
XACTDTE would be a field in his database, and glbDate would be a control that contains the date he is using as the condition of the insert.
-
May 8th, 2006, 10:36 AM
#6
Thread Starter
Addicted Member
Re: Experts in Recordsets , Plz Help
GaryMazzone,Can you please explain it more to me
I opned the oracle database using ODBC connection ( I didn't import the table)
Now what should I do ?
-
May 8th, 2006, 10:42 AM
#7
Re: Experts in Recordsets , Plz Help
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
May 8th, 2006, 10:50 AM
#8
Re: Experts in Recordsets , Plz Help
The attached images are attaching an Oracle set of tables to Access. These are based on a Datasource build in the system.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
May 8th, 2006, 11:01 AM
#9
Thread Starter
Addicted Member
Re: Experts in Recordsets , Plz Help
-
May 8th, 2006, 11:30 AM
#10
Re: Experts in Recordsets , Plz Help
Select table tables to link. Then create the Query in Access as an append query from the Access table to the Oracle table.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
May 9th, 2006, 09:08 AM
#11
Thread Starter
Addicted Member
Re: Experts in Recordsets , Plz Help
Can you give me an example of the query ?
1- I opened an oracle table using (ODBC Connection )
2- I Imported the Access table to the current Access file.
Now I have the two tables in the tables section
What should I do next , go to quries and do what exactlly? use wizard ?
I need help please be patient with me =(
-
May 9th, 2006, 09:20 AM
#12
Re: Experts in Recordsets , Plz Help
 Originally Posted by bomayed
What should I do next , go to quries and do what exactlly? use wizard ?
Yes. Select New, Design View, select the Access table, Close.
Select Query Type (the icon with the 2 tables), Append Query.
Select the Oracle table.
Drag the fields from the Access table to the Field row (1 to a box) and select the Oracle field in Append To.
When you have all the fields you want to insert, click on the ! (run the query).
(I think I got all the steps.)
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
May 14th, 2006, 07:36 AM
#13
Thread Starter
Addicted Member
Re: Experts in Recordsets , Plz Help
Wow , Amazing , Thanks Al42 and thank you GaryMazzone
I tried to copy the data from the access table and paste it to the oracle table in ACCESS but it took forever . . days to copy half the data. But with the append and query stuff It took 15 minutes! I wonder what's the difference between copy and paste and append . . . I mean why is it faster?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|