Import data from PostgreSQL to Oracle

Good Afternoon,
I am doing a migration of data from a database PostgreSql for Oracle through a database link and using procedures to read the data and populate the Oracle tables. At the moment I found the following difficulty. What to bring data from one table PostgeSql that has a relationship with pg_largeobject. She returns the following error: ORA-22992 can not use lob locators selected from remote tables
My postgres and structure of the following:
eventresult (id bigint NOT NULL, version bigint NOT NULL, binary_data oid, value numeric (19,2) NOT NULL, event_id bigint NOT NULL, routine_id bigint NOT NULL)
pg_largeobject (oid NOT NULL loid, pageno integer NOT NULL, data bytea)
this relationship in binary_data (eventresult) with loid (pg_largeobject)
My oracle and the following structure:
+"EVENTRESULT" ("ID" NUMBER (19), "VERSION" NUMBER (19) NOT NULL, "BINARY_DATA" BLOB, "VALUE" NUMBER (19, 2) NOT NULL, "event_id" NUMBER (19) NOT NULL, "ROUTINE_ID" NUMBER (19) NOT NULL)+
I created the following procedure to perform the population:
create or replace
THE PROCEDURE ADDEVENTRESULT
count_add INTEGER;
count_add_aud INTEGER;
count_origen INTEGER;
count_origen_aud INTEGER;
BEGIN
SELECT count (*) FROM INTO count_origen "eventresult" @ koala;
SELECT count (*) FROM INTO count_origen_aud "eventresult_aud" @ koala;
SELECT count (*) FROM INTO count_add eventresult;
SELECT count (*) FROM INTO count_add_aud eventresult_aud;
if (count_add <= 0) THEN
Pgsql_eventresult FOR IN (SELECT * FROM "eventresult" ORDER BY @ koala "binary_data")
LOOP
INSERT INTO eventresult (eventresult.id, eventresult.version, eventresult.binary_data, eventresult.event_id, eventresult.routine_id, eventresult.value)
VALUES (pgsql_eventresult. "id", pgsql_eventresult. "Version", pgsql_eventresult. "Binary_data" pgsql_eventresult. "Event_id" pgsql_eventresult. "Routine_id"
pgsql_eventresult. "value");
END LOOP;
SELECT count (*) FROM INTO count_add eventresult;
END IF;
if (count_add_aud <= 0) THEN
Pgsql_eventresult_aud FOR IN (SELECT * FROM "eventresult_aud" @ koala)
LOOP
INSERT INTO eventresult_aud (eventresult_aud.id, eventresult_aud.rev, eventresult_aud.revtype, eventresult_aud.event_id, eventresult_aud.routine_id, eventresult_aud.value)
VALUES (pgsql_eventresult_aud. "id", pgsql_eventresult_aud. "Rev" pgsql_eventresult_aud. "Revtype" pgsql_eventresult_aud. "Event_id" pgsql_eventresult_aud. "Routine_id"
pgsql_eventresult_aud. "value");
END LOOP;
SELECT count (*) FROM INTO count_add_aud eventresult_aud;
END IF;
Dbms_output.put_line ('Record EVENTRESULT were dropped in,' | | count_add | | 'from' | | count_origen);
Dbms_output.put_line ('Record EVENTRESULT_AUD were dropped in,' | | count_add_aud | | 'from' | | count_origen_aud);
ADDEVENTRESULT END;
Using Oracle 11g
Could anyone help me solve this probema. Thank you very much.

Hello;
One option might be :
PostgreSQL Database Link to Oracle Database
http://vibhork.blogspot.com/2011/05/postgresql-database-link-to-oracle.html
Best Regards
mseberg

Similar Messages

  • Import data from postgreSQL into SQL server 2005

    I am trying to import one table from postgreSQL to SQL Server 2005 using sql server import and export wizard. When i test the connection after providing data source, location, username, password in the Data Link Properties section I get the message "Test Connection Succeeded". As soon as i press next to go onto next step i get the following error.
    TITLE: SQL Server Import and Export Wizard
    Cannot get string literals from the database connection "Provider=PostgreSQL.1;User ID=sa;Data Source=localhost;Location=TestMasterMap;Extended Properties=".
    ADDITIONAL INFORMATION:
    Object reference not set to an instance of an object. (DTSWizard)
    BUTTONS:
    OK
    I have tried all sorts of different combinations for these properties but it always fails on this step. Can anybody help me with this?
     

    The settings above worked for a small table with 3 rows. Now when I try to import the bigger table which I wanted to import in the first instance I get following out of memory error. Anybody knows how to work around this. I have checked my task manager and more than half of my memory was still not used when I get this error.
    TITLE: SQL Server Import and Export Wizard
    Column information for the source and destination data could not be retrieved.
    "Query" -> [temporary].[dbo].[exporttable]:
                      - ERROR [HY000] Out of memory while reading tuples.;
    No query has been executed with that handle
    ADDITIONAL INFORMATION:
    ERROR [HY000] Out of memory while reading tuples.;
    No query has been executed with that handle (PSQLODBC.DLL)
    BUTTONS:
    OK

  • Import data from 10g to oracle 9i

    hi,
    how can i import data fom 10g to 9i R2?

    Follow this thread :
    exp/imp between 10g and 9i
    Essentially, you must
    1. Install a 9i server or administrative client environment.
    2. Configure SQLNet connectivity (tnsnames.ora) to the 10g database.
    3. Run exp from the 9i environment, connected to the 10g database.
    4. Create a 9i export dump file.
    5. Import this into your 9i target database.
    If you have different charactersets, you must be mindful of the setting of NLS_LANG in the environment that you run "exp" and "imp" in.

  • Importing data from MS-Access into Oracle 9i

    I want to import data from access into oracle 9i. I already contain the same data in Oracle but these Access files contain updates and additional data to the existing data . So i need help to import in such a way that origional data remain same just addional data and updates come from MS-Access.

    Hi,
    You can achieve this by using the SQL Loader, which will help you out to load the data.
    For further reference check the below link
    http://lbd.epfl.ch/f/teaching/courses/oracle8i/server.815/a67792/ch05.htm#1261
    As you said that you have existing data in the table and you have Update's too. you have the Options like
    APPEND which you will useful to add the new records.
    - Pavan Kumar N

  • Data From Excel to Oracle

    Hi, how can I do a Stored Procedure or free code to import data from Excel to Oracle Table? Tanks for all.

    I never use UTL_FILE. I use Delphi and I need to make a subrotine to import xls file to oracle. So, I prefer to do into DataBase, using database resource, but I do not oracle expertise, I have some difficulties. Tanks.

  • Sql loader loading data from legacy to Oracle

    Hi
    we have a requirement that we need to import data from legacy to oracle AR.We know that we need to put the data file in BIN folder,but I want to know about the data file source if we place in windows folder instead of BIN directory will SQL loader picks the file and loads the data.
    Thanks
    Y

    Yes,
    Refer this
    http://www.oracle.com/technology/products/database/utilities/htdocs/sql_loader_overview.html
    * Load data across a network. This means that a SQL*Loader client can be run on a different system from the one that is running the SQL*Loader server.
    * Load data from multiple datafiles during the same load session
    * Load data into multiple tables during the same load session
    * Specify the character set of the data
    * Selectively load data
    * Load data from disk, tape, or named pipe
    * Specify the character set of the data
    * Generate sophisticated error reports, which greatly aid troubleshooting
    * Load arbitrarily complex object-relational data
    * Use either conventional or direct path loading.
    -Arun

  • Import data from a Fixed Length File into Oracle database

    Hi,
    I would like to import data from a Fixed Length text file into a table using HTML DB application.
    As of now, i have a .sql file(that uses external table) to import the data into Oracle tables
    I would like to integrate this in my HTML DB application so that the user can directly import the data into the table.
    Sample data
    XXXYYYYZZZZZ
    Data should be read to table that has
    Col1 Col2 Col3
    XXX YYYY ZZZZZ

    Hi,
    I would like to import data from a Fixed Length text
    file into a table using HTML DB application.AFAIK, fixed length imports are not something you can do directly with the HTML DB tools or available APIs.
    As of now, i have a .sql file(that uses external
    table) to import the data into Oracle tables
    I would like to integrate this in my HTML DB
    application so that the user can directly import the
    data into the table.Any fixed-length data needs to have a specification associated with it that indicates which character position begins a new column and what each column represents. Some also include what datatype should be used for each of those.
    If you really want to do this I would suggest that you create a table that you can store the file spec in. It would probably have columns for field name, start position, length or end position, datatype and any alias/column name you might want to apply. You would then use this table in a PL/SQL procedure (probably a package with the main processing procedure and various supporting procedures/functions) to read the file into memory, apply the file spec to each line and then do inserts into your table.
    Obviously, this is just a concept or strategy. Implementing it will depend on your PL/SQL skills and determination. If you want to pursue this strategy I'm sure you can find some jump-starts by doing a search on the PL/SQL forum.
    This may not sound like an answer - but the answer is you need to code it to fit your requirements. Hope that helps.
    Earl

  • Using Oracle Forms Importing Data From SQL Server into Oracle Tables.

    Dear All,
    We are using Oracle Forms 10g in windows XP and having OAS 10g and Oracle database 9i.
    How can we import data from SQL Server 2005 into Oracle tables using Oracle Forms?
    Thanks & Regards
    Eidy

    I have no idea what "Oracle Hetrogenius Services" is, so I can't help you with that, sorry.
    SQL Developer might also assist you. SQL Developer can connect to SQL Server as well as Oracle and has some tools for migration. See the documentation for details:
    http://download.oracle.com/docs/cd/E12151_01/doc.150/e12156/toc.htm
    For additional help on using SQL Developer for this task, please consult Support or the SQL Developer forum: SQL Developer
    Hope this helps,
    Jacob

  • I need to import data from a CSV file to an Oracle table

    I need to import data from a CSV file to an Oracle table. I'd prefer to use either SQL Developer or SQL Plus code.
    As an example, my target database is HH910TS2, server is ADDb0001, my dB login is em/em, the Oracle table is AE1 and the CSV file is AECSV.
    Any ideas / help ?

    And just for clarity, it's good to get your head around some basic concepts...
    user635625 wrote:
    I need to import data from a CSV file to an Oracle table. I'd prefer to use either SQL Developer or SQL Plus code.SQL Developer is a GUI front end that submits code to the database and displays the results. It does not have any code of it's own (although it may have some "commands" that are SQL Developer specific)
    SQL*Plus is another front end (character based rather than GUI) that submits code to the database and displays the results. It also does not have code of it's own although there are SQL*Plus commands for use only in the SQL*Plus environment.
    The "code" that you are referring to is either SQL or PL/SQL, so you shouldn't limit yourself to thinking it has to be for SQL Developer or SQL*Plus. There are many front end tools that can all deal with the same SQL and/or PL/SQL code. Focus on the SQL and/or PL/SQL side of your coding and don't concern yourself with limitations of what tool you are using. We often see people on here who don't recognise these differences and then ask why their code isn't working when they've put SQL*Plus commands inside their PL/SQL code. ;)

  • Import data from oracle database table into csv file

    Hi
    I have to import data from a table into a csv file. Could anyone suggest the best method to do it? My application is JSP as frontend and have put business logic in servlet.
    Thanks in advance.

    FastReader from wisdomforce will help you quickly export data into csv file. http://www.wisdomforce.com
    fastreader can be called and executed as an external process ( Runtime.exec(..) ) to extract data from Oracle tables into flat file

  • How to import data from excel or csv files to Oracle table

    hello everybody,
    I am new here and new in Oracle. I would like to know the steps how to import data from excel or csv files to Oracle table.
    Let say I already have table inside the Oracle. Then my user give me the sets of data inside the Excel Worksheet.
    So, how can I import the excel data into Oracle table.
    Thank you in advance.
    cheers,
    shima

    Even easier. Download JDeveloper 11G from this site.
    Set up the database connection, right click on the table, select Import->Excel and specify your file to load it. On the import pop-up, you must view and update each tab indicating Columns, Data Types, and DML.
    Columns -- move the selected columns that you want to load to the box on the right
    Data Types -- select column name from second column to which the data for each column of the import file should load
    DML -- click this tab to generate the INSERT SQL
    Once done click 'Insert'

  • Shifting data from PostgreSQL database to Oracle database

    hello folks,
    as i want to have an environment of many database servers of PostgreSQL databases on linux redhat 8.0 and one main database server of Oracle 8.1.7.0.0 on linux redhat 8.0;so that transections may go on PostgreSQL databases and Oracle database server would be used as a central repository to facilitate our data warehousing needs,I want to know how to shift data from PostgreSQL database to an Oracle database at the end of the day.What to do? From where can i get its documentation.
    Any suggestion would be highly appreciated.
    Regards.
    Muhammad Umar Liaquat.

    Since you're going to want to move the data regularly, I'd suggest looking into the Oracle Transparent Gateways (Heterogenous Services). This should let you create database links in Oracle that connect to each of the PostgreSQL databases. Then, you just have to write the appropriate select/insert statements.
    Justin

  • Importing data from Microsoft excel file to Oracle Database with Multiple Data Tables. Need expert advice and guidance

    I posted a query on Importing data from Microsoft Excel to Oracle Database (Multiple Data Tables). I got some answer and reference from the forum.
    I presented to my Oracle consultant and representative from Oracle Malaysia. They said impossible. I do not believe what they said. I do believe can be done.
    Can someone help or direct me to an expert that can help me on this

    e90f478a-c529-4c48-b189-51eebeaed477 wrote:
    I posted a query on Importing data from Microsoft Excel to Oracle Database (Multiple Data Tables). I got some answer and reference from the forum.
    I presented to my Oracle consultant and representative from Oracle Malaysia. They said impossible. I do not believe what they said. I do believe can be done.
    Can someone help or direct me to an expert that can help me on this
    We don't know the "query on Importing data from Microsoft Excel to Oracle Database (Multiple Data Tables). "
    We don't know where you posted said query.
    We don't know what "some answer and reference" you received "from the forum."
    We don't know what it was that your "Oracle consultant and representative from Oracle Malaysia" said was "impossible".
    So on what basis are we supposed to "help or direct" to "to an expert that can help "?

  • Migrate data from PostgreSQL 7.2 to oracle 9i on Linux

    Kindly guide me on how to migrate data from PostgreSQL 7.2 to oracle 9i on Linux. Please provide me a performance comparision between Orcle 9i on Linux and on windows 2000
    thanks

    Hi Geo
    We do not currently have tools to support Postgres to SQL migration. However, there are tools currently under developement which may help you in the future. In the meantime, there are some useful articles on postgres.org web site. See http://archives.postgresql.org/pgsql-sql/2002-10/msg00352.php
    We do not have comparison docs bertween Oracle on UNIX and Oracle on Windows as the the main code base is identifical. There are some artchitectural changes on windows where Oracle background processes have been implemented as threads and are installed as Windows services. More information on the architectures on both platforms can be found on the following sites:
    Oracle on Windows
    http://otn.oracle.com/tech/windows/index.html
    Oracle on Linux
    http://otn.oracle.com/tech/linux/index.html
    http://oss.oracle.com
    cheers
    Jan

  • Data from Excel to Oracle DB

    Hi,
    I can upload data from excel to access having created stored procedure on access.
    I do the upload using my vb code.
    How can I upload data from excel to oracle db? could i use the same technique as above? only problem is im not sure if that vb code will work with oracle?
    has anyone done this before? anyone have example code?
    kindly assist me here
    thanks

    The easiest way to do this is to use a Oracle ODBC connection which can be found on OTN. You do not need a stored proc.
    After installing Oracle ODBC on the machine where Excel and Access live, do the following.
    Note, you already have steps 1, 2 and 3. I list all the steps for others.
    1. Create your MS/Excel workbook
    2. Add data to it.
    3. Save it as "book1.xls".
    4. Open MS/Access
    5. Create new blank database, call it db1.
    6. Then from the file menu, get external data, import, make sure the file type is xls, select book1.xls.
    7. The wizard will walk you through the process of importing you Excel workbook into a new table.
    8. Save
    9. From the file menu select export table.
    10. Select ODBC at the bottom of the "Save as type list".
    11. Then (depending how you set up ODBC) select Machine Data Source.
    12 . Select your Oracle ODBC connection and press OK.
    You now have taken data from Excel to Access and placed it in the Oracle schema that was named when you setup your Oracle ODBC connection.
    BG...

Maybe you are looking for

  • How can I re-link multiple "missing" files from my iTunes without doing each one manually?

    All of a sudden, hundreds of my songs can't be played because iTunes can't find the files.  They are all still on my computer and I can link each of them manually, but that would take days!  Is there a way to re-link multiple files at once?

  • Which USB superdrive is compatible with Macbook Pro 2009?

    Have an old 2009 Macbook Pro running Mavericks and it seems the Superdrive is slowly dying. I've tried cleaning it. If I were to buy an external USB superdrive, which model is compatible?

  • Can't view slideshow once site is published

    Hello-does anyone have any advice on this. I published my website and then went to view it to find that it would not let me view the slideshow or click on a photo to enlarge. A box came up saying this...Firefox can't open because it cannot read the p

  • Syncing Issues with iTunes - 2012 bug?

    I plugged my iPhone 4 into my mini Mac last night to charge before I went to bed.  Both my iPhone and iTunes have the most current software.  When I got up this morning I saw that iTunes had failed to sync with my iPhone.  As a result, my iPhone is u

  • Late 2008 MacBook Pro "blackout" screen flickering - Revised

    --NOTE: I have written this thread as a continuation of the following thread, as the solution in it is slightly different from my issue. I apologize to the community for the confusion. http://discussions.apple.com/thread.jspa?threadID=2230532&tstart=