Create View from Database Links - Question

Question
I'm missing something simple.
I'm trying to create a view, from a Database Link.
CREATE VIEW view_name
AS SELECT a.*
FROM schema.tablename@dblink a;
When I run this in the SQL Commands window.
I get this error message.
ORA-00933: SQL command not properly ended
What am I missing? Any help is appreciated...

<i>CREATE VIEW vw_name
AS SELECT a.*
FROM [email protected] a;
</i>
<br>
1) User (schema) which is creating view must have proper db_link to source database. For that try this for testing purpose:
select 1 from [email protected]<br>
If this fail then db_link is not ok! This step is absolute must to go any further step to!!!
<br>
2) when db_link is set, then your view should be named as:
CREATE VIEW vw_name
AS SELECT *
FROM <b>schema_name</b>.[email protected];<br>
please pay attention to "schema_name", because from remote side every table is in some schema so it really need declaration of owner schema.
<br>
Hope this helps...

Similar Messages

  • Database Link question ! Please help me ....

    Hi everybody,
    I have some question about database link.
    For example, I have 3 database, database 1 and database 2 connect together by database link db_link1, database 2 and database 3 connect together by database link db_link2.
    I want to ask: Can I connect from database 1 to database 3 ? ( Of course don't use database link between database 1 and 3, just use database db_link1 and db_link2 )
    Both db_link1 and db_link2 are public database link.
    Can I restrict user access by 2 these public database link ?
    Thanks a lot.

    A database link has directionality-- it connects from one database to another database. It is not a bi-directional link.
    Assuming db_link1 exists in database 1 and connects to database 2 and db_link2 exists in database 2 and connects to database 3, it should be possible to read data that is in database 3 from database 1 without creating a new database link. But you'd need some sort of intermediate layer in database 2 (i.e. a view in database 2 that queries an object in database 3) because you can't nest database links in a single SQL statement. Of course, you would almost never actually do this for a variety of reasons. The only time I've ever heard of someone using this sort of setup is if database 1 is a very recent version of Oracle and database 3 is a very very old version of Oracle such that a database link between 1 and 3 is not possible.
    If you create a public database link, you cannot restrict access to that link short of potentially doing something with VPD. If you're creating a database link using a fixed username & password that would create a security issue, it would make far more sense to create private database links.
    Justin

  • "Create Application from Database" and BLOB type

    Hi all,
    I see many threads about BLOB type but my question is related to the Flex Builder built-in feature "Create Application from Database".
    Is there a way or a sw version to automatically use MySQL BLOB types when creating a PHP/database application?
    Thank you!

    Hi Dave,
    Would you please file a bug with all the necessary details
    regarding this issue? The bug base is found at:
    http://bugs.adobe.com/jira.
    We’ll look into this. Thank you for letting us know!
    Lacra

  • Flex / Data / Create Application from Database

    Hi, I had a question,
    When I create an application from a Database (Flex / Data /
    Create Application from Database).
    Can I modify the coded to convert it into a module?
    I have a main application that I would like to load the
    Database as a module. I tried replacing the <mx:Application>
    Tags to Module but didn't work...
    Thanks.

    Hi,
    no. no answer as yet. Seems to be a connection issue with the
    Windows 2003 Server, although all the seetings are correct.
    I installed WAMP Server 2.0 locally to see if I can get the
    project running locally, and it works fine. I can connect no
    problem to the MySQL Database on my local PC. I might just have to
    migrate everything over manually once the project is
    complete.

  • After "create application from database"

    hi all,
    i succeeded to build server and client side code using "create application from database"
    now my question is: how to use these files to build my application?
    for example, i need an OlapDataGrid that works on joined tables, not on a single table...
    thank you all!

    Hi Dave,
    Would you please file a bug with all the necessary details
    regarding this issue? The bug base is found at:
    http://bugs.adobe.com/jira.
    We’ll look into this. Thank you for letting us know!
    Lacra

  • Create app from database doesn't work

    hi all, i am new to developing in flex, and just set up a
    test-database (php, mysql) - i created a php project, and when i
    choose data->create application from database nothing happens
    ... just nothing ... any help would be very much appreciated, i am
    sure it's a no-brainer, but i just can't figure it out at this
    stage ... i run a full version of flex 3 pro

    Did you check the online documentation ? [http://help.sap.com/abapdocu_70/en/ABAPIMPORT_MEDIUM.htm#&ABAP_ALTERNATIVE_4@4@]
    I see your code has differences from the example provided in the standard documentation.

  • Create Application from Database and Air

    I have tried several time to use the create application from
    database for an air app build in flex. I do the same steps and the
    only difference is that I click the create button as air not web.
    It does not seem to work. Does the create application from database
    command (referencing php mysql) work with Air???
    Thanks

    Hi Dave,
    Would you please file a bug with all the necessary details
    regarding this issue? The bug base is found at:
    http://bugs.adobe.com/jira.
    We’ll look into this. Thank you for letting us know!
    Lacra

  • Create application from database issues

    Just trying out the 'Create application from database'
    feature and found the following.
    Running:
    Vista
    Flex Builder 3 Public Beta 2
    Visual Studio 2008
    - The wizard cant find the development web server so IIS is
    the only choice. I assume VS2005 & 2008 are different.
    - When validating the IIS option it would always fail until I
    enabled directory browsing (IIS 7).
    - When creating a SQL connection the wizard will not connect
    to a SQL 2005 named instance. Tried 'localhost\instance' and
    'hostname\instance' and get the following error.
    java.sql.SQLException: Unknown server host name
    'DMC\DEV2005'.
    at
    net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:364)
    at
    net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
    Dave

    Hi Dave,
    Would you please file a bug with all the necessary details
    regarding this issue? The bug base is found at:
    http://bugs.adobe.com/jira.
    We’ll look into this. Thank you for letting us know!
    Lacra

  • Getting Error ORA-00604 While Creating View from front Ent

    Hello All,
    I am getting ORA-00604 while creating view from the front end. And some time I get Maximum cursor open, It is ok amy be I am opening cursors in while loop. While ORA-00604 is giving lots of truble to me. In help it said to contact Oracle service, I dont know how to do that. Help me.

    Please post your view definition including the complete error_message and also the relevant parts of your code with the while loop.

  • Create view from multiple days tables

    Hi,
    I'm having existing oracle db with daily stat data, tables strangely named data_mon, data_tue, data_wed.. For my batch processing I plan to use view with multiple day data, let say for last 5 days.
    Not sure how better implement my sql statement, with those _mon suffixes to make it more or less dynamic.
    I also never create View from multiple tables, so probably I can do something that will add fresh daily data and delete 5 days old data?
    Will appreciate you comments on details and whole concept. I have prev sql server experience.
    Thanks
    T

    user12943718 wrote:
    Hi,
    I'm having existing oracle db with daily stat data, tables strangely named data_mon, data_tue, data_wed.. For my batch processing I plan to use view with multiple day data, let say for last 5 days.
    Not sure how better implement my sql statement, with those _mon suffixes to make it more or less dynamic.
    I also never create View from multiple tables, so probably I can do something that will add fresh daily data and delete 5 days old data?
    Will appreciate you comments on details and whole concept. I have prev sql server experience.
    Thanks
    TChange the data model so you don't have 1 table for a day.
    You just have a DATA table, and a column to denote the day of applicability.
    Then you don't need a view, don't need anything dynamic, don't need to smash your head against a wall for a simple query ... etc.

  • Views created from Database link over dg4msql has column type as long

    Hi All,
    I am reading some views from SQL server using dg4msql to Oracle database 11G r2.
    All working well except columns that are typically varchar2 are now of type LONG. This is causing issues given the wide range of restrictions of data type long.
    Is there a way that when I create a view in Oracle like:
    CREATE or replace view as v1 (
    select a1, a2, a3 from msqlserver_table@dblink)The columns don't come up as long but as varchar2??
    Problem is once its in long format, I can't change it to another format in a SELECT statement (like cast it as varchar 2 etc)\
    Thanks.
    Edited by: xarg-Xrc on Oct 3, 2012 7:26 PM

    Hi kgronau,
    Here is the output of the command
    NLS_LANGUAGE     AMERICAN
    NLS_TERRITORY     AMERICA
    NLS_CURRENCY     $
    NLS_ISO_CURRENCY     AMERICA
    NLS_NUMERIC_CHARACTERS     .,
    NLS_CALENDAR     GREGORIAN
    NLS_DATE_FORMAT     mm/dd/yyyy
    NLS_DATE_LANGUAGE     AMERICAN
    NLS_CHARACTERSET     AL32UTF8
    NLS_SORT     BINARY
    NLS_TIME_FORMAT     HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT     DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT     HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT     DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY     $
    NLS_NCHAR_CHARACTERSET     AL16UTF16
    NLS_COMP     BINARY
    NLS_LENGTH_SEMANTICS     BYTE
    NLS_NCHAR_CONV_EXCP     FALSE

  • Issue while creating location with database link

    Hi all,
    I am using OWB 10.2.0.4.0 (same Oracle DB version). I am trying to create a location using a database link.
    When I select the location which the database link is located (From location drop-down list), I face the following error.
    >
    ENV0036: The selected location is not valid.
    ENV0036: The selected location is not valid.
         at oracle.wh.service.sdk.integrator.RepositoryUtils.createDBLinkWithLocation(RepositoryUtils.java:156)
         at oracle.wh.ui.environment.wizards.DatabaseLinkComponent.init(DatabaseLinkComponent.java:61)
         at oracle.wh.ui.environment.wizards.DatabaseLinkComponent.reload(DatabaseLinkComponent.java:204)
         at oracle.wh.ui.environment.wizards.FromLocationComponent.itemStateChanged(FromLocationComponent.java:111)
         at javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1162)
         at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1219)
         at javax.swing.JComboBox.contentsChanged(JComboBox.java:1266)
         at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:100)
         at javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:88)
         at javax.swing.JComboBox.setSelectedItem(JComboBox.java:551)
         at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:597)
         at javax.swing.plaf.basic.BasicComboPopup$ListMouseHandler.mouseReleased(BasicComboPopup.java:749)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232)
         at java.awt.Component.processMouseEvent(Component.java:5100)
         at javax.swing.plaf.basic.BasicComboPopup$2.processMouseEvent(BasicComboPopup.java:452)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java:1606)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)
         at java.awt.Dialog$1.run(Dialog.java:542)
         at java.awt.Dialog$3.run(Dialog.java:569)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Dialog.java:567)
         at java.awt.Component.show(Component.java:1133)
         at java.awt.Component.setVisible(Component.java:1088)
         at oracle.bali.ewt.wizard.WizardDialog.runDialog(Unknown Source)
         at oracle.bali.ewt.wizard.WizardDialog.runDialog(Unknown Source)
         at oracle.wh.ui.owbcommon.OWBWizard.initialize(OWBWizard.java:815)
         at oracle.wh.ui.owbcommon.OWBWizard.<init>(OWBWizard.java:168)
         at oracle.wh.ui.owbcommon.OWBWizard.<init>(OWBWizard.java:147)
         at oracle.wh.ui.owbcommon.IdeUtils._doLaunchDefinition(IdeUtils.java:1188)
         at oracle.wh.ui.owbcommon.IdeUtils.showWizard(IdeUtils.java:471)
         at oracle.wh.ui.owbcommon.IdeUtils.showWizard(IdeUtils.java:427)
         at oracle.wh.ui.jcommon.tree.WBRepositoryObjectTree.launchWizard(WBRepositoryObjectTree.java:502)
         at oracle.wh.ui.console.commands.CreateByWizardCmd.showUI(CreateByWizardCmd.java:33)
         at oracle.wh.ui.console.commands.CreateCmd.performAction(CreateCmd.java:76)
         at oracle.wh.ui.console.commands.TreeMenuHandler$1.run(TreeMenuHandler.java:188)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:189)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:478)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    >
    Could you please let me know how to solve this and how to create such location with OMB*Plus?
    Thanks,
    Sebastian

    Hi David,
    Thanks a lot for the tip. Now I was able to use this and using a registered location.
    OMBCREATE LOCATION 'X' SET PROPERTIES (TYPE,VERSION,CONNECTION_TYPE, SCHEMA) VALUES ('ORACLE_DATABASE','11.1','DATABASE_LINK','MY_SCHEMA')
    OMBCREATE CONNECTOR 'REGISTERED_LOC/X SET PROPERTIES (DATABASE_LINK_NAME) VALUES ('MY_DBLINK') SET REF LOCATION 'X'
    OMBCOMMIT
    OMBCC '/MY_PROJECT'
    OMBCAC 'DEFAULT_CONFIGURATION'
    OMBCONNECT CONTROL_CENTER USE 'owb_user/owb_user'
    OMBREGISTER LOCATION 'X' REUSE
    OMBCOMMITBut now my question is the following.
    I am having problems to import the metadata from X.
    When create a module (source), I am able to make "data location" from location 'X' but when I want to import a table from location 'X' is not possible, because it shows as a plausible metadata location as "REGISTERED_LOC"
    Could you please let me know how to use 'X' as metadata location?
    Thanks!
    Sebastián

  • Database link question

    hello,
    the requirement is that schemaA of databaseA should be able to access tableB.schemaB (different schema) in databaseB. What type of database link is required here, public or private? Is it required to have a user called schemaA in databaseB with the same schema name?
    Firstly, I created the same user in databaseB called schemaA. That only created a user called schemaA and no schema.
    I then created a database link as schemA in database A, .
    CREATE DATABASE LINK DB9
    CONNECT TO schemaA IDENTIFIED BY password
    USING 'databaseB';
    I am now trying to issue in schemaA the following statement and it won't work.
    select * from tableB.schemaB@DB9
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-02063: preceding line from DB9

    Hi dembal,
    1. It's schema.table not table.schema.So your query should read: select * from schemaB.tableB@DB9.
    2. Your dblink connects to schemaA on DB9. So of course, you can't connect to DB9 and look for a table in schemaB.

  • Opening a view from a link

    Hi,
      I have a detail view(webdynpro) which I can open through a list report(webdynpro) or a link. The detail view opens successfully with data when I navigate from the list view. But when I pass the parameters through a link:
       I pass the parameters into the model attributes of the model in the following format:
    <b>Supp no : 80173621
    Start : 10/1/2005
    End : 10/31/2005
    Mail :  [email protected]
    Modif dt : 10/25/2005
    Modif tm : 7:32:21 AM</b>
    This is the same way in which I send the input values when i access this detail view from a list view(created in webdynpro).
    The input model attributes are getting populated succesfully, but after I execute the BAPI and invalidate it I am not able to view the output on the screen.
    Any pointers as to how I can resolve this?
    Thanks,
    Sunil

    Hi,
      There is no question of clearing the data here. I have 2 different applications: 1 of them opens the detail view through a list view (which works fine), another app has only the detail view which is opened through a link.
    I am passing the inputs to the model attributes which works fine.
    Also, I have tried invalidating before the BAPI call as well as after it. In both cases I am not able to view the output on the screen.
    Thanks,
    Sunil

  • Query builder: tables from Database Link

    Hi APEX people,
    Is there a way to use tables from a (remote) Database Link in the Query Builder?
    In the Query Builder I seem to have only access to locally (schema) stored tables.
    I already tried to define a Synonym for the remote tables I wanted to use, but that didn't work either.
    Thanks in advance.
    Maurice

    Hi,
    First of all, can you select from them ie
    SELECT  *
    FROM my_table@my_linkAlso you can't see them as tables in the schema because they're not tables in the schema.
    Try creating a view like...
    CREATE OR REPLACE FORCE VIEW m_table_vw AS
    SELECT *
    FROM my_table@my_link;You should be able to see the view in the schema in the query builder and use that.
    Cheers
    Ben

Maybe you are looking for

  • How to pass parameter from SSO login page to ADF application page?

    We have ADF-JSF application (running on AS 1013) that is being protected by OID running on AS 1012. SSO login page contains (among others) paramter ssousername and I wish to pass this to my ADF application. For the testing purpose I created ADF appli

  • How can i change Apple id on the administrator account?

    I recently got an imac with the mac mini. I am switching over to mac from being a lifelong pc user, so this is new to me. When i first set up the computer i put in the apple id with my email address, but it was the same one that i use for my ipad.  I

  • Partitions lost after ghost installation

    Hi Everybody ! My friend has  problem with his iMac. He wanted to install windows 7 on a separate partition. So, he created a second partition, and he use GHOST system to install windows 7 on the partition he created earlier. When windows installatio

  • Edit recoeds in JSP page

    hi am new to jsp can anyone help me regarding jsp.i hav to edit the records in the same jsp page and has to be updaed into DB.we are using MySqlServlets&hibernate,jsp for view.plz suggest me some idea. Thanks

  • IChat AV to 3G video phone?

    Are there any companies that link iChat AV calls to 3G videophones? I'm thinking along the lines of Skype with video.