Welcome to WebmasterWorld Guest from 54.162.91.86

Forum Moderators: open

Message Too Old, No Replies

Insert into select

     
1:34 pm on Dec 7, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:May 6, 2008
posts:2011
votes: 0


I have two databases, A and B.

A is a read-only table.

I'm wondering if it's possible to run an "insert into select" query on Table B.

insert into B:data (B:data.test)
select A:data.test from A:data
where A:data.test = '0';

Will A be able to do this? I'd just check myself but I'm running these queries through VMS using Attunity and the error messages are archaic.
4:55 pm on Dec 7, 2010 (gmt 0)

Moderator from US 

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 10, 2005
posts:5667
votes: 76


It depends on what database you're using. For example, if you're using MS SQL, the following should work (assuming you have the proper permissions for both databases):
INSERT INTO b.dbo.data (test)
SELECT a.dbo.data.test
WHERE test=0
5:26 pm on Dec 7, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 27, 2001
posts:2548
votes: 0


What database engine are you using? e.g. MySQL?
8:53 pm on Dec 7, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:May 6, 2008
posts:2011
votes: 0


It's a Historian database with OLE DB.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members