AppleScript - extraire extract values from a table, create a text file with these values

Hello world

Lets say I have a table that looks a bit like this

And this table I would create 2 text files (or even more, depending on how many switchnames are there) who look a bit like these

Is it still possible?

I suppose to create a Service (which can be called in numbers) with Automator which includes an Applescript script - but - no idea since the script is not one of my strong suits.

There is not need to be perfect, because tables are not necessarily the model presented above - so to tweek the script to the application will be necessary. The text files can be created/saved in the same folder as the file numbers is in.

Y at - it script-genius out there?

See you soon

Florian

Select the column of fist of the data, and then run this script by copying the Forum and paste it into the script editor.  The files will appear on the desktop

say application "Numbers".

say front document to tell the worksheet active

say ( class is worn) fromfirst table whose selection range

selectionRange defined in column 1 of the selection

set cnt to 0

the value destRange for range

the value currentList to {}

-the list of switches

Repeat with acellule in selectionRange cells

-say acellule to set the value on the NTC

pass the value to the value of cell

if and ((cnt > 0) (switch is not missing value) and (currentList is not contain switch)) then

switch and the value in the currentList currentList

end if

NTC put to the cnt + 1

end Repeat

-Display dialog box "to the list of items is:" & currentList & "a list" & (currentList County) ".

Repeat with aswitch in currentList

" game textOut to '# Script generated with Applescript for switch' & aswitch &"

# on "& (today's date) &"

!

conf t

"

set cnt to 0

Repeat with acellule in selectionRange cells

-say acellule to set the value on the NTC

pass the value to the value of cell

-Display dialog "aswitch is []" & aswitch & "] and switch is []" & switch & "]".

if (aswitch contains the switch) then

the value cellCol to address a column of first cell of acellule

address of line of first cell value cellRow in of acellule

value to the aport (value of the cell of the column (cellCol + 1) cellRow) integer

the value vlan for the (value of the cell cellRow of column (cellCol + 2)) integer

the value desc to the (value of the cell cellRow of column (cellCol + 3))

" put to textOut textOut &.

!

"" IG 1/0 interface / "& aport &.

switchport mode access

switchport access vlan "" & vlan & ""

Description LINK TO "" & desc & ""

"

on the other

-Display dialog box "did not: []" & aswitch & "] and []" & switch & "]".

end if

NTC put to the cnt + 1

end Repeat

Set myFile to open for access (path to the Office as text) & aswitch & '_output.txt' the with write permission

textOut write to myFile

MyFile close access

end Repeat

end say

end say

end say

Tags: iWork

