homepage Welcome to WebmasterWorld Guest from 54.205.207.53
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
Insert into select
StoutFiles

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4239672 posted 1:34 pm on Dec 7, 2010 (gmt 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.

 

LifeinAsia

WebmasterWorld Administrator lifeinasia us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4239672 posted 4:55 pm on Dec 7, 2010 (gmt 0)

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

physics

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4239672 posted 5:26 pm on Dec 7, 2010 (gmt 0)

What database engine are you using? e.g. MySQL?

StoutFiles

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4239672 posted 8:53 pm on Dec 7, 2010 (gmt 0)

It's a Historian database with OLE DB.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved