How to 'flatten' a varray

Hi,
I have a varray(3) of number and I would like a member procedure or function to return the 3 numbers as columns of a view definition. So, the object table looks something like
CREATE TYPE COORDINATES_L AS VARRAY(3) OF NUMBER;
CREATE TYPE THINGY AS OBJECT
(NAME VARCHAR2(256),
COORDINATES COORDINATES_L);/
CREATE TABLE THINGY_T OF THINGY;
Now what I want is a view that looks like:
CREATE VIEW THINGY_VIEW (NAME, X, Y, Z) OF THINGY_T;
I assume that I can do this with a member procedure or function, as I'm fairly sure that a select statement couldn't return those values to me.
Any help?
Thanks,
Cameron

When in doubt test and see. Yes, it works with null values:
scott@ORA92> CREATE TYPE COORDINATES_L AS VARRAY(3) OF NUMBER
  2  /
Type created.
scott@ORA92> CREATE TYPE THINGY AS OBJECT
  2    (NAME         VARCHAR2(256),
  3       COORDINATES COORDINATES_L);
  4  /
Type created.
scott@ORA92> CREATE TABLE THINGY_T OF THINGY
  2  /
Table created.
scott@ORA92> INSERT INTO thingy_t
  2  VALUES ('thing1', coordinates_l (1, 2, 3))
  3  /
1 row created.
scott@ORA92> INSERT INTO thingy_t
  2  VALUES ('thing2', coordinates_l (4, 5, NULL))
  3  /
1 row created.
scott@ORA92> INSERT INTO thingy_t
  2  VALUES ('thing3', coordinates_l (6, 7, 8))
  3  /
1 row created.
scott@ORA92> CREATE VIEW THINGY_VIEW
  2    (NAME, X, Y, Z)
  3  AS
  4  SELECT t1.name, t1.cv1, t2.cv2, t3.cv3
  5  FROM   (SELECT name, c.column_value cv1,
  6                ROW_NUMBER () OVER (PARTITION BY name ORDER BY ROWNUM) rn
  7            FROM   THINGY_T, TABLE (coordinates) c) t1,
  8           (SELECT name, c.column_value cv2,
  9                ROW_NUMBER () OVER (PARTITION BY name ORDER BY ROWNUM) rn
10            FROM   THINGY_T, TABLE (coordinates) c) t2,
11           (SELECT name, c.column_value cv3,
12                ROW_NUMBER () OVER (PARTITION BY name ORDER BY ROWNUM) rn
13            FROM   THINGY_T, TABLE (coordinates) c) t3
14  WHERE  t1.name = t2.name
15  AND    t1.name = t3.name
16  AND    t2.name = t3.name
17  AND    t1.rn = 1
18  AND    t2.rn = 2
19  AND    t3.rn = 3
20  /
View created.
scott@ORA92> COLUMN name FORMAT A15
scott@ORA92> SELECT * FROM thingy_view
  2  /
NAME                     X          Y          Z
thing1                   1          2          3
thing2                   4          5
thing3                   6          7          8

