There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
bios black screen blue screen boot computer connection crash css dell display driver drivers email error excel firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop lcd linux malware monitor network networking nvidia outlook outlook 2003 outlook express partition password printer problem router slow sound startup trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
COPY FROM database TO database USING


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
NewToPCGuy's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2002
12-May-2005, 08:37 PM #1
Post COPY FROM database TO database USING
I need to query a table in a database that I need to write to to determine what records I need to pull from the database I need to read from.
Example(This dosnt work):

DECLARE

DateVar Date;

BEGIN

DateVar := Select MAX(Invoice_Date) from write_To_Table;

COPY FROM read_database TO write_database INSERT-
destination_table (column_name, column_name...) -
USING select * from read_From_Table where invoice_Date > DateVar;

END;

Any other suggestions
RedAxl's Avatar
Member with 47 posts.
 
Join Date: Nov 2004
Experience: OpenROAD Programmer
12-May-2005, 09:11 PM #2
Hi,

What you need to do is:
- Connect to write_database.
Query the DateVar for your WHERE condition.

- Connect to read_database.
Query all the records what that you want to insert to write_database.
Then store the records to "ARRAY"

- Connect to write_database.
Insert your "ARRAY" to destination_table

I hope this helps.

Red
__________________
Doing something easily
what others find difficult is "Talent"
NewToPCGuy's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2002
12-May-2005, 09:18 PM #3
Thanks for your reply RedAxl

The problem seems to be that
COPY FROM ...

doesnt seem to work in a plsql procedure. Is there a way to create and use a variable outside of a procedure?
RedAxl's Avatar
Member with 47 posts.
 
Join Date: Nov 2004
Experience: OpenROAD Programmer
13-May-2005, 01:11 AM #4
Just pass the variable/s as a parameter to a procedure.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:23 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.