Updating across a database link

Our App Ex is on a 10g database, but I'm updating a table on a 9i database. If I try to use bind variables, ie values directly from the AppEx form or :APP_USER, I get the following error:
ORA-01461 -
can bind a LONG value only for insert into a LONG column
I don't have any long values: the table fields are varchar2, and the form fields are text.
We've got round the problem by feeding the form fields into declared variables, and updating the table from those variables
Is this a known bug? Is it because it's a db link, or because the dbs are different versions?
Any ideas, anyone?

It's not doing anything sophisticated.
Table is doc_products_lookup,
The fields I'm updating are
PRODUCT_DESCRIPTION NOT NULL VARCHAR2(40)
LAST_UPDATED_DATE NOT NULL DATE
LAST_UPDATED_BY NOT NULL VARCHAR2(20)
SQL was
'update doc_products_lookup@[viewname]
set PRODUCT_DESCRIPTION = :P30_DESCRIPTION,
LAST_UPDATED_DATE = sysdate,
LAST_UPDATED_BY = :APP_USER
where product_code = :P30_CODE;'
the :P30 fields are described as text on the screen.

Similar Messages

  • Synonym across a database link

    Hi Oracle Gurus,
    Heres my requirement, -
    a] I have two databases ('x' & 'y').
    b] On x, I have two schemas ('a' & 'b'), while on 'y', I have
    only 1 schema ('c').
    c] I have created a synonym in 'b' for all the objects in 'c'
    using a database link.
    d] Now, on 'b', I am able to access the packages and tables
    (only select, - cant describe the tables, since this is not
    allowed). that belong to 'c' using the synonyms created.
    e] I am now having to create another set of synonyms in 'a'
    for the synonyms in 'b'. Essentially, the purpose is to
    access the objects in 'c', but not directly.
    Oracle is complaining here saying that it does not have
    access to creating these synonyms.
    It appears, the first level of synonym across a database
    link is acceptable, but not the second level
    Is there any solution for this? I do have a constraint
    because of which I am not being able to create a synonym
    from a directly to c.
    Graphically..
    DB x DB y
    Schema a
    |
    Synonym for synonyms in b (to access objects in c)
    Oracle doesnt allow me to create this.
    |
    v
    Schema b <--Synonyms using DBLINK--> Schema c
    No problems
    I would appreciate any help on this issue.
    Thanks
    Ravi Kumar

    When you say "Oracle complains" I assume you're getting an error message. If you'd told us what it is that when help with the diagnosis. However, I going to guess that it's ORA 4043. This is because you can only create synonyms for objects like tables or views, you cannot create a synonymn on a synonym.
    (pedantically you can create those synonyms - that's because Oracle allows you to create synonyms for tables that don't exist - you just can't use them).
    rgds, APC

  • How to release FSG reports without using Program - FSG Transfer across a database link

    Hi,
    Our project development team have built some reports to meet the requirements of the business customer using Financials Statement Generator (FSG) as part of an implementation of Oracle E-Business Suite (EBS) release 12.1.3.
    We know we can use the Program - FSG Transfer across a database link to move the reports from development to another environment.
    Oracle General Ledger User's Guide
    Copying Report Objects From Another database (FSG Transfer Program)
    http://docs.oracle.com/cd/E18727_01/doc.121/e13627/T312864T313620.htm#I_tx2Dfsgx2Dimpex78
    However our production environment is on a different network. Therefore this solution will not work since a database link cannot be created from production to the non production databases. Obviously I am asking the network solution architects to consider how to join the networks but do'nt hold out much hope. Has anyone got an alternative solution?
    FYI We have considered extracting the report definition, row sets, column sets etc from the back end database tables then transforming that into end user key strokes to simulate what someone would do to create such a report from scratch using the front end forms using a tool such as data loader which I believe has no licence cost implications. We dont have a lot of time so would be interested to know if anyone had any success with an alternative method such as this.
    P.S. I had found this question asked already by someone else but without an answer so i am trying again today.
    Transfer FSG Report without using FSG Transfer program.

    Look here for a potential way: Re: Calling table function on remote server - possible?

  • Can clob columns be selected across a database link (synonym)?

    Hello,
    I would like to do something like this...
    insert into archive_table (id, msg, start_date)
    select id, msg, startdate from synonym_table
    where start_date < whatever;
    ...where msg represents a clob column and synonym_table represents a synonym in the current table space which accesses another Oracle table using a database link.
    Is this possible?

    http://asktom.oracle.com/pls/ask/f?p=4950:8:15261108079829288196::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:950029833940

  • OWA_UTIL and HTP across database link

    Has anyone figured out how to use the features of OWA_UTIL, such as listprint, across a database link? I can create a drop list on data that is in the portal instance. But if I try to create a list based on a table in a back-end database through a database link, it generates errors.
    Also, I create a procedure to generate a dynamic page portlet using htp calls and it works fine if the procedure is located in the portal instance. But move the code to the back-end database and access via a synonym and database link and it generates errors out of the owa_util package.

    Create a view on your local db using tables over the db link and base your list on that view.

  • Unable to execute Map from Database link

    Hi
    Been trying to research this issue but have had no luck in finding an answer. Here is the situation:
    We have an apex application that resides on database "A"
    Our OWB Design Repository (11.1.0.7) and Runtime Environment both exist on database "B"
    Maps exists and execute under normal procedures as the "ETL" user on database "B", However we would like to allow the "APEX" user to execute a map from database "A" across a database link to a user that can execute the map without any issue.
    When we try to execute the map across the database link from toad or sqlplus we get no error returned, the procedure runs and kicks off a map execution (as seen in ALL_RT_AUDIT_EXECUTIONS) or from the control center executions. However the Map execution immediately fails with no explanation as to why??
    what makes even less sense is that the user on database "B" that the database link connects to.. can execute the same procedure all day long if logged directly into database "B".. but the moment you try to call it across the database link.. it errors with no message as to why.
    We are calling the "WB_WORKSPACE_MANAGEMENT.SET_WORKSPACE".. so that is not the issue.. I am assuming this is either a bug.. or we are missing an additional call/privilege. The user for the database link is a registered user in the workspace, obviously this works since the database link user can run the procedure if logged in locally to database "B"
    Any thoughts???

    Figured out our problem..
    Found RETURN_CODE column in ALL_RT_AUDIT_EXECUTIONS table.. point to -2064 which is an ora-2064
    NOTE 1026597.6 - CALLING REMOTE PACKAGE RECEIVES ORA-2064 explains that a commit is issued in a coordinated session from an RPC procedure call with OUT parameters or function call. Action: simplify remote update statement.
    The problem here is that "Commit Control" was set to Automatic for the mappings we were calling. Oracle does not like when a transaction is initiated on database "A" and has a commit issued on database "B" from the map.
    Makes sense.. we switched the commit control to "Manual" and are able to process correctly by issuing a commit from the session on database "A"
    Hope this helps anyone that runs into this issue themselves..

  • Database Links - Objects Unviewable

    Oracle SQL Developer 1.1 Patch 2
    When I connect to a database with my schema, I can see all my objects in the database, however, when I try looking at objects that I have access to in a different database through a database link...no objects show up. The database links are present in the database that I am connecting too, but I am unable to view other objects that I have access to through the database link? Is this a bug or do I not have the connection setup correctly?

    The best that you can get with the current functionality is to list the synonyms you have for the objects across the database link, assuming that you have created synonyms.

  • Problem using external database link.

    Help:
    Here is th problem I am having. I have a workflow that reads and writes to external datasource using HS services. The workflow reads and then writes to the HS datasource in a function. After the function completes it needs to close the database link. You cannot close the database link until the commit happens, which you cannot do in a function or you get an error. This is a catch 22. Do you have any suggestions?
    Thanks

    Hi,
    You could invoke your function as an autonomous transaction, and do a commit there. Not sure if that helps you close the database link or not.
    Alternatively, you could package the data to be transferred into a message on an AQ and propagate that data across the database link to the workflow system, and process it asynchronously.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Column reference over database link.

    Hi,
    Is it possible to reference a table column across a database link?
    Ex: var1 table.column%TYPE@dblink
    Thanks
    Chad

    Chad,
    Glad it worked ..
    Taking this thread a step further ..
    If you have the privileges to create synonyms then you could do the following:
    create synonym mySynonym
    for table@dblink
    Then use the synonym in the PL/SQL code as follows:
    var1 mySynonym.column%TYPE;
    This will avoid repetitive typing of table.column@dblink and if the dblink name changes then you have to make the change in only one place - the synonym
    Shakti
    http://www.impact-sol.com
    Developers of Guggi Oracle - Tool for DBAs and Developers

  • How to fetch,update,insert the data using database link on diff. servers

    I am using two oracle server.
    1st) Oracle 9i ( Server1 )
    2nd) Oracle 10g ( Server2 )
    3) Forms 6i
    I have created a database link on Server 1 for connecting to Server 2.
    I written a piece of code which will be executed in Forms 6i and is connected to Server1.
    The piece of code brings the data from SErver2 via cursor and I try to insert / update the relevant records
    in my Server1 database users.
    The Insert/Update runs sucessfully but at the time of commit I get the following errors
    in Forms ORA-01041:internal error. hostdef does not exist.
    Then it forcefully rollback the data and come out of the application.
    contact :email-id : [email protected]

    Suggest you test your code from sqlplus before running from forms.
    Start by testing a simple "select sysdate from dual@<database link>;" then test select from application_table@<database link> then test the insert/update code. After it works from sqlplus, then try it from forms.

  • I have a problem when update tables with a database link (APEX)

    Hi, I search answers for my problem and I not found a solution. My problem start when I open page with database link statement in APEX. I drop tables and execute this for update the tables in APEX.
    EXECUTE IMMEDIATE 'CREATE TABLE XXXXXXX
    AS
    SELECT A1,A2,A3
    FROM AAA@BBB';
    I use Mozilla Firefox and isn't always updated the tables because it shows dialog for downloading file "f". I rename the file to txt and I see the text "IBMPC/WIN_NT-8.1.0"...
    In the explorer always show a window only the text "IBMPC/WIN_NT-8.1.0"...
    What is the solution for my problem? I need update this tables.
    Thanks. John.

    It's easy. It doesn't work a database link, on apex, with a pl/sql code or store procedure.
    I saw that many people had the same problem but I don't see a solution.
    As I put up, I want to remove my tables on APEX and copy the table of my Oracle database with the update dates.
    The posts are from the same problem as my English is very bad, it got to help explain the problem.
    I have a page with a pl/sql code. This code in Oracle is correctly.
    For example, with this code I update the table PRUEBAS with the data of TABLEX.
    BEGIN
    BEGIN
    EXECUTE IMMEDIATE 'DROP TABLE "PRUEBAS"';
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    EXECUTE IMMEDIATE 'CREATE TABLE "PRUEBAS"
    AS
    SELECT AAA,
    BBB,
    CCC
    FROM TABLEX';
    END;
    But, in this code, I have the problem.
    BEGIN
    BEGIN
    EXECUTE IMMEDIATE 'DROP TABLE "PRUEBAS"';
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    EXECUTE IMMEDIATE 'CREATE TABLE "PRUEBAS"
    AS
    SELECT AAA,
    BBB,
    CCC
    FROM TABLEX@DB_LINK';
    END;
    I sometimes get an error. Sometimes it works fine, but half of the tries Apex returns "IBMPC/WIN_NT-8.1.0" in the browser and I am not using an IBM PC or Win NT...
    And i read that In the alert_xe.log file there are a error of core dump... ... :S or that the application return corrupt headers.... Is a problem of versions?
    I used a synonym and I have the same problem.      
    Even if I run the code on SQL COMMANDS (SQL WORKSHOP) it shows dialog for downloading file "f". I rename the file to txt and I see the text "IBMPC/WIN_NT-8.1.0"...
    The problem is in Mozilla Firefox and in IE.
    I have the OracleXE 10g (Application Express 3.0.1.00.08).
    And the question is.. ... ... ... ... What is the solution? :)
    Thanks.
    John.

  • How to [b]update[/b] [b]sdo_geometry[/b] field via [b]Database Link[/b]

    I need to update a geom field(defined as mdsys.sdo_geometry) of a remote table via database link,but I failed; This is the SQL statement and the error;
    update [email protected] set shape=mdsys.SDO_GEOMETRY(2002, NULL, NULL, mdsys.SDO_ELEM_INFO_ARRAY(1, 2, 1), mdsys.SDO_ORDINATE_ARRAY(2340411, 749349.375, 2340505.75, 749663.25, 2340571.75, 749924.813))
    where objectid=1;
    ORA-22804: remote operations not permitted on object tables or user-defined type columns
    How could I update geometry field of a remote table?
    Is there any method available ?
    Thanks!!

    Hi Percy,
    Oracle distributed does not support objects. If you are using 9i there might be just enough functionality to support what you want to do (replication required some distributed support, which might be enough for you).
    If it doesn't work then you may be out of luck with respect to distributed support, but you can connect to the remote database and update it that way.

  • 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

  • Database link failover on RAC

    Dear Friends.
    Could you please provide me the information about implementation of Database links failover in RAC. (Oracle 10g RAC on linux)
    I have created db links across the two RAC environments. Each RAC setup contains 2 nodes.
    I have created DB link across the two RAC environemtns.
    i.e I have created DB link between 1st node of Source RAC system to 1st node of Target RAC system.
    If 1st node of Target RAC system is down, I need to setup in such way that the link should failover to node 2 of Target system.
    I have tried all possible options of TAF. But I did not succeed. Is there anybody is implemented this type setup...?
    How to setup tnsnames.ora on source DB to get this type of failover.
    Thanks in Advance.
    Best Regards
    Kanumuri Raju

    Oracle was kind enough to provide some configuration details in their docco. You may want to review this link:
    http://download-east.oracle.com/docs/cd/B19306_01/network.102/b14212/advcfg.htm#sthref1275
    The configuration needs to be performed in the TNSNAMES.ORA associated with the database initiating the link. If you want bi-directional TAF, you would need to update the TNSNAMES.ORA for 'both' databases.
    I suggest you don't get your hopes up too high about the capability of TAF across DBLinks. I'm pretty sure you will not be able to get SELECT-based TAF. And I'm not absolutely sure which session rules will be used to determine the failover time.

  • Slow database link behaviour

    I've written an accouting program 15 years ago that runs on developer, with excellent performance overall. Now I'm trying to write an apex program that uses a database link to access the data on a 10.1.0.3.0 SE database. Two things are happening: 1) every once in a while, when I navigate on a view in an XE report (the usual "next 15 records" option,) apex asks if I want to "save" the file (f.bin) and then it gets real slow! Too slow for commercial use... I mean, it takes minutes to move between pages. 2) every two pages that I navigate, it gets really, really slow! It goes from the first page to the next fast; fast again; and then sloooow; fast, fast and then slow; fast, fast, and then: save the page. It is driving me nuts. I've tried using a 10g SE table@, I've tried using a 10g SE view@, and I've tried using an XE view on a 10g SE table - but I am having the same results... However, if I write an XE table, based on a 10g SE view, and do not use the database link, keeping everything local (using only the XE) - it gets very fast, and the strange behavour ends! I wanted to use a database link because it would be easier, much simpler to write the program, and very dynamic. If a have to transfer data between databases it will be much harder to do it.
    Any ideas? Has anyone come across such behaviour? Do you believe it could be a bad installation? By the way, the 10g SE runs on RHES4 and the XE runs on debian; I'am using apex 2.0. Thanks.

    An update on the problem: I've decided to go with the whole XE solution, and I wrote another application, that works just fine! It's normal, I mean, fast! That is, until I transfer data between databases - then it gets real slow until the user logs out. Interesting, isn't it? Later on I'll try the other way around, connecting to SE and transfering the data from XE. I am using something like:
    insert into table@dblink select * from table; delete from table;
    insert into table select * from table@dblink; delete from table@dblink;

Maybe you are looking for

  • IPad backup to time capsule via 3G network

    Is it possible to back up iPad data whilst on the road?

  • [Almost] Typical ClassNotFoundException

    I have the typical newbie problem with the ClassNotFoundException... only it's not quite that simple. First, I made the unfortunate choice to use Windows but I have been compiling and running programs from a Java 6 HowTo book successfully. One of the

  • Java card coding error...

    Hi friends, short[] temp = JCSystem.makeTransientShortArray((short)3,JCSystem.CLEAR_ON_DESELECT);      public void add(APDU apdu) {           byte[] buf = apdu.getBuffer();           short p1 = buf[ISO7816.OFFSET_P1];           short p2 = buf[ISO7816

  • ACR in Elements

    Can I open a jpeg image in ACR for editing using PSE 6. I can do this with CS3 but want to know if I can also do it with PSE 6 and if so how. Many thanks Sue

  • I My i phone stop working sudnly i have conect to PC but nothing maby What is The reason

    Dear Sir My Iphone Have Been stop working Without reason I dont Know From Where the problame pleas support me I need some help Thanks & regards Abdullah Mohammed 0558661803