Similar Questions

  • 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.

  • 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')
    
  • Saving information from several tables in a txt file

    To all,

    I work in a defined test bed in which I test different devices via series. For each one, I have a table of newspaper. Is there a way I could connect all these tables in a text file of monkey?

    Thank you

    Cosmica

    Of course it is a. have you looked through the functions in the range of the file IO? For example, writing to the spreadsheet file or as file write, according to the format of your data.

  • Cannot create a data file with a size of less than 1000 M

    Hello

    I have a problem that I can't solve. Whenever I try to create a DATA file with a size of less than 1000 MB, I get an ORA-03214

    Example:

    Select * from version of v$.

    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

    PL/SQL Release 11.2.0.4.0 - Production

    "CORE 11.2.0.4.0 Production."

    AMT for IBM/AIX RISC System/6000: Version 11.2.0.4.0 - Production

    NLSRTL Version 11.2.0.4.0 - Production

    -----

    ALTER TABLESPACE "IDX_PRETR1".

    ADD DATAFILE ' / appli/oracle/PR3/data4/TEST.dbf'

    SIZE 500 M;

    XXIX error on line 1 of the command:

    ALTER TABLESPACE "IDX_PRETR1".

    ADD DATAFILE ' / appli/oracle/PR3/data4/TEST.dbf'

    SIZE 500M

    Error report:

    SQL error: ORA-03214: the file size is less than the minimum required

    03214 00000 - "specified file size is smaller than the minimum required.

    * Cause: Specified for add/resize datafile/tempfile file size does not work

    provide the minimum required of an allocation unit.

    * Action: Increase the size of the file specification

    Thanks for the help and sorry for my English

    Hello

    The answer may lie in the INITIAL_EXTENT configuration in your space of tables, check DBA_tablespaces view.

    Also, try to use autoextend on and maxsize in your file data creation but better try with the highest value during the action of the mentioned error.

    Kind regards

    Juan M

  • Unload tables to text file with delimiter;

    I want to empty all table data in a text file with. as a delimiter without applying a | ; || between the fields. Is there a ' select * from myTable ' method;

    And this applies to other tables.

    Want to run a script every day to ftp to other sources or keep them as backup.

    Thanks for your help.

    You must call the sqlplus from a shell script. Think you're in a windows environment. So you can have something like this

    create a run.bat file or command called run.cmd batch file and place the following code in there and save it

    This command file will create a new file called run.sql in the c:\ drive which will be managed by sqlplus.
    DateTime variable will create value "mmddyyyyhh24miss" (depending on your settings for date format) and be preceded by ".txt".

    set mydatetime=%date:~0,2%%date:~3,2%%date:~6,4%%time:~0,2%%time:~3,2%%time:~6,2%
    echo set linesize 124 > c:\run.sql
    echo set colsep ';' >> c:\run.sql
    echo set pages 0 >> c:\run.sql
    echo set head off >> c:\run.sql
    echo set verify off >> c:\run.sql
    echo set echo off >> c:\run.sql
    echo set trimspool on >> c:\run.sql
    echo set feedback off >> c:\run.sql
    echo spool c:\%mydatetime%.txt >> c:\run.sql
    echo select * from tab ; >> c:\run.sql
    echo spool off >> c:\run.sql
    echo exit >> c:\run.sql
    sqlplus -s user/passw0rd@connect @c:\run.sql
    

    Note: You can add all the environment variables with a single instruction set in sqlplus Parry set linesize 124, etc.
    But I have separated them for readability

    Just run from the command prompt
    c: > run.cmd

    See your updated file pending with current datetime.txt and go to the c:\ drive

  • HOW CAN I SEND A TABLE TO A TEXT FILE

    Hello

    I have a table with a lot of values, and I need to transfer this table to a text file (.txt), without losing the position

    These values in the table. Can someone help me with this?

    THX

    Or you can use scripture to the worksheet File.vi

    ~ Jonathan

  • I'm trying to create a PDF file with several signature lines in that anyone can "Sign" by using their digital signature CAC (Common Access Card) active. The goal is to have a single document that people can open, sign on a designated line and save the doc

    I'm trying to create a PDF file with several signature lines in that anyone can "Sign" by using their digital signature CAC (Common Access Card) active. The goal is to have a single document that people can open, sign on a designated line and save the document (replacing the existing document) and close. Then another person can open the same document digitally sign another area of the form, save it, and close it. So on, and so on. Is there a way to do this? At the end of the day, I would end up with a PDF file with literally hundreds of signatures to enable different ACC everywhere...

    I don't understand what the problem is. In the post of the davidr96549424 on May 8, 2015 07:58 you presented a structure of a correct document. Is the issue of the creation of this structure in a PDF file? For this, you will need an Acrobat, not reader.

    XI in Acrobat, select Tools-> forms-Edit. Click 'No' on the form fields 'detect '. In the tasks Panel that opens, click on "add new field". Select "Digital Signature" and move it to the location in the document where you want to than the appearance of the signature to be. Repeat that for signature fields as you want. Users will sign by clicking on the prepared unsigned signature field which shows the dialog box "sign. Do not forget that as TSN has noted that a digital signature applies to the entire document. The entry in the document where it is is irrelevant. Each next signature covers all previous signatures.

    Your users can also sign a document from anywhere that they want without signature fields already prepared. For this select fill & sign-> work with certificates and the type of signing you want to sign up with. A dialog box that will tell you a rectangle for the appearance of signature rises and after you draw the rectangle of the dialog 'Sign' rises.

    PDF/Acrobat doesn't have a limit on a number of signatures in a PDF document. But! Don't forget that when you open a PDF file with Acrobat/Reader signatures valid all of them and takes time (several seconds - until 10 - for every signature), so if you have several signatures of dozens of their validation open can take a long time.

    I don't know how build you your workflow so that each person signs the same PDF and saves it. Economy runs on the same computer where the PDF is stored. You'll have to decide how to allow different people to have access to the same PDF. They, of course, you may sign this only one-at-a-time PDF.

  • Writes a table to a text file. (Save the children).

    I'm trying to break down an InDesign file in his sentences and export it to a text file. When I created a prompt with the contents of newArr.join ("\r") that everything looks exactly as I would like that there, the Sun is shining and the kids are happy. However, when I try to write the table to a text file, it seems as if nothing is happening, the Sun hides and the children are unhappy.

    How can I make the kids happy again and write the table in the text file?

    Thanks for any help!

    indesign #target

    myDoc = app.activeDocument; in file

    reportFile = File("c://users//kudrow//desktop//reportFile.txt"); file

    newArr = [];

    Goal management texts related to the file, split frames of related texts, push related on table frames

    for (i = 0; i < myDoc.pages.count (); i ++) {}

    for (j = 0; j < myDoc.pages [i].textFrames.count (); j ++) {}

    myFrame = myDoc.pages [i] .textFrames [j] .silence;

    newFrame = myFrame.split(/\r|\n|\./)

    for (k = 0; < newFrame.length; k ++) {}

    newArr.push (newFrame [k]);

    }

    }

    }

    write table to text file

    reportFile.open ('w');

    reportFile.write(newArr.join("\r"));

    reportFile.close ();

    Post edited by: KuddRoww

    Probably a text encoding problem. Add

    reportFile.encoding = 'UTF-8'
    

    somewhere after the definition of your reportFile but before opening it.

    (Unsolicited concern follows: where are your var?) Probably, it will not be a problem if you have no function and run in the main engine, but as soon as your scripts begin to grow in complexity, you will run in hard-to-find problems with the scope of variables. Better get into good habits now.)

    The f

  • Is it possible to create the text block with non-uniform formatting is applied to the text?

    Hi all

    By this script

    var doc = app.documents.add(70, 20, 300, "Test", NewDocumentMode.RGB);
    var textLayer = doc.artLayers.add();
    textLayer.name = "Text";
    textLayer.kind = LayerKind.TEXT;
    
    var solidColorRef = new SolidColor();
    solidColorRef.rgb.red = 0;
    solidColorRef.rgb.green = 174;
    solidColorRef.rgb.blue = 239;
    
    var ti = textLayer.textItem;
    with (ti) {
         contents = "Blah-blah-blah!";
         kind = TextType.PARAGRAPHTEXT;
         height = new UnitValue("20 mm");
         width = new UnitValue("70 mm");
         position = [ new UnitValue("0 mm"), new UnitValue("0 mm") ];
         font = "MinionPro-Bold";
         size = new UnitValue("24 pt");
         color = solidColorRef;
         justification = Justification.CENTER;
    }
    

    So I can create a block of text with uniform like formatting

    SNAG-0011.png
    But, as far as I understand it, it is impossible to make an image and apply different sizes, colors, etc. (Please confirm or refute it).

    To achieve the result by script as follows:

    SNAG-0014.png

    The r to Browse datashows the formatting only to the beginning of this text.


    What I want to achieve is to take a block of text in the InDesign document and re-create it in psd-file. (The text must be editable)

    Y at - it another way to achieve this: by plug-ins, extensions, incantation, etc.?

    Kind regards
    Kasyan

    So that other things I noticed, it's text.jsx does not work with UnitValues. It uses the action Manager to work with textRanges. And it seems that Adobe changed the textItem units operating. Therefore, it is difficult to understand what values to use. Text.addNewTextLayer () and Text.modifyTextLayer () seem to what different values for the text of the same size.

    So below is an example updated the PS-Scripts-post on how to create a text layer with different textRanges using the current text.jsx.Note I've hard-coded sizes for that to work as I had hoped.

    function tsrDemo(doc) {
         var doc = app.documents.add(new UnitValue(70,'mm'), new UnitValue(20,'mm'), 300, "Test", NewDocumentMode.RGB);
         // we want to create a new text layer so create a new TextOptions with the contents as the argument
          var opts = new TextOptions("Blah-blah-blah!");
           // override the default settings
           opts.layerName = "Test";
           opts.kind = TextType.PARAGRAPHTEXT;
           opts.height = 800;// pixels
           opts.width = 200;
           opts.position = [ 0, 0 ];// pixels
           opts.justification = Justification.CENTER;
           opts.font = Text.findFont("Minion Pro Bold");
           opts.size = 6;// not sure what unit this needs
           opts.color = Text.toRGBColor(0, 174, 239);
    
           // create a new text layer with those options
         var layer = Text.addNewTextLayer(doc, opts);
    
           var opts = new TextOptions( layer.textItem);
           opts.contents = layer.textItem.contents;
           // now need to construct TextStyles for each range we want to set
           // for ranges we can only change the font, size, and color
           // first set a textStyle that matches the TextOptions
          var s1 = new TextStyle(undefined,undefined,undefined);
           // now set a textStyle for each different style you want
          var s2 = new TextStyle(undefined, 12, Text.toRGBColor(0, 0,0));// for some reason size values here are not the same scale as above
           // define more TextStyles as needed. here we only need one
    
          // Now create the set of ranges to apply the styles over
          var ranges = new TextStyleRanges();
           // the first range must start at 0.  In this example we want the first range unchanged
           // so we use the TextStyle that matches the TextOptions
           // this range covers the entire contents
          ranges.add(new TextStyleRange(0, opts.contents.length, s1));
           // this range covers the middle 'blah'
           ranges.add(new TextStyleRange(5, 9, s2));
            // we now add the ranges we set to the TextOptions
          opts.ranges = ranges;
    
           Text.modifyTextLayer(doc, opts, doc.activeLayer); 
    
        };
    
        tsrDemo();
    
  • When I create a new file with 500px wide by long 500px it appears on my screen like a rectangle.

    When I create a new file with 500px wide by long 500px it appears on my screen like a rectangle. When I go to Image > Image size it still shows the 500 x 500 image and yet is clearly not a square. This also occurs if I try to create a circle, select the ellipse a tool by checking the box so he could make a perfect circle it appears as an oval.

    I have Photoshop CS6 on a macbook.

    Any help would be appreciated, I consider myself decently well informed in Photoshop and I looked in the settings, but I can't seem to understand the issue, happened for awhile now, it is not something unique stroke of luck.

    Thank you.

    Is your on-site pixel aspect ration? Set here the 500 x 500 pixels of image 2:1 format

  • 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.

  • Is it possible to see/get the data from the table to a dump file

    I have files dmp generated using expdp on oracle 11 g...

    expdp_schemas_18MAY2013_1.dmp

    expdp_schemas_18MAY2013_2.dmp

    expdp_schemas_18MAY2013_3.dmp

    Can I use a settings file given below to get the data from the table in the file sql or impdp the only option to load the data of table in database.

    VI test1.par

    USERID = "/ as sysdba".

    DIRECTORY = DATA

    dumpfile=expdp_schemas_18MAY2013%S.dmp

    SCHEMAS = USER1, USER2

    LOGFILE = user_dump_data.log

    SQLFILE = user_dump_data. SQL

    and impdp parfile = test1.par.

    No,

    DataPump cannot retrieve a dumpfile data in a flat file.

    Dean

  • Help! I need to extract audio from a video to an audio file in my HARD drive

    Hello

    I have a project that needs to me mastered (the audio part at least), and I need to extract the audio parts of my sequence in 'physical' files on my HARD drive, so I can load my project (with these separate audio files) on another computer where the control will be done... but I can't do it! .. is there anyway I can do this?

    Help, please!

    Thanks in advance...

    Al

    You can select an avi clip and right click, then choose Edit in Soundbooth. This creates a wav audio file in the clip, with the same name as the video clip with "extract" added automatically.

    Also, it replaces the audio in the sequence with the extracted file, but does not change the original item.

  • SQL * Loader vs external tables to a single file with several types of records (intercalated)

    I have a file of sample data (we will have the a 'true' at a later date and put in day after that) which includes a header, footer, and 5 types of records, that have different columns and lengths, noticed by the first two characters. The different types of records are not all together. On the contrary, some (in particular, two of these types in this example) are intertwined. I am currently working on a SQL * Loader configuration file when it was suggested that I use external tables. I know very little of either, then I would ask what is the best to use.

    Scott@orcl12c > host type test.dat

    header line

    AB, 123, efg

    CD, hij, 456

    Scott@orcl12c > type host test.ctl

    options (Skip = 1)

    load data

    in the ab table truncate where table_name = 'ab'

    fields ended by ',' trailing nullcols

    (table_name filler position (1), col1, col2)

    in the cd table add where table_name = 'cd'

    fields ended by ',' trailing nullcols

    (table_name filler position (1), col3, col4)

    Scott@orcl12c > create table ab

    2 (col1 number,

    3 col2 varchar2 (8))

    4.

    Table created.

    Scott@orcl12c > insert into ab values (1, 'old data')

    2.

    1 line of creation.

    Scott@orcl12c > create table cd

    2 (col3 varchar2 (8))

    3 col4 number)

    4.

    Table created.

    Scott@orcl12c > insert into cd values ("old data", 1).

    2.

    1 line of creation.

    Scott@orcl12c > commit

    2.

    Validation complete.

    Scott@orcl12c > host sqlldr scott/tiger control = test.ctl data = test.dat log = test.log

    SQL * Loader: release 12.1.0.1.0 - Production on Thu Mar 27 13:11:47 2014

    Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

    Path used: classics

    Commit the point reached - the number of logical records 2

    Table AB:

    1 row loaded successfully.

    Table D:

    1 row loaded successfully.

    Check the log file:

    test.log

    For more information on the charge.

    Scott@orcl12c > select * AB

    2.

    COL1 COL2

    ---------- --------

    EFG 123

    1 selected line.

    Scott@orcl12c > select * from cd

    2.

    COL3 COL4

    -------- ----------

    old data 1

    hij 456

    2 selected lines.

Maybe you are looking for