How to use database link to create table in other database?

e.g., java jdbc is connected to the database A.
i want to create one table (Table1)in database B, and then insert data into Table1 select ....from Table2 which is in database A.
i used the create database link (database name) connect to (database) indentified by .....
but ...i got the sqlException as i wrote before.
Thanks again.

http://forum.java.sun.com/thread.jspa?threadID=656868&messageID=3860293#3860293

Similar Messages

  • Creating table in other databases than Oracle

    Hi
    It would be nice to be able to create tables in a JDBC Connection in other databases than Oracle. Why limit it to Oracle when there is a SQL standard to work with?
    Regards,
    Fredrik

    Generic SQL isn't really as generic as people would like to believe.
    In any case, we're working on that for an upcomming release, but with the current time constraints, we just got the Oracle table creation support done.
    (The time is more on testing than writing the feature)
    It'll get in there, but probably not in the next release.
    Rob

  • How to use db link to create forms

    Hi,
    i'm looking for how to create a form (From on a Table or View) using a dblink.
    I got it trying to create a report list, but not in forms.
    Following de wizard creation, when I indicate de table, like this tablename@dblinkname, i got the masage saying that there's no such table name in the schema.
    Someone knows the easiest way to do this?
    Thanks.

    Peter, I created the view and now I could create the page.
    But when trying to create a record received this message:
    ORA-01653: unable to extend table ICM.T_CDTR_MSTR by 128 in tablespace FLOW_3923800470111176 ORA-02063: preceding line from ICM ORA-06512: at "SYS.WWV_DBMS_SQL", line 549 ORA-06512: at "APEX_040000.WWV_FLOW_DML", line 1121 ORA-22816: unsupported feature with RETURNING clause
    Error     Unable to process row of table T_CDTR_MSTR.
    Well, it's clearly that the problem involves the process of the page but i don't know why.

  • How to create links and how to use that links to go to other pages?

    my question is....how to create links...i mean by using make link option.....when we do right click on a word,etc in the design view.....and my other question is.....how to use that links to go to other pages.....i mean when i click on a link...it takes me to another web page.....

    Please do not post the same subject to more than one forum.

  • Can use JDBC to create table in the database?

    other than select, insert, update, delete the record set
    I want to know can I use the JDBE to create table.

    As far as i know you can use 'CREATE TABLE' to create tables.
    Use it in an cn.execute() or cn.executeUpdate().
    I'm not sure about the complete syntax for CREATE TABLE, since you also need to define you fields etc. Try looking on the net for an SQL manual.
    Greetz..

  • How to use DB Link

    Hi,
    I have two databases DevX and ProdY.
    With TOAD I am Querying and accessing both the databases separately.
    I wanted to fire a query as below
    Delete from DEVX.Schema1.tableA
    Where tableA.plan_n NOT IN (Select plan_n from PRODY.Schema2.tableB )
    How can I do this query, I know that DB link need to be used. I am new to the Database link area.
    If you have the steps then please let me know.

    CREATE DATABASE LINK
    Purpose
    Use the CREATE DATABASE LINK statement to create a database link. A database link is a schema object in one database that enables you to access objects on another database. The other database need not be an Oracle system. However, to access non-Oracle systems you must use Oracle Heterogeneous Services.
    Once you have created a database link, you can use it to refer to tables and views on the other database. In SQL statements, you can refer to a table or view on the other database in by appending @dblink to the table or view name. You can query a table or view on the other database with the SELECT statement. You can also access remote tables and views using any INSERT, UPDATE, DELETE, or LOCK TABLE statement.
    See Also:
    Oracle9i Application Developer's Guide - Fundamentals for information about accessing remote tables or views with PL/SQL functions, procedures, packages, and datatypes
    Oracle9i Database Administrator's Guide for information on distributed database systems
    Oracle9i Database Reference for descriptions of existing database links in the ALL_DB_LINKS, DBA_DB_LINKS, and USER_DB_LINKS data dictionary views and to monitor the performance of existing links through the V$DBLINK dynamic performance view
    DROP DATABASE LINK for information on dropping existing database links
    INSERT, UPDATE, DELETE, and LOCK TABLE for using links in DML operations
    Prerequisites
    To create a private database link, you must have CREATE DATABASE LINK system privilege. To create a public database link, you must have CREATE PUBLIC DATABASE LINK system privilege. Also, you must have CREATE SESSION privilege on the remote Oracle database.
    Oracle Net must be installed on both the local and remote Oracle databases.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_56a.htm#SQLRF01205
    I can learn you to do it, step by step
    Joel P�rez

  • How to use the DLLs which created from c++ in Java?

    And How to use the DLLs which created from JNI in C++?

    Huh?
    Are you asking how to do JNI - you should read the tutorial.
    Are you asking how to load it - then use System.loadLibrary()
    Are you asking what to do with the output from javah - put it in a C file and write some code, compile it into a dll.

  • How to use outer join on 3 tables

    how to use outer join on 3 tables
    say tables are mkpf,lips and vbrp
    mkpf-xblnr = lips-vbeln
    lips-vbeln  = vbrp-vgbel

    refer following querry
        select a~bukrs
               a~anln1
               a~ord42
               a~ord43
               b~afabe
               b~ndabj
               b~kaafa
               b~aafag
               c~kostl
               d~afasl
               d~ndjar
               d~ndper
        into corresponding fields of table gt_master
        from ( ( anla as a inner join anlc as b
        on abukrs = bbukrs
        and aanln1 = banln1
        and aanln2 = banln2 )
        inner join anlz as c
        on  abukrs = cbukrs
        and aanln1 = canln1
        and aanln2 = canln2 )
        inner join anlb as d
        on  abukrs = dbukrs
        and aanln1 = danln1
        and aanln2 = danln2
        where a~bukrs in s_comp.

  • How will use Select-Options in Read table Concept.

    Hi All,
                  How will use Select-Options in Read table. For  example,
          Select-Options : test for bseg-prctr.
           Select * from bseg into table ITAB.
    Read table ITAB with key prctr in test.
    Last line is showing error. If any way to read ITAB as conditions given per select options.
    Thankx Advance,,,

    HI,
    you cannot use " IN " with read statement , read statement is used as:
    READ TABLE it_collect  ASSIGNING <fs_collect>
                      WITH KEY   rbpl = <fs_wkdet>-arbpl
                                 ufnr = <fs_wkdet>-aufnr.
    anyways you can use  loop at statement before read to use  " into "  statement as:
    LOOP AT it_master INTO l_master
                                           WHERE werks       = l_werks
    hope it will help you
    regards
    rahul
    Edited by: RAHUL SHARMA on Dec 30, 2008 9:14 AM

  • Creating an XML for the database having link to a table in another database

    I have a database in which a table holds the link to table in different database.
    I am not able to create the XML file.It is giving me an error
    Error# 2516:XMLExporter Method Run of Object '_Application' Failed.
    Is there any alternate or round about process to generate an XML file.

    I assume this is MS Access database? What version?
    Is the link valid from within Access? Can you see the remote table?
    You could make a copy of this mdb file and just remove this link table to see if the exporter runs to completion without errors.
    Donal

  • Create tables in different database schemas using EJB 3 Entity Persistent

    Hi All,
    I would like to find out how to get the following tasks done using EJB 3.0 Java Entity Persistent:
    ( i ) Create tables in different schemas such as STUDENT under EDUCATION schema and table PATIENT in HOSPITAL schema. We can then reference them in SQL as EDUCATION.STUDENT and HOSPITAL.PATIENT.
    ( ii ) Reference these tables uniquely once they are created.
    There are no pre-existing tables or naming conventions that needs to be adhere to in this situation.
    I have no problem creating tables on the current schema in EJB 3.0 Java Entity Persistent.
    Any suggestions would be appreciated.
    Thanks,
    Jack

    Use the schema attribute of the Table annotation:
    package javax.persistence;
    @Target({TYPE}) @Retention(RUNTIME)
    public @interface Table
       String name( ) default "";
       String catalog( ) default "";
       String schema( ) default "";
       UniqueConstraint
    uniqueConstraints( ) default {};
    }

  • How to empty XE database and re-create tables/fields from scratch?

    Hi,
    I've installed XE database to port my VB6/Access application to it, and I know that XE is limited to one single database, so far so good. But I want to erase everything from inside this default database to create my own tables/fields from scratch. How can I do that?
    I just want to have one single database file with some tables/fields inside it, and nothing else. The rest will be done through VB straight.
    And what is the name of the default XE database file? Where is it stored? If I make a backup of this file, can I restore it after a crash in the future by overwriting the corrupted file? Is that this simple as Access is?
    Sorry about those many questions and thanks for reading!
    Roger.

    If you want to erase everything, one solution is to uninstall Oracle XE and just to reinstall it.
    Under Windows to avoid any issue, see http://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25143/toc.htm#CIHDDHJD.
    If your application is owned by a single Oracle user account, you can also run (where <schema> is the Oracle user account name):
    drop user <schema> cascade;To reinstall your application you would need to recreate the user account <schema> with the right privileges (CREATE USER ... and GRANT ...).

  • Stored procedure with database link with "from table(...)"

    Hi guys,
    I've been told I can't create views on a database by the design team and so have to use this stored procedure to obtain the values.
    select HAN_ID, HAN_DS, GLOBAL_IN, LOCAL_IN
    from table(cast(ODADMIN.ODP00002_QUERY.Execute001@DBLINK(11312,'EN') as
    ODADMIN.ODP00002_001_Array@DBLINK)) WHERE LOCAL_IN = 'Y';I've been told that it works when you remove the database links (so on the actual database) when you remove the cast part. I've tried it with my link and with/without the cast part but it doesn't work. With the example above I get the error: ORA-00907: missing right parenthesis.
    When I remove the CAST-AS and the additional parenthesis it brings i get the error: ORA-00904: "ODADMIN"."ODP00002_QUERY"."EXECUTE001": invalid identifier
    When I do table( *"* ODADMIN.ODP00002_QUERY.Execute001@MWW_DEV(11312,'EN') *"* )... -- wrapping the call in speech marks I get: ORA-00972: identifier is too long
    Anyone see what's wrong? Thanks for any help.
    Mike

    Hi Ben,
    Asking now. By a view I mean one local to the database; I could create one on APEX but then I use the database link twice instead of just 1.
    His reasoning Ben:
    Firstly, Maintenance. We will have to maintain additional views (at additional code). Secondly, if the view has a JOIN, then you can't update through it (without complexities). If we have to get the View to pass the data to a Procedure (that's a pain). Also, standards..
    All update occur via either a Procedure, or a Base view, across over 1000 tables
    That's the standard, and doing things differently is costly long term
    People will not know how it works, it will have to be explained, maintained..etc.
    If the Application has the Business Rules, then updates via Base Views, that's a more standard way of developing. Also, if you update via this view, you'll update multiple rows in one call, which is in-effficient if only ONE row needs to change. Therefore, single row updates from the Application is more efficient
    The procedure is as follows:
    --SET SERVEROUTPUT ON
    DECLARE
    nPBusLoc       NUMBER(5):=11312;
    sPHanId        VARCHAR2(3):='SB1';
    sPLngId        VARCHAR2(2):='EN';
    sPDesc         VARCHAR2(30);
    sPAllowAlloc   VARCHAR2(1);
    sPShowEnq      VARCHAR2(1);
    sPAllowDel     VARCHAR2(1);
    sPShowScan     VARCHAR2(1);
    sPGlobalLocal  VARCHAR2(1);
    sPReturnCd     VARCHAR2(2);
    sPReturnTx     VARCHAR2(100);                  
    BEGIN
    ODADMIN.ODP00001.getHandlingCodes
                           (nPBusLoc    --  IN   NUMBER
                          ,sPHanId      -- IN   VARCHAR2
                          ,sPLngId      -- IN   VARCHAR2
                          ,sPDesc       -- OUT  VARCHAR2
                          ,sPAllowAlloc -- OUT  VARCHAR2
                          ,sPShowEnq    -- OUT  VARCHAR2
                          ,sPAllowDel   -- OUT  VARCHAR2
                          ,sPShowScan   -- OUT  VARCHAR2
                          ,sPGlobalLocal-- OUT  VARCHAR2
                          ,sPReturnCd   -- OUT  VARCHAR2
                          ,sPReturnTx   -- OUT  VARCHAR2                                    
    DBMS_OUTPUT.PUT_LINE('nPBusLoc                 = '||nPBusLoc              );
    DBMS_OUTPUT.PUT_LINE('sPHanId                  = '||sPHanId               );
    DBMS_OUTPUT.PUT_LINE('sPLngId                  = '||sPLngId               );
    DBMS_OUTPUT.PUT_LINE('sPDesc                   = '||sPDesc                );
    DBMS_OUTPUT.PUT_LINE('sPAllowAlloc             = '||sPAllowAlloc          );
    DBMS_OUTPUT.PUT_LINE('sPShowEnq                = '||sPShowEnq             );
    DBMS_OUTPUT.PUT_LINE('sPAllowDel               = '||sPAllowDel            );
    DBMS_OUTPUT.PUT_LINE('sPShowScan               = '||sPShowScan            );
    DBMS_OUTPUT.PUT_LINE('sPGlobalLocal            = '||sPGlobalLocal         );
    DBMS_OUTPUT.PUT_LINE('sPReturnCd               = '||sPReturnCd            );
    DBMS_OUTPUT.PUT_LINE('sPReturnTx               = '||sPReturnTx            );
    END;
    /Mike
    Edited by: Dird on 27-Aug-2009 01:50

  • Could not create table on 'master' database

    Hello,
         I am new to the SQL Azure. When I tried to create table on master DB, i get following error.
    Msg 262, Level 14, State 1, Line 1CREATE TABLE permission denied in database 'master'.
    I tried to change role to 'db_owner' but have received following error.
    Msg 15151, Level 16, State 1, Line 1Cannot alter the role 'db_owner', because it does not exist or you do not have permission.
    I logged into master DB using the credentials I created while creating DB on the Azure. This is supposed to be 'sa'.
    My question is, does SQL Azure allow to create objects (tables, stores procedures, triggers) on master DB. If yes, what am I doing wrong? If no, why?
    My guess is that SQL Azure is not less than the On premises DB. It must be allowing objects creation on master DB.
    I have found a similar question on forum but I did not get the answer. Here is the link --> https://social.msdn.microsoft.com/Forums/azure/en-US/cbff1bd2-358f-4106-b238-ec369941099d/master-database-cannot-alter-the-role-dbowner.
    FYI, I have gone through following resources but haven't got solution for my problem.
    1) https://iainhunter.wordpress.com/2011/06/20/copying-databases-and-creating-users-and-logins-for-sql-azure/
    2) http://www.c-sharpcorner.com/forums/thread/126589/create-database-permission-denied-in-database-master.aspx
    3) http://stackoverflow.com/questions/20656943/how-do-you-change-the-owner-of-an-azure-database
    4) https://msdn.microsoft.com/en-us/library/azure/ee336235.aspx
    Thanks in advance.

    My question is, does SQL Azure allow to create objects (tables, stores procedures, triggers) on master DB. If yes, what am I doing wrong? If no, why?
    My guess is that SQL Azure is not less than the On premises DB. It must be allowing objects creation on master DB.
    For the answer of the question, you can read Joseph's. Azure SQL, so far, is less than the premise DB except its
    cloud-based advantage. There're many limitations like less T-SQL features supported.
    Azure SQL Database Transact-SQL Reference
    more links for your reference.
    Preview features
    Managing Databases and Logins in Azure SQL Database
    Eric Zhang
    TechNet Community Support

  • How can I delete the site (created in webDB) from database?

    Hi I have the WebDB 2.2 and Database server Oracle8i and I created a lot of sites with WebDB but I do not know how can I delete them from database server. Could somebody help to me?

    Log into sql plus as webdb
    Drop user <site name>_admin cascade;
    Drop user <site name>_public cascade;
    Drop user <site name> cascade;
    and drop any other users you have made specically for this site.
    Remove the dad from the listener settings.
    If you wish to use this site name again in the same database you also have to delete a record from a table in the Webdb schema.
    I can't remeber what that is.....
    Good Luck
    Dave.
    null

Maybe you are looking for

  • Video transfer from lumia 920 to pc

    My problem is still unsolved, I have downloaded videos and I want to transfer them to my PC using window 7 operating system. Can someone please help me what to do????

  • How do i change the white background with the new ios7?

    I just upgraded my iPad mini to iOS7 and now my videos are not titled, or the letters are white and are invisible against the new white background. How can I change this??

  • [Solved] WPA connection problems - network was WEP encrypted.

    Hi all, and thanks in advance for reading. Tl;dr for the below: My card seems to work, but won't associate with the router using either netcfg or wpa_supplicant and I have no idea why. I have no graphical system to work from as yet. Basically, I've j

  • Is it possible to run a compiler in a java app?

    Hey guys and girls, I was wondering if it is possible to compile a java or cpp or c or python or ruby... app inside a java aplication. If you sellect a file and match it to the propper compiler can it compile? I know you would need to have the compil

  • Why won't Logic work

    I upgraded to Maverick from Mountain Lion. I erased my HD. Now I'm reinstalling programs. I tried to reinstall Logic and now I get a message saying PowerePC applications are no longer supported. What is this?