Similar Messages

  • How to "flatten" a pdf in Adobe Acrobat X Pro

    Is there a feature in Adobe Acrobat X Pro similar to that in Bluebeam that allows the user to "flatten" the pdf? What this means is that images, text boxes and other additions to the pdf become seamlessly integrated into the pdf, guaranteeing they will display on other users' computers and when printed.

    I did try to open the resulting PDF to see if the fields/annotations were flattened. How would I know if they were flattened?
    The images I added get a thin blue border around them and become shaded when I click on them after flattening.
    Before flattening, they get a thin blue border with squares on each corner to drag, change size, etc.
    Does this mean they were successfully flattened?
    I do not understand this: “I just tried with Preflight (Acrobat 9) and it made all of the check boxes selected when it flattened them.” What check boxes are you referring to?
    Please see the below window. Is that where I am supposed to be? If so, am I supposed to click “Analyze and Fix” or do something else?
    Philip Jones in post 15 suggested “Selecting All then use the Flattening.” However, that makes no difference for me.

  • How to flatten a pdf?

    Hi!
    I've exported a pdf from Indesign CS5 and it is spliing into lots of separate objects when viewed in Acrobat pro. I can select lots of objects with the touch up object tool.
    The Indesign file uses lots of images and text with various effects (drop shadows etc) which is obviously making the file complex and Acrobat is splitting it up.
    Is there anyway of flattening the pdf in Acrobat so that it is 1 combined image and not made up of lots of parts?

    That's how PDF files work - page content is optimized into objects based on type and position. You can merge fragments of bitmap images using the tools in Preflight, but you cannot combine other types of page element.
    "Flattening" has a special meaning in PDF, it refers to the process of turning annotations (comments and markup) into page objects. It has no effect on the way a page is stored within the file structure.

  • How to 'flatten' interactive forms with Fixed Pages?

    I have a large project I am working on that is automating the population of forms with strict layouts. (Provided by State governments for licensing requirements). I have the need to generate flattened version, or image of the document as one of the last steps of the process. The final step is to use "Insert Pages" to include into the newly created PDF, other PDFs that were attachments to the original document. These would include employment histories, Residential histories, etc. all are in PDF format.
    The current method is to print the main document to "Adobe PDF", and save the file as a PDF to the file system. This newly saved PDF will accept Inserted pages as it is no longer deemed interactive with Fixed Pages, where the original with Fixed Pages will not accept insertions.
    I have not been able to find a way of doing this via Javascript.
    My goal is to find a way to flatten or image the document, then insert the attachments into the main document to create one compound instrument that records the licensure filing, and can be printed off and sent to the government, and retained for proof of filing.
    Any ideas of how to replicate the print to "Adobe PDF" function and retain a handle to the new document object would be greatly appreciated. The fileName feature on the print method seems to be limited to ".ps", and ".prn" extensions.
    Thank You
    Mark

    I have not been able to Add Pages to a form that has Fixed Pages - either through the UI, or JavaScript. Options are greyed out in the UI.
    Could you expand on what you mean by "You can set the Designer properties to Print Form"?
    Thanks
    Mark

  • How to flatten a fillable form on iOS

    Ever since the latest iOS update, our fillable reader extended PDF's are not working properly in the Reader App. I created fillable forms and save as a "reader extended" file. When we open the file on the Reader App, we can fill in the form and sign, but when we go to email the form it attaches the blank form to an email. It does not offer the "Share Original" or "Flatten copy" option before going into the email. We use this feature for mobile devices to sign contracts on site vs. going on a laptop. If I open a normal PDF file, a non fillable form, I can email the original or flattended copy from the reader app but this is not needed on a normal PDF. How can I share the flattened copy of a fillable form from the reader app on the iPhone/iPAD? Is this issue going to be resolved or are there settings I need to change in the PDF file before saving it for reader extended?

    This is a duplicate post by the same user.
    Please see
    http://forums.adobe.com/message/6233516#6233516

  • How to: Flatten Adobe PDF Portfolio containing email and attachments

    How do you flatten an Adobe PDF Portfolio in Adobe XI Pro.  The Portfolio contains emails with various attachments.  I need to produce a single PDF with all emails and attachments as "images/pages" (as they would appear when printed).  Attachments need to follow their corresponding email in order.  All links, metadata, etc. will be stripped out and various text redactions applied to the final PDF. 

    I did try to open the resulting PDF to see if the fields/annotations were flattened. How would I know if they were flattened?
    The images I added get a thin blue border around them and become shaded when I click on them after flattening.
    Before flattening, they get a thin blue border with squares on each corner to drag, change size, etc.
    Does this mean they were successfully flattened?
    I do not understand this: “I just tried with Preflight (Acrobat 9) and it made all of the check boxes selected when it flattened them.” What check boxes are you referring to?
    Please see the below window. Is that where I am supposed to be? If so, am I supposed to click “Analyze and Fix” or do something else?
    Philip Jones in post 15 suggested “Selecting All then use the Flattening.” However, that makes no difference for me.

  • How to flatten ID pdf?

    I've had trouble with my .pdf files not being flattened to one layer after exporting from ID CS4. I have to open them in PS and hit flatten image or I get shadows around some of the text. How can I flatten the layers before exporting?  Thanks!

    Ok Ed. It's best if you post the pdf somewhere for someone to look at to best direct you.
    It's clear you don't know some of the terms that are used, which is fine.
    The information you have given us is not near enough to give real feedback on the problem.
    From the reason that the printer gave you (or the reason that you posted that the printer couldn't use the pdf) seems to me that the printer didn't really know how to fix the problem either.
    Not having a go at you or your printer. But if you can't tell us what compatibility level you used in making the pdf or what "set to overprint" means it would be very hard to instruct you further.
    That's why we need to see the PDF to work out what is going on.
    That way we can help you understand it better. At the moment, you can't answer the questions we need answered to help you. So it's best if someone examines the PDF and then give you tips on how to avoid this in the future.

  • How to manipulate nested varrays?

    This is my Schema. "Botany" table has this attribute called content_ip which is of type IP_TY. IP_ty is described below.
    DESC botany
    Name Null Type
    LANG VARCHAR2(15)
    AUTHOR VARCHAR2(15)
    CHAPTER_NO NUMBER
    TITLE VARCHAR2(15)
    CONTENT VARCHAR2(15)
    CONTENT_IP                              IP_TY()
    DATE_PUBLISHED DATE
    LAST_UPDATE DATE
    DESC ip_ty
    user type definition
    TYPE ip_ty
    AS OBJECT
    aip aip_ty, cip cip_ty, pip pip_ty
    DESC aip_ty
    user type definition
    TYPE aip_ty AS VARRAY(3) OF VARCHAR(15)
    DESC cip_ty
    user type definition
    TYPE cip_ty AS VARRAY(3) OF VARCHAR(15)
    DESC pip_ty
    user type definition
    TYPE pip_ty AS VARRAY(3) OF VARCHAR(15)
    SELECT bot.content_ip.aip, bot.content_ip.cip, bot.content_ip.pip
    FROM botany bot
    here is the output for the above queries.
    CONTENT_IP.AIP CONTENT_IP.CIP CONTENT_IP.PIP JOEY.AIP_TY('administration','write') JOEY.CIP_TY('marketing') JOEY.PIP_TY('guest')
    the problem is how do i get the output without the leading JOEY.AIP_TY or JOEY.CIP_TY.
    is the above schema too much screwed :( ?
    will casting ip_ty to a table do the trick? i have tried. but vain. maybe it failed due to my ignorance. shed some light if "casting" will remove those leading text.
    Edited by: joe7 on Feb 19, 2010 10:48 PM

    will casting ip_ty to a table do the trick?not sure what you are after, but maybe you mean sth like
    SQL> create or replace type ip_ty as object
       (aip sys.odcivarchar2list,
        cip sys.odcivarchar2list,
        pip sys.odcivarchar2list
    Type created.
    SQL> with botany
            as (select ip_ty (sys.odcivarchar2list ('some aip'),
                              sys.odcivarchar2list ('some cip'),
                              sys.odcivarchar2list ('some pip1', 'some pip2')
                             ) content_ip
                  from dual
    select aip.column_value aip, cip.column_value cip, pip.column_value pip
      from botany t,
           table (t.content_ip.aip) aip,
           table (t.content_ip.cip) cip,
           table (t.content_ip.pip) pip
    AIP                  CIP                  PIP                
    some aip             some cip             some pip1          
    some aip             some cip             some pip2          
    2 rows selected.

  • How to flatten Quicktime movie?

    I have Quicktime 7 Pro. I used it to overlay an arrow image on top of my movie, and saved. I then emailed the movie to someone and discovered that when played, it keeps looking for the resource (the image that is on there) - apparently the arrow image is not included in the QT file I sent (which is weird because I deleted the image off my system, and still the movie shows the arrow on my computer, so it must have it somewhere else??). How do I "flatten" the movie file so that everything is in there and I can send that one file to others and they will see exactly what I see when I play the movie here? I tried the program "Lillipot" to flatten it and it didn't work - arrow still not visible in other players (although QT no longer complains about not being able to find it) - it deleted it maybe? I just want a self-contained movie file that has exactly what I see here. What's the right way to save/export/convert that?

    Did you try saving it as a self-contained movie? That's one of the options.
    Dan

  • How to flatten without losing layer effects' "looks"

    I am working on a client project involving photoshop files, each containing lots of layers and a fair amount of layer effects...things like drop shadow, glow, bevel, etc.
    I am not having luck flattening these images (which I need to do) without losing the look of the original.
    For example, the shadows might be there, but they aren't as dark, or the glows might not be as bright.
    I am using CS4 for Mac OS X, and this vendor used a Windows version of photoshop, but I don't know which version.
    thanks for any ideas!
    DZ

    Christoph,
    >just to make sure: With »flatten« You do mean reduce to the background layer and not just reducing the file-complexity by merging groups or such?
    That terminology
    ("reduce to the background layer") is not used in the English version of Photoshop. Not even
    "reduce". :)
    The menu item labeled "Auf die Hintergrundebene Reduzieren" (oder so was ähnliches) in German is labeled with a single word in English:
    Flatten.
    I know how hard it is to refer to specifics in a version in a different language when you don't have it available. It's not a question of just translating the word. "Layers" in the German version are not
    layers at all but
    planes (»Ebenen«, nicht »Schichten«). Took me a few seconds to figure that one out when I started out to learn Photoshop. :)
    The concept of "Reducing" is not used in the English version at all. "Sichtbare Ebenen auf eine Ebene reduzieren" is simply
    Merge Visible.
    Usw

  • How to flatten sparse table records?

    We have an application that (unfortunately) stores its data in a "long thin" name-value style format, which we then have to pivot into "wide" records for outputs. We're aiming to do this with materialised views, but want to take advantage of partition change tracking to refresh the views, which imposes some restrictions on how we build our views. In particular, we cannot use sub-queries or analytical functions to fully flatten the data into output records.
    Right now, our pivoted materialized views produce something like the following:
    Record Key | Date Created | Column1 | Column2 | Column3 | etc
    REC01 | 01-JAN-2010 | A | B | | ...
    REC01 | 04-JAN-2010 | | C | D | ...
    What we need is to flatten these records so that there is only one record with a given Record Key, and having only the most recent non-NULL value for each ColumnN e.g.:
    Record Key | Column1 | Column2 | Column3 | etc
    REC01 | A | C | D | ...
    The problem is that there can be hundreds of ColumnN columns, may be many separate update-records for a given Record Key (and potentially millions of different Record Keys), so I'm having trouble working out how to do this (a) efficiently or indeed (b) at all.
    We can't just use the latest Date Created, because we may need to look at a different Date Created for each column. Because the MV needs to be PCT-capable, it seems we cannot use a sub-query to fetch only the latest value for each ColumnN before pivoting the data, and I can't see how to apply a group or analytical function to do this reliably on the wide records in the pivoted view.
    What we need is a kind of FLATTEN() OVER (PARTITION BY RecordKey ORDER BY DateCreated DESC) function, but Oracle seems sadly lacking in this respect. Or am I missing something?
    Looking at the data, it looks like it should be a pretty simple, but my SQL-brain is running out of juice, so if anybody else can suggest how to approach this, I'd be very grateful.
    thanks,
    Chris

    There's probably a simpler way than this, but it's early in the morning and I haven't woken up properly yet...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 'REC01' as record_key, to_date('01-JAN-2010','DD-MON-YYYY') as date_created, 'A' as column1, 'B' as column2, null as column3 from dual union all
      2             select 'REC01', to_date('04-JAN-2010','DD-MON-YYYY'), null, 'C', 'D' from dual union all
      3             select 'REC02', to_date('06-JAN-2010','DD-MON-YYYY'), 'X', null, 'Z' from dual)
      4  -- end of test data
      5  select record_key, date_created, column1, column2, column3
      6  from (
      7        select record_key
      8              ,last_value(date_created) over (partition by record_key order by date_created) as date_created
      9              ,last_value(column1 ignore nulls) over (partition by record_key order by date_created) as column1
    10              ,last_value(column2 ignore nulls) over (partition by record_key order by date_created) as column2
    11              ,last_value(column3 ignore nulls) over (partition by record_key order by date_created) as column3
    12              ,row_number() over (partition by record_key order by date_created desc) as rn
    13        from t
    14       )
    15* where rn = 1
    SQL> /
    RECOR DATE_CREATED        C C C
    REC01 04/01/2010 00:00:00 A C D
    REC02 06/01/2010 00:00:00 X   Z
    SQL>

  • How does flatten to string work with arrays?

    Hi all,
    I'm currently trying to get my head around how flatten to string works in terms of using it to write a configuration file which is loaded on startup in my VI. Writing and loading the configuration file is no problem and it is working beautifully. However... this is for a data acquisition system and the configuration file stores all the calibration data in the system which is entered through arrays. Anyway, the data recorded by my VI is to be post processed using MATLAB and needs to apply the calibration data stored in the configuration file.
    So I've been trying to work out how to get MATLAB to decypher the configuration file, but... I can't make heads or tails as to how the data is written into the file. I made a mock up of the saving file routine as you can see below, and run it a number of times by changing the input array dimensions and the values.
    Then opened the saved file to see if I can find a pattern... but I can't! Simply changing the element values changes the number of "\   \'s" Here is what I produced from my trials:
    [1x1 0]
    Config=\00\00\00\01\00\00\00\00\00\00\00\00      (1x1 array of 0's)
    [1x1 1]
    Config=\00\00\00\01?ð\00\00\00\00\00\00            (1x1 array of 1's)
    [1x1 2]
    Config=\00\00\00\01@\00\00\00\00\00\00\00       (1x1 array of 2's)
    [1x2 0]
    Config=\00\00\00\02\00\00\00\00\00\00\00\00\00\00\​00\00\00\00\00\00      (1x2 array of 0's)
    [1x2 1]
    Config=\00\00\00\02?ð\00\00\00\00\00\00?ð\00\00\00​\00\00\00                  (1x2 array of 1's)
    [1x2 2]
    Config=\00\00\00\02?ð\00\00\00\00\00\00?ð\00\00\00​\00\00\00                  (1x2 array of 2's) etc. etc. etc
    [2x2 0]
    Config=\00\00\00\02\00\00\00\02\00\00\00\00\00\00\​00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00​\00\00\00\00\00\00\00\00\00     
    [2x2 1]
    Config=\00\00\00\02\00\00\00\02?ð\00\00\00\00\00\0​0?ð\00\00\00\00\00\00?ð\00\00\00\00\00\00?ð\00\00\​00\00\00\00
    [2x2 2]
    Config=\00\00\00\02\00\00\00\02@\00\00\00\00\00\00​\00@\00\00\00\00\00\00\00@\00\00\00\00\00\00\00@\0​0\00\00\00\00\00\00
    Could someone explain to me how flatten to string flattens the array information? Particularly when the array elements are double precision? I look forward to any help that anyone can offer!
    Thanks,
    Stirling
    Message Edited by stirlsilver on 09-08-2007 08:47 AM
    Attachments:
    saveconfig.png ‏7 KB

    There are optional inputs to "flatten to string" That you can use to modify the outcome as needed. For example you can do little endian.
    You can also omit the array size from the flattened data (definitely not recommended for 2D arrays).
    LabVIEW Champion . Do more with less code and in less time .

  • How to index a varray of object type?

    Hello,
    Is it possible to index a varray/Table type, which is of type of an object, like the way the scalar types are.
    say, CREATE OR REPLACE
    TYPE SAMPLE_TABLE AS TABLE OF Date index by binary_integer
    But if I have to change the table type from Date to an object
    lets say
    create or replace TYPE SAMPLE_TYPE AS OBJECT (
    id NUMBER(12),
    value varchar2(12)
    Will I be able to do
    CREATE OR REPLACE
    TYPE SAMPLE_TABLE AS TABLE OF SAMPLE_TYPE index by id
    If not, is there a way it can be done, or is it a limitaion that it cant be done. Any pointers to this is highly appreciated.
    Thanks

    One way to do this...
    SQL> drop type profile_options_object_array
      2  /
    SQL> drop type profile_options_object
      2  /
    SQL> drop table t
      2  /
    SQL>
    SQL> CREATE OR REPLACE TYPE profile_options_object AS OBJECT(
      2  option_name VARCHAR2(100),
      3  option_value VARCHAR(200)
      4  );
      5  /
    SQL> CREATE OR REPLACE TYPE profile_options_object_array AS VARRAY(32000) OF profile_options_object;
      2  /
    SQL>
    SQL> create table t
      2  (x varchar2(10)
      3  ,y varchar2(10)
      4  );
    SQL> insert into t values ('name1', 'value1');
    SQL> insert into t values ('name2', 'value2');
    SQL> commit;
    SQL>
    SQL> select profile_options_object (x, y)
      2    from t
      3  /
    PROFILE_OPTIONS_OBJECT(X,Y)(OPTION_NAME, OPTION_VALUE)
    PROFILE_OPTIONS_OBJECT('name1', 'value1')
    PROFILE_OPTIONS_OBJECT('name2', 'value2')
    SQL> declare
      2     profile_options  profile_options_object_array;
      3     idx pls_integer;
      4  begin
      5     select profile_options_object (x, y)
      6       bulk collect
      7       into profile_options
      8       from t
      9     ;
    10    idx := profile_options.first;
    11    while idx is not null
    12    loop
    13      dbms_output.put_line (profile_options(idx).option_name); 
    14      dbms_output.put_line (profile_options(idx).option_value);
    15      idx := profile_options.next(idx);
    16    end loop;
    17  end;
    18  /
    name1
    value1
    name2
    value2
    SQL>

  • How to Flatten/Print to PDF Multiple PDF Forms at Once?

    Hi all! I receive multiple PDF forms per day. I file these forms electronically by using "print to Adobe PDF" (which flattens all the form fields). Is there a way to "print to Adobe PDF" multiple files at one? OR is there some other way to flatten form fields on multiple files at once? If I "combine supported files in Acrobat" the answers in the form fields of the first file auto-populate through all the other form fields in the additional files I combine.
    I'm on a PC.

    There are much better ways of flattening a form than by printing it via the PDF printer. This utility for example can help you with that task:
    http://www.uvsar.com/projects/acrobat/flattener/
    If you have Acrobat Pro then you can use a simple Action to flatten multiple files. Just have it execute the following JavaScript code:
    this.flattenPages();

  • How to flatten a Heirarchy

    Hai, The End-user doesnt want a Hierarchy but a flat table out of a Heirarchy so I want to know where and how I can loop through a Hierarchy table to create a flat structure.
    Please let me know if you have any standard FMs that can do that?
    At what stage should I program in BW?

    HI,
    Welcome to SDN!
    did you check
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0403a990-0201-0010-38b3-e1fc442848cb
    Regards,
    San!

Maybe you are looking for