homepage Welcome to WebmasterWorld Guest from 23.20.77.156
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, Moderators: physics

Databases Forum

    
Insert into select
StoutFiles




msg:4239674
 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




msg:4239754
 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




msg:4239771
 5:26 pm on Dec 7, 2010 (gmt 0)

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

StoutFiles




msg:4239847
 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