Script Insert statement to extract data from Table in Oracle 7i

Hi all, I have an old Oracle legacy system that works for more than 15 years. Every now and then, we need to extract data from this table @ ORacle 7i to import to Oracle 10 G.

My thoughts are to create a script to Insert statements in oracle 7 and that, to be deployed to Oracle 10 G.

I found cela scripts in Google and don't know exactly how it works. No explanation on these scripts, would be greatly appreciated. I find that this format can help to produce a set of insert statements in this table to the last table to 10G.

< pre >
-Step 1: create this procedure:
create or replace function ExtractData (v_table_name varchar2) return varchar2 as
Boolean b_found: = false;
v_tempa varchar2 (8000);
v_tempb varchar2 (8000);
v_tempc VARCHAR2 (255);
Start
for tab_rec in (select table_name from user_tables where table_name = upper (v_table_name))
loop
b_found: = true;
v_tempa: =' select ' insert into ' | tab_rec.table_name |' (';
for col_rec in (select * from user_tab_columns)
where
table_name = tab_rec.table_name
order by
column_id)
loop
If col_rec.column_id = 1 then
v_tempa: = v_tempa | " ' || Chr (10) | " ' ;
on the other
v_tempa: = v_tempa |', ". Chr (10) | " ' ;
v_tempb: = v_tempb |', ". Chr (10) | " ' ;
end if;
v_tempa: = v_tempa | col_rec.column_name;
If instr(col_rec.data_type,'CHAR') > 0 then
v_tempc: = "' |' | col_rec.column_name |'| " ' ;
elsif instr (col_rec.data_type, 'DATE') > 0 then
v_tempc: = "' to_date ("'| to_char('|| col_rec.column_name||',''mm/DD/YYYY HH24 '') | ") (', "' dd/mm/yyyy hh24"') "';
on the other
v_tempc: = col_rec.column_name;
end if;
v_tempb: = v_tempb | " ' || Decode('|| col_rec.column_name||',''Null'','||v_tempc||') | " ' ;
end loop;
v_tempa: = v_tempa |') values ('| v_tempb |'); "from ' |" tab_rec.table_name | « ; » ;
end loop;
If not b_found then
v_tempa: ='-Table ' | v_table_name | 'not found ';
on the other
v_tempa: = v_tempa | Chr (10) | "select"-commit; "double;';
end if;
Return v_tempa;
end;
/
display errors

-STEP 2: run the following code to extract the data.
Go head
set pages 0
game of stripes on
fixed lines 2000
the feeding off value
trigger the echo
var retline varchar2 (4000)
coil c:\t1.sql
Select 'set echo off' from dual;
Select 'spool c:\recreatedata.sql' from dual;
Select ' select "-these data was extracted on" | TO_CHAR (sysdate, "mm/dd/yyyy hh24" ") double;' double.

-The following two lines as repeat as many times as the tables that you want to extract
exec: retline: = ExtractData ('dept');
print: retline;

exec: retline: = ExtractData ('emp');
print: retline;

Select 'off spool' from dual;
spool off
@c:\t1

-Step 3: run the updated c:\recreatedata.sql waiting for output to recreate the data.

Source: http://www.idevelopment.info/data/Oracle/DBA_tips/PL_SQL/PLSQL_5.shtml




< / pre >

Hello

Well what this script do.
You will pass a table name as input to the function that will return varchar2 (string - insert statement). It will generate 2 t1.sql of sql script that contains the output sequence.

Will use the first passed the user_tables scipt to check if the input table name exists and if there is the will reterive user_table_columns column names and generate the following sql script.
Now, this t1.sql will run to generate a final sript formally orders insert that will run you on the target schema (make sure that the table exists).

* #t1.sql*

set echo off
spool recreatedata.sql
select '-- This data was extracted on '||to_char(sysdate,'mm/dd/yyyy hh24:mi') from dual;
select 'insert into MY_OBJECT1 ('||chr(10)||'OWNER,'||chr(10)||'TOTAL) values ('||decode(OWNER,Null,'Null',''''||OWNER||'''')||','||chr(10)||''||decode(TOTAL,Null,'Null',TOTAL)||');' from MY_OBJECT1;
select '-- commit;' from dual;
spool off

Then @t1.sql runs, and the general insert for the infeed table table.

-- This data was extracted on 03/09/2009 23:39

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('MDSYS', 92800);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('TSMSYS', 256);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('DMSYS', 15104);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('TESTME', 128);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('PUBLIC', 2571392);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('OUTLN', 768);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('CTXSYS', 21888);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('OLAPSYS', 78336);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('KLONDIKE', 2432);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('SYSTEM', 51328);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('EXFSYS', 21504);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('DBSNMP', 4096);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('ORDSYS', 216192);

INSERT INTO MY_OBJECT1 (OWNER, TOTAL)
  VALUES   ('SYSMAN', 111744);

-- commit;

Hope this helps
Concerning

Tags: Database

Similar Questions

  • Extracting data from table without refreshment and without using the tab key.

    Hi friends,

    I have a problem I want to extract data from table without discount in the text field without using the Tab key. When I enter a field value any value then the text corressponding should enter into corressponding textfield without using the Tab key.

    for example. When I get back emp_id 101 in a text field then first_name and last_name, address would come in to the text fields corressponding without refresh and use the Tab key.

    How can I do that.

    Thank you
    Maury

    Hi Maury,

    I guess it's similar to: retrieving data without refreshing rather than Re: value of a textfield should enter into an another textfield without using the TAB ?

    If so, the only change you want to bring on the first is to use the parameter "Onkeyup" instead of "onchange" in the 'HTML Form attributes of the element' element.

    Note, however, that the user must move away from the issue at some point (for example, to click on a button), so the onchange will fire anyway.

    Andy

  • Extracting data from table.

    Hello and happy Friday.

    I'm reworking an instrument for an HP 662 X power driver.  We have four in the lab and I want to have a panel that writes the channel information and reads what the instrument setting are.  I have entries works fine, but I can't extract the data from the VI "read the voltage and current.  What I would like is the opposite of "build the Subvi where I can get a table and the elements come they channel to the next available line.  I have attached the control program which should give you a better understanding of what I'm trying to accomplish here.  Any ideas will be greatly appreciated.  The pilot, with that I started is one downloaded from NEITHER!

    Thank you

    Gary

    Also: why the property for the resource node VISA? Use a thread.

    Attached is a slight mod showing the use of a cluster instead of individual controls if you want to try it.

  • Extracting data from table using the date condition

    Hello

    I have a table structure and data as below.

    create table of production
    (
    IPC VARCHAR2 (200),
    PRODUCTIONDATE VARCHAR2 (200),
    QUANTITY VARCHAR2 (2000).
    PRODUCTIONCODE VARCHAR2 (2000).
    MOULDQUANTITY VARCHAR2 (2000));

    Insert into production
    values ('1111 ', '20121119', ' 1023', 'AAB77',' 0002');

    Insert into production
    values ('1111 ', '20121122', ' 1023', 'AAB77',' 0002');

    Insert into production
    values ('1111 ', '20121126', ' 1023', 'AAB77',' 0002');

    Insert into production
    values ('1111 ', '20121127', ' 1023', 'AAB77',' 0002');

    Insert into production
    values ('1111 ', '20121128', ' 1023', 'AAB77',' 0002');

    Insert into production
    values ('1111 ', '20121201', ' 1023', 'AAB77',' 0002');

    Insert into production
    values ('1111 ', '20121203', ' 1023', 'AAB77',' 0002');

    Insert into production
    values ('1111 ', '20121203', ' 1023', 'AAB77',' 0002');

    Insert into production
    values ('1111 ', '20130103', ' 1023', 'AAB77',' 0002');

    Insert into production
    values ('1111 ', '20130104', ' 1023', 'AAB77',' 0002');

    Insert into production
    values ('1111 ', '20130105', ' 1023', 'AAB77',' 0002');


    Now, here I want to extract the data with condition as

    PRODUCTIONDATE > = the current week Monday

    so I would skip only two first rows and will need to get all the lines.

    I tried to use it under condition, but it would not give the data for the values of 2013.

    TO_NUMBER (to_char (to_date (PRODUCTIONDATE, 'yyyymmdd'), 'IW')) > = to_number (to_char (sysdate, 'IW'))

    Any help would be appreciated.

    Thank you
    Mahesh

    Hello

    HM wrote:
    by the way: it is generally a good idea to store date values in date columns.

    One of the many reasons why store date information in VARCHAR2 columns (especially VARCHAR2 (200)) is a bad idea, it's that the data invalid get there, causing errors. Avoid the conversion of columns like that at times, if possible:

    SELECT     *
    FROM     production
    WHERE     productiondate     >= TO_CHAR ( TRUNC (SYSDATE, 'IW')
                              , 'YYYYMMDD'
                           )
    ;
    
  • wanted to extract data from nested table pl/sql Ref Cursor getting an erro

    create or replace type 'DEPT12' as an object (dno number (2), dname varchar2 (30), varchar2 (50)) loc;

    create or replace type dept_tab in the table in "DEPT12".

    create or replace type 'LOC12' as an object (locno number, loc_name varchar2 (100))

    create or replace type loc_tab in the table of "LOC12.

    create or replace type dept_loc_rec1 as an object (dept_tab, eno number, loc_dt loc_tab dept_dt);

    Create type dept_loc_tb as table of the dept_loc_rec1

    create table dept_loc_tb_bk1 (dept_dt dept_tab, eno number, loc_dt loc_tab)
    NESTED TABLE dept_dt
    STORE AS dept_tab12,
    NESTED TABLE loc_dt
    STORE AS loc_tab12




    insert into dept_loc_tb_bk1 values (dept_tab (dept12(3,'ABD','LOC')
    dept12(4,'ABD','LOC')
    (, dept12(5,'ABD','LOC')), 3, loc_tab (loc12(21,'AAB'),
    loc12(22,'AAB'),
    loc12(23,'AAB')));

    When I try to extract data from Ref cursor to pl/sql table that I get an error ora-06504: pl/sql: return types of the result set of variables or request do not match.
    I created a table nested, as well as the pl/sql nested table object dept_loc_tb and I said the same dept_loc_tb lv_dept_loc_tb, but trying to get in this variable we get an error above.

    Please anyone can solve my problem.
    -----------------
    declare
    type cr is ref cursor;
    cr_obj cr;

    lv_dept_loc_tb dept_loc_tb;

    Start
    Open cr_obj to select dept_dt, eno, dept_loc_tb_bk1 loc_dt;
    collect the fetch cr_obj in bulk in lv_dept_loc_tb;
    close cr_obj;
    end;

    Your query selects 3 distinct columns requires so 3 collections of matching types. You want to treat these 3 columns as an object of type DEPT_LOC_REC1:

    SQL> declare
      2  type cr is ref cursor;
      3  cr_obj cr;
      4
      5  lv_dept_loc_tb dept_loc_tb;
      6
      7  begin
      8  open cr_obj for select dept_dt,eno,loc_dt from dept_loc_tb_bk1;
      9  fetch cr_obj bulk collect into lv_dept_loc_tb;
     10  close cr_obj;
     11  end;
     12  /
    declare
    *
    ERROR at line 1:
    ORA-06504: PL/SQL: Return types of Result Set variables or query do not match
    ORA-06512: at line 9
    
    SQL> declare
      2  type cr is ref cursor;
      3  cr_obj cr;
      4
      5  lv_dept_loc_tb dept_loc_tb;
      6
      7  begin
      8  open cr_obj for select DEPT_LOC_REC1(dept_dt,eno,loc_dt) from dept_loc_tb_bk1;
      9  fetch cr_obj bulk collect into lv_dept_loc_tb;
     10  close cr_obj;
     11  end;
     12  /
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.
    P.S. discover sys_refcursor.

  • Extract data from database using php script and entry for datagrid.

    Hi all

    I intend to use the php script below to extract data from a database.

    I want to then display it in a datagrid control, the datagrid control has Ref columns job, the company and the position.

    The php script I have is

    <? PHP
    $hostname_conn = "localhost";
    $username_conn = "";
    $password_conn = "";

    $conn = mysql_connect ($hostname_conn, $username_conn, $password_conn);

    @mysql_select_db ("videochat");

    $query = "SELECT * FROM work."

    $result = mysql_query ($query);

    $row = mysql_fetch_array ($result);

    $ref = $row ["jobref"];
    $company = $row ['company'];
    $position = $row ["position"];

    echo "< Ref > $ref < / Ref >";
    echo "< company > $company < / company > ';
    echo "< location > $position < / location >."

    ? >

    Could someone show me how I chuck this data in a grid?

    Thank you

    Hello

    You should start using the authority, either zendamf which is used by the data wizards in flashbuilder 4 or with amfphp which is probably better than zend but has not all nicities such as the creation of objects of value.

    http://flashhub.NET/filter/

    This project uses amfphp, basically, it uses remoteobjects so returned php is in a ready to put directly into a grid or a datagroup arraycollection collection.

    If you need help with this sort of thing PM me and I can do a login session...

    the PHP services for calls used in the application

    <>

    class pets

    {

    var $db_host = "localhost";

    var $db_name = "flashhub_pets";

    var $db_user = "flashhub_david";

    var $db_pwd = "david";

    function pets()

    {

    Define the methodTable for this class in the constructor

    $this-> methodTable = array)

    "getPets"-online (table)

    'description' => 'Pets, database',

    'access' => 'remote '.

    )

    );

    }

    function getAllPets()

    {

    $mysql = mysql_connect ($this-> $this-> db_user, db_host), $this-> db_pwd;

    @mysql_select_db ($this-> db_name);

    $Query = "SELECT * from pet;

    $Result = mysql_query ($Query);

    return ($Result);

    }

    function getTypeOfPets ($category)

    {

    $mysql = mysql_connect ($this-> $this-> db_user, db_host), $this-> db_pwd;

    @mysql_select_db ($this-> db_name);

    $Query = "SELECT * from pet where CATEGORY = $category;

    $Result = mysql_query ($Query);

    return ($Result);

    }

    function getCategories()

    {

    $mysql = mysql_connect ($this-> $this-> db_user, db_host), $this-> db_pwd;

    @mysql_select_db ($this-> db_name);

    $Query = "SELECT * from category";

    $Result = mysql_query ($Query);

    return ($Result);

    }

    }

    ?>

    David

  • Extract data from the table on hourly basis

    Hello

    I have a table that has two columns date all the hours of the base and the response time. I want to extract data from the date corresponding previous hourly basis with the response time. The data will be loaded into the table every midnight.

    for example: today date 23/10/2012
    I want to extract data from 22/10/12 00 to the 22/10/12 23

    The sub query pulls the date as demanded, but I'm not able to take the time to answer.

    with one also
    (select min (trunc (lhour)) as mindate, max (trunc (lhour)) as AVG_HR maxdate)
    SELECT to_char (maxdate + (level/25), "dd/mm/yyyy hh24") as a LEVEL CONNECTION dates < = * (1) 24;

    Please help me on this.

    Try this

    SELECT * FROM table_nm
     WHERE to_char(hour,'DD') = to_char(SYSDATE-1,'DD')
    
  • extract data from a table to a text file

    I need to extract data from a table to a text file, I twist my output is the following...

    bash-3. $00 vi tap3roamercosts_20110915144318.txt
    lines of 'tap3roamercosts_20110915144318.txt' 393948, 23464348 characters
    ^ LAFGTD | N | 2011090203000001 | 13242514000064 | 1. 0 | 20. 41220 | 02-SEVEN.-11. 01-SEPT.-11. 0 | 13244
    755. 64. 70. 0093794428588 | 0093796234547 | 0 | S2 | E | 412200306902634 | 8. 1. 61500 | 16081 |
    | HW | Call to the Roamer. 0 | I have | Roaming billing Inroamer Plan | 1_0_1 | LKA | N_I_Independent
    the time of day. Rate of Roamer SMST systems | AFGTD20110902030000010001013242514000064 |
    |||||||||||||||||||||

    AFGTD | N | 2011090203000001 | 13242612000044 | 1. 0 | 20. 41220 | 02-SEVEN.-11. 01-SEPT.-11. 0 | 13244
    853. 44. 70. 234. 0093793252818 | 0 | S2 | E | 412200303198150 | 8. 1. 61000 | 12403 | HW | -Ro
    bitter call | 0 | I have | Roaming billing Inroamer Plan | 1_0_1 | N_I_Independent time of Da
    There | Rate of Roamer SMST systems | AFGTD20110902030000010001013242612000044 |
    ||||||||

    AFGTD | N | 2011090203000001 | 13242612000047 | 1. 0 | 20. 41220 | 02-SEVEN.-11. 01-SEPT.-11. 0 | 13244
    853. 47. 70. 234. 0093793252818 | 0 | S2 | E | 412200303198150 | 8. 1. 61000 | 12403 | HW | -Ro
    bitter call | 0 | I have | Roaming billing Inroamer Plan | 1_0_1 | N_I_Independent time of Da
    There | Rate of Roamer SMST systems | AFGTD20110902030000010001013242612000047 |
    ||||||||
    .
    .
    .
    .
    .

    Please help me how to format my output each record in simple lines in oracle sqlplus. Here are the settings I used...

    TERMOUT OFF SET;
    SET ECHO OFF;
    SET LINESIZE 100000;
    THE VALUE OF NEWPAGE 0;
    SET SPACE 0;
    SET PAGESIZE 50000;
    SET FEEDBACK OFF;
    SET THE OFF POSITION;
    SET TRIMSPOOL
    SET THE TAB

    And what was wrong with the answers that you have on your previous thread?

    How to extract data in a text file

    Please do not ask the same question again. If there is a problem with the answers provided, then continue on the same thread that tell people what is the problem.

    Saying that, this is another possibility for you...

    As user sys:

    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    /
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /
    

    As myuser:

    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      --
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;
    

    This allows the header line and the data to write into files separate if necessary.

    for example

    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    
    PL/SQL procedure successfully completed.
    

    Output.txt file contains:

    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10
    

    The procedure allows for the header and the data to separate files if necessary. Just by specifying the file name "header" will put the header and the data in a single file.

    Adapt to the exit of styles and different types of data are needed.

  • How to ETL extract data from database Oracle 11.1 using Cognos Data Manager 10.1

    Hello

    I need to run the IBM Cognos Data Manager 10.1 version ETL tool for extracting data from the Oracle11.1 database.

    My understanding is that, from the point of view of database, the best way would to have a stored procedure that will provide a reference cursor in the ETL client tool.

    However, a database procedure the ETL tool running seems not to be possible in this version of the data manager.

    If someone has done this before? What is the best way for this snippet to do?

    Thank you

    Emilija

    Annabelle says:

    My reading of original question: "What is the best way for this snippet to do?"

    Sorry - is NOT helping.

    The BEST way to extract data from a table is to use a SELECT statement.

    You said you want to do.

    So just repeat your original question instead of those that ask you to answer will not move forward us.

  • extract data from XMLType using vbscript on OleDB?

    Hello.

    We have a problem where the XMLType column data to get in 11.2.0.1 on Windows x 64 worked very well, but we have moved to 11.2.0.3 Patch 21 and the column type changed to binary storage default, and we started to do read errors when the data was greater than 32 k (or so it seems).

    I opened a SR, and Oracle support sent me a VB script to test playback of the table on OleDB.  However, their script doesn't seem to work as announced, so after a lot of gooling, came to us with the following to read a column of xmltype - not the same table, just to test that the vbscript works:

    REM need to re-register the dll OLEDB as there is a problem with the oracle client and the dll registration

    REM start following an administrator command prompt

    REM regsvr32.exe c:\Users\finite9\oracle\product\11.2.0\client_2\bin\oraoledb11.dll

    the con value = createobject ("adodb.connection")

    con. Open "provider = oraoledb.oracle; user id = finite9; password = password1; data source = TSTDB ".

    Set rs = createobject ("adodb.recordset")

    RS. Open 'select SW_REPLY changedate', con

    While not on the place. EXPRESSIONS OF FOLKLORE

    MsgBox rs. Fields ("ChangeDate"). Value

    RS. MoveNext

    Wend

    RS. Close

    Set rs = nothing

    con. Close

    the value con = nothing

    This works perfectly and displays 12 rows in this column in a vbscript dialog box, but I am not able to do to extract the XMLType column clob data.  I try with for example. RS. Open 'select REPLYDATA.getclobval () from SW_REPLY', stupid but just get errors.

    Is it possible to extract data from XMLType on OleDB with vbscript?  It cannot be OleDB itself which poses problem, because it has worked in our application and 11.2.0.1 although with < 32 k of data.  But it would be nice to have a working test case while we were able to test out our app.  If it is with vbscript or c# is irrelevant.

    ignore the message, it is possible.  Support of Oracle gave me this:

    the con value = createobject ("adodb.connection")

    con. Open "provider = oraoledb.oracle; user id = finite9; password = password1; data source = DEVTST ".

    Set rs = createobject ("adodb.recordset")

    RS. Open "select t.REPLYDATA.getclobval () as xmltestdata OF SW_REPLY t", con

    While not on the place. EXPRESSIONS OF FOLKLORE

    MsgBox rs. Fields ("xmltestdata"). Value

    RS. MoveNext

    Wend

    RS. Close

    Set rs = nothing

    con. Close

    the value con = nothing

    but there is a problem when xmldata exceeds a certain size.  small starters work well if.

  • Extract data from an xml file takes almost an hour to 2.5 M data.

    Hello

    Any help would be much appreciated. Extract data from an xml file takes almost an hour to 2.5 M. data is there a solution to this.

    WITH t AS
    (SELECT XMLTYPE (response) pass FROM dual
    )
    SELECT
    b.entity_id,
    c.INSTANCE_ID,
    d.attribute_id,
    d.DATA_TYPE,
    d.ATTRIBUTE_VALUE,
    d.outcome_style
    T,.
    XMLTABLE (XMLNamespaces ("http://schemas.xmlsoap.org/soap/envelope/" AS "SOAP-ENV"
    'http://oracle.com/determinations/server/10.3/rulebase/assess/types' AS 'type')
    , ' SOAP - ENV:Envelope / SOAP - ENV:Body / typ: assess-response/typ: global instance / typ:entity'
    PASSAGE t.col
    Path of COLUMNS entity_id VARCHAR2 (256) "@id".
    path XMLTYPE res_tmp2 'typ:instance') b
    xmltable (XMLNamespaces ("http://schemas.xmlsoap.org/soap/envelope/" AS "SOAP-ENV"
    'http://oracle.com/determinations/server/10.3/rulebase/assess/types' AS 'type')
    , "typ:instance".
    PASSAGE b.res_tmp2
    Path of COLUMNS instance_id VARCHAR2 (256) "@id".
    path XMLTYPE res_tmp3 'typ:attribute') c
    xmltable (XMLNamespaces ("http://schemas.xmlsoap.org/soap/envelope/" AS "SOAP-ENV"
    'http://oracle.com/determinations/server/10.3/rulebase/assess/types' AS 'type')
    , "typ:attribute".
    PASSAGE c.res_tmp3
    Path of VARCHAR2 (256) COLUMNS attribute_id '@id '.
    , data_type VARCHAR2 (256) path '@type '.
    , attribute_value VARCHAR2 (256) path '.'
    path VARCHAR2 (256) outcome_style '@inferred') d;

    Thank you
    Mhand

    OK, in this case the best option is to store the answer in a binary table of XMLType (may be a temporary table if you want to) and run the query from there:

    CREATE TABLE tmp_xml OF XMLType
    XMLType STORE AS SECUREFILE BINARY XML -- default storage in your version
    ;
    
    INSERT INTO tmp_xml VALUES(XMLType(response));
    
    SELECT b.entity_id,
           c.instance_id,
           d.attribute_id,
           d.data_type,
           d.attribute_value,
           d.outcome_style
    FROM tmp_xml t,
         XMLTABLE(
           XMLNamespaces('http://schemas.xmlsoap.org/soap/envelope/' AS "SOAP-ENV"
                        , 'http://oracle.com/determinations/server/10.3/rulebase/assess/types' AS "typ")
         , 'SOAP-ENV:Envelope/SOAP-ENV:Body/typ:assess-response/typ:global-instance/typ:entity'
           PASSING t.object_value
           COLUMNS
    ...
    
  • Query to extract data from source DB driver using process mapping pre...

    Hi all
    I have a source for the query to retrieve the data from the source database. Looking for suggestion what could be the best approach to extract data from the source database.using owb 11 GR 1 material.
    I'm in printing, create the process of mapping driver prerequisite for aid to perform immediate with Create table T1 as a sql query. Petition to the sides of the Insert into T1 Select * from Source_Table in the different database.

    Certainly, need to create Db users in the Source database, to get privileges to read the data of source_database.
    Is - this good aproach to or of any other alternative to achieve this.

    Means, create the table in the transit area (desired area, where I am) and using driver mapping process before you run the select query to retrieve data from a data source.

    Would apreciate your previous answer.
    Thank you
    MAK

    You can mark Correct or useful if it solves your purpose.

  • Extract data from graph XY

    Hello

    Here, I want to extract data from the XY graph. I joined vi which I use for table 1 d. How can I use this for 2D table VI.

    Thank you

    Hi Alex,

    You can use the same approach.

    The only thing that changes is the function ArraySubset in its adaptation to the 2D matrix. You can select rows or clumns of your data (depending on how you have generated them)...

  • Extract data from error HFM, float to Numeric?

    Hi all

    We extract data from HFM,.

    HFM-> SQL-> FILE staging

    Our mapping, flow, everything seems fine. When we run this out on the third market errors while extracting data with the following:

    com.hyperion.odi.common.ODIHAppException: arithmetic overflow error conversion float type numeric data.


    We researched and found to increase the logical length should solve this problem.

    Our Source has a length of 16...

    We have increased the logical length of target from 16 to 30, and he rest-error. We even tried 50, 100 for the logical length.

    We are at Version 10.1.3.6.0.

    Any suggestions on how to fix this?

    Thank you!

    Published by: user10678366 on May 22, 2013 13:28

    Have you tried changing the scale of all the columns float, right?

    It can be a ridiculously large number coming from HFM. So, go to store for your data source in ODI and manually change the data type of column type VARCHAR of size like 100 or more. That would force the ODI to create the staging table with columns of characters for the field. Data will be retrieved anyway. Given that you write it in file, type of character should not matter. In addition, if writing to the file fails for any reason, you can do a max on the staging table and find the value problem in the table (while in HFM, you may not be able to do).

  • How to extract data from SQL server in the FDM

    Hi Experts

    How to extract data from a SQL server HFM to another SQL Server using scripts for integration in FDQM?

    concerning

    Dev

    Could you clarify why you want to do this?

    If you try to synchronize two databases (apps) to have a backup or something running in a development environment, I suggest configuring replication between two databases. It would be much more effective to do it at the SQL Server level through the application of FDM, IMHO.

    Charles

Maybe you are looking for