Can we write function pipeline without creating Type objects.

Hello
I want to write a pipeline without Type objects function. Is this possible?

For Ex as below:

create or replace
package pipelined_fun
as
txn type is (record
NUMBER of num
NUMBER of num1
);
type txnhist is table of txn;
function txnhist_fun (p_mbrsep IN VARCHAR2) return pipeline txnhist.
END;
/
create or replace
pipelined_fun package body
as
function txnhist_fun (p_mbrsep IN VARCHAR2, p_mchdt in varchar2) return pipeline txnTable
is
TxN1 txn;
BEGIN
TxN1.num: = 1;
TxN1.num: = 2;
COURSE OF ACTION (txn1);
COURSE OF ACTION (txn1);
END;

END;
/


Please advice.

What you posted is close but your definition of the function in the body is not in the specifications.

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> CREATE OR REPLACE PACKAGE pipelined_fun
  2  AS
  3     TYPE txn IS RECORD (num NUMBER, num1 NUMBER);
  4
  5     TYPE txnhist IS TABLE OF txn;
  6
  7     FUNCTION txnhist_fun (p_mbrsep IN VARCHAR2)
  8        RETURN txnhist
  9        PIPELINED;
 10  END;
 11  /

Package created.

SQL>
SQL> CREATE OR REPLACE PACKAGE BODY pipelined_fun
  2  AS
  3     FUNCTION txnhist_fun (p_mbrsep IN VARCHAR2)
  4        RETURN txnhist
  5        PIPELINED
  6     IS
  7        txn1 txn;
  8     BEGIN
  9        txn1.num := 1;
 10        txn1.num := 2;
 11        PIPE ROW (txn1);
 12        PIPE ROW (txn1);
 13     END;
 14  END;
 15  /

Package body created.

SQL> SELECT *
  2  FROM   table (pipelined_fun.txnhist_fun ('a'));

       NUM       NUM1
---------- ----------
         2
         2

SQL>

Note This support database types will be created by this code, but creating is not explicit and implicit.

Tags: Database

Similar Questions

  • How can I indent a paragraph WITHOUT creating spaces above or below?

    I use Dreamweaver CS3 on a Macintosh G5 running OS 10.5.5.

    I chose a new document HTML (Dreamweaver opened as a CSS) and pasted the text in a MS Word document.

    When I 'dash' THROUGHOUT the text, everything remains the same except that it's ALL indented.

    BUT when I 'dash' single paragraph while paragraph is not only back, BUT there ALSO appears an extra space before and space after this paragraph.
    That this fact is inserting < blockquote > before and after the paragraph.

    How can I 'dash' a paragraph without appearing before or after the paragraph?

    Also is it easily possible from the page design?
    I tried to insert a tag by pressing the button 'tag' on the keyboard but that does the same thing as using the feature of "withdrawal" (which is also inserted spaces before and after the paragraph).

    BTW: I am a novice, so please try to make it as simple as possible.

    I wonder if what you are really wanting to do is dash all
    paragraph, not the first line.

    It is a collection of first line blah blah blah blah blah blah blah blah
    blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    blah blah blah blah blah blah blah.

    It would be a paragraph indented blah blah blah blah blah blah blah
    bla
    blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    bla
    blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    bla

    If the second is what you want, use CSS according to the instructions to set the LEFT
    MARGIN (left margin) for the amount you want to put in the background, like 15px.

    If this isn't what you want, do what I did not write this.

    Mad Dog

    pppp145pp wrote:
    > Hi Osgood.
    >
    > Thanks for the advice.
    >
    > There is a problem in that where text is too long for a single line
    > goes on the next line, it is not indented (but starting at the edge of)
    (> page).
    >
    > How to overcome that?

  • Run the Photoshop Action of the bridge on the raw files without creating a folder JPG

    I created a Photoshop Action that resizes and compresses an image (at 800 pixels at 24% quality). I want to run that Action of bridge on a selection of raw files. I have to do this, the bridge, select the images and select "tools-Photoshop-Image Processor". "In the window options 'Processor of Image', I put the folder to save the images processed, check the ' Action run" check box and select the Action but I have to check one of the 'file Type' (I check '"Save as JPG' with ' quality: 1" ") (it will run only if a"file Type"is selected), then click on 'run '. It then performs the Action on each image and I get the desired resolution file reduced and reduced the size of the file. The problem is that there also creates a JPG subfolder and creates another set of files also to the reduced resolution but the file sizes are larger than the game created by the Action.

    How can I run the Action without creating the subfolder containing the extra set of files whose size size JPG?

    I use v4.0.5.11 Bridge CS5, Photoshop CS5 v12.0.4x32 and Windows XP Pro SP3.

    Thanks to anyone who can help me.

    Batch processing, see options for the dialog box:

    Delete the file Open Options Dialogs (prevents the dialog box camera raw of opening)

    Delete (optional) color profile warnings

    Under Destination set to None (the files are backed up to where the files specified in the save for web (export) step and close step on the farm in action.)

  • Create the table and take the name of user who can read/write on this table

    Dear gurus,

    I need to add the following column in Oracle 11g DB AND also add the name of user who can read/write ONLY the following table, any table to access the same read?

    I use to go to Oracle PL/SQL client.

    My dbname is 'customerdb '.

    TableName: "extractOrders."

    +: example of the field data.
    Column0 = logID: 1
    Column1 = idNumber: 39D13613-F061-D38D-100A-16536409C6D8
    Column2 = timestamp: 2011/07/11-13:45
    Column3 = resultCode: 40509
    Column4 = resultMessage: could not find the IDENTITY card
    Column 5 = number: 9813080808
    Column6 = iid: 87670200100001466100
    Column7 = products: D1430 | "' S1412 ' | "" S1407 | "' S2607 ' | "' S1417 ' | "" S1411 | "' S1413 ' | "" S1502 | "" S1406 | "' S1522 ' | "' S1524 ' | "' S1474 ' | "" S1473 ".

    user596669 wrote:

    I need to add the following column in Oracle 11g DB AND also add the name of user who can read/write ONLY the following table, any table to access the same read?

    I use to go to Oracle PL/SQL client.

    Let's say your table than extractorders is the schema of database clientsproperty.

    As this pattern create a stored procedure that runs with the privileges of the customerschema. Having this procedure return a ref cursor For example

    create or replace procedure ReadExtractOrders( c in out sys_refcursor ) authid definer is
    begin
      open c for select * from extractorders;
    end;
    

    As this code executes with the privileges of the customer schema it can read the table belonged to this scheme.

    Now give execute rights on this process for the Joe database schema - and this pattern can create a cursor on the table of ExtractOrders , without being able to access or use directly or refer to this table. Read access to this table is therefore protected by a reliable code belonged schema customers.

    Learn about the AUTHID clause and how it can be used to differentiate the code approved and non-approved, which allows to PL/SQL code to run with different privileges than the demand for prescriptions.

  • Call function pipeline with entry as a record of cursor type parameter

    Hello

    I want result set of query curosr to function in pipeline and then proceed to Ref cusror for java application. I wrote the code below:
    CREATE OR REPLACE PACKAGE emp_pkg IS
    TYPE t_emp_rec IS RECORD(empid varchar2(5),last_name varchar2(25),email varchar2(25));
         
         type obj_t_emp_rec is table of t_emp_rec;
    
         CURSOR get_emp_data_cur(empid IN employee.employee_id%type)
         IS
              SELECT     EMPLOYEE_ID,LAST_NAME,EMAIL
              FROM     employee
              WHERE     employee_id=empid;
    
              --Rowtype for table
              TYPE t_emp IS TABLE OF get_emp_data_cur%ROWTYPE INDEX BY PLS_INTEGER;
    
              --Object for the table type created
              get_emp_rec t_emp;
    
         PROCEDURE Populate_emp_details(empid     IN     employee.employee_id%type,get_emp_rec     OUT     t_emp, result out sys_refcursor);
         
         function type_out(get_emp_rec in t_emp) return obj_t_emp_rec pipelined;
    
    END emp_pkg;
    /
    
    CREATE OR REPLACE PACKAGE BODY emp_pkg AS
    
    PROCEDURE Populate_emp_details(empid     IN     employee.employee_id%type,get_emp_rec     OUT     t_emp,result out sys_refcursor)
    IS
    
    BEGIN
    
         SELECT     EMPLOYEE_ID,LAST_NAME,EMAIL
         BULK COLLECT
         INTO     get_emp_rec
         FROM     employee
         WHERE     employee_id=empid;     
    
         open result for SELECT * FROM TABLE (type_out(get_emp_rec));     
    
    EXCEPTION
         when no_data_found then
              dbms_output.put_line('Invalid booking number entered');
    
    END Populate_emp_details;
    
    function type_out(get_emp_rec in t_emp) return obj_t_emp_rec pipelined
    as
    currec     t_emp_rec;
    begin
              for i in 1..get_emp_rec.count loop
                        pipe row(currec);
                        dbms_output.put_line('row count of rec -'|| get_emp_rec.count);
              end loop;
    end;
    
    END emp_pkg;
    /
    It gives me compilation error when you call the function pipeline (type_out (get_emp_rec)). Is it wrong to call pipelined function or please correct where I'm wrong.

    Help, please.

    Thank you

    Engine SQL doesn't know PL/SQL types.

    Really? :

    SQL> create or replace package emp_pkg
    is
      type t_emp_rec is record
      (
        empid       varchar2 (5),
        last_name   varchar2 (25),
        email       varchar2 (25)
      );
    
      type obj_t_emp_rec is table of t_emp_rec;
    
      cursor get_emp_data_cur (empid in employees.employee_id%type)
      is
        select employee_id, last_name, email
          from employees
         where employee_id = empid;
    
      --Rowtype for table
      type t_emp is table of get_emp_data_cur%rowtype;
    
      get_emp_rec t_emp;
    
      procedure populate_emp_details (empid in employees.employee_id%type);
    
      function type_out (empid in employees.employee_id%type) return obj_t_emp_rec pipelined;
    end emp_pkg;
    /
    Package created.
    
    SQL> create or replace package body emp_pkg
    as
    
      function type_out (empid in employees.employee_id%type)
        return obj_t_emp_rec pipelined
      as
        currec   t_emp_rec;
      begin
        populate_emp_details (empid);
    
        for i in 1 .. get_emp_rec.count
        loop
          currec.empid := get_emp_rec(i).employee_id;
          currec.last_name := get_emp_rec(i).last_name;
          currec.email := get_emp_rec(i).email;
          pipe row (currec);
          --dbms_output.put_line ('row count of rec -' || get_emp_rec.count);
        end loop;
        return;
      end type_out;
    
      procedure populate_emp_details (empid in employees.employee_id%type)
      is
      begin
        select employee_id, last_name, email
          bulk collect into get_emp_rec
          from employees
         where employee_id = empid;
    
      end populate_emp_details;
    
    end emp_pkg;
    /
    Package body created.
    
    SQL> select * from table(emp_pkg.type_out(114))
    /
    EMPID   LAST_NAME                             EMAIL
    ------- ------------------------------------- -------------------------------------
    114     Raphaely                              DRAPHEAL
    1 row selected.
    

    ;)

  • Hello everyone! I need an application where I can hand write or type and draw, all in the same...

    Hello everyone! I need an application where I can hand write or type and draw, all on the same page,.

    I'm taking courses in biology and chemistry and sometimes I need to draw and explain

    Can someone help me?

    Thank you!

    I need an application where I can hand write or type and draw, all on the same page, I'm taking courses in biology and chemistry and sometimes I need to draw and explain

    @manuelito.castro,.

    Discover the "Mobilenoter" application, that includes the possibility of ink in free form. If you need to be able to classify and organize your writings, Mobilnoter works perfectly with a single Note.

    -Doc

  • Can I write a .bat file to list all files of a specific type?

    With the help that I am here, I wrote a simple .bat file that lists all the files in a directory that I chose.

    I would now like to make a version of which lists all the files in the specified directory that have a .wav extension. Is this possible?

    Here are the existing syntax:

    D:
    CD D:\inetpub\kthings
    dir > C:\tftDocuments.txt
    TYPE tftDocuments.txt

    Can I write a .bat file to list all files of a specific type?

    I do not know.  Can you?

    Tips:

    Go here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

    Or just open a command prompt window (start > run > cmd > OK), and then type a command followed by the characters /? to see information about this command.

    For example, try

    dir /?

    You should also read http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/batch.mspx?mfr=true this http://technet.microsoft.com/en-us/library/bb490982.aspx and maybe this http://www.pcstats.com/articleview.cfm?articleID=1767

  • How can I mass move symbols with their trajectories without creating new keyframes?

    I want to move a large number of symbols at the same time if they are off centered or just need to be moved to see the different styles in the document, but I can't seem to move a lot of symbols at the same time, only a slexting of time their trajectories. It's quite annoying when I have points to settle at different times and re upholster everything one by one if I want to make things even by 1 px. Whenever I slecect all my symbols and try to move it's just creates a new keyframe they follow. Is there any tool or way select the symbols and/or their trajectories, move them without creating new keyframes?

    Hello

    There is no direct way to move all the symbols / beginning of the motion tweens to different images in total, but the following steps should help you make.

    1 Select a trajectory on stage, goto Properties Panel > menu Options (upper-left) and turn on - always show the trajectories.

    2 Select - change multiple images option in the timeline panel.

    3. adjust frame-markers in the timeline to display all your symbols, paths, etc.

    4. now that you see all your symbols and paths together, Select all and move them together. Or, use SHIFT + click to select the objects/paths of movement in a selective way and move them.

    Let me know if you have any doubts...

    Kind regards

    Mabrouk

  • Can I create a PageDefinition without creating a Page

    Dear all,

    Help me, I can create a Page definition without creating the page.


    Concerning
    KT

    Thank you, ~ Abhijit, John, Puthanampatti, vinod_t_krishnan,-Arun, Frank. Now, I see very clearly the solutions. Thanks much for posting me the solution.

    Step 1.

    Generate the XML file and add the following inside the XML file.



    version = "11.1.1.52.35" id = "test1PageDef".
    Package = "Oracle.kt.testing.View.pageDefs" > / / This is the name of the package.

    Step 2.
    Save Page to DataBindings.cpx Def



    path="Oracle.KT.testing.view.pageDefs.test1PageDef"/ >

    Step 3.
    Restart JDeveloper,
    After reboot, JDeveloper show my XML file as the Page with its symbol definition.

    Note:
    In my project, I need to create more than 10 excel workbook, but not need to display as a Page. . I think that when we used the Page definition and remove all the components of the UI here and leave as empty page jspx. After we deployed the application to the server, maybe all the white page will hold certain amount of space on the server. Looks Like, create single Page definition of Excel workbook features ADF :)

    Concerning
    KT

    Published by: KT on February 3, 2012 17:34

  • You can create an application iPad w / two H &amp; V layouts without creating copies of everything?

    You can create an application iPad w / two H & V layouts without creating copies of everything?

    You must make separate models for H and V.

    Neil

  • Using the function PLSQL return Record Type Index of Tables in ADF

    I have a PLSQL function, a return type. My ultimate goal is to take this binary integer index Table and print it on the screen...

    CREATE OR REPLACE PACKAGE my_pkg IS
     
    TYPE t_col IS RECORD(
     
    i NUMBER,
     
    n VARCHAR2(30));
     
    TYPE t_nested_table IS TABLE OF t_col;
     
      FUNCTION return_table RETURN t_nested_table ;
    END my_pkg;


    OPTION 1:

    1) has anyone got best practices to accept plsql RECORDS returned by a function?

    Here is an example.

    http://adfpractice-Fedor.blogspot.SG/2013/01/working-with-PLSQL-procedures-in-ADF-BC.html

    But it will be a lot of work... first of all accept the results in a loop... then store in a temporary storage can be a few VO or global temporary table and then display them on the page


    OPTION 2:

    Using the functions PIPLELINED and use in the select statement.  While I can use this select statement in the SQL query to create VO... and drag and drop the VO...

    CREATE OR REPLACE PACKAGE my_pkg IS
     
    TYPE t_col IS RECORD(
     
    i NUMBER,
     
    n VARCHAR2(30));
     
    TYPE t_nested_table IS TABLE OF t_col;
     
      FUNCTION return_table RETURN t_nested_table PIPELINED;
    END my_pkg;


    select * from table(my_pkg.return_table);


    Wow... I'm so smart! .. really possible?  who is the best/possible/recommended option?

    I'm sure that will be the question most read by many who wants to use PLSQL instead of JAVA to the treatment and CHOSEN to use only to display the output of the PLSQL functions or procedures.


    Thank you

    Rahul


    Dario

    Do you mean the scope of the defined Type pkg will be finished?

    I created guy outside the pkg as 'Create Type' if it works in this case?

    Yes, level objects schema (created with "create or replace type...") can be used in java and this can work.

    I think that then the scope of this TYPE will remain until the user session passes.

    Object definitions is not worn, but have their bodies.

    So, if you instantiate the data level object type schema in a plsql function, scope of this object is this function.

    Of course, if you instantiate the object as a variable package, then life of this object is equal to the lifetime of the package (which usually equals life of session db).

    Dario

  • a function that returns the type with a table joint!

    Good day to all,
    I have a function that returns a type.

    so I select it as:
    Select * from table (function (param1, param2))

    now I want to combine this with a table so that the settings for the service we get from the join table. Is this possible? And how?
    I tried different options without success.

    something like:
    Select *.
    table table (function (b.column1, b.columnb) x), tablea b
    where x.a = b.col

    Is this possible?

    Thanks in advance?

    user564819 wrote:

    something like:
    Select *.
    table table (function (b.column1, b.columnb) x), tablea b
    where x.a = b.col

    Is this possible?

    Somehow...

    SQL> create or replace type TIntegers is table of integer;
      2  /
    
    Type created.
    
    SQL>
    SQL> --// our sample pipeline simply spews 2 numbers for eevry number input - simple
    SQL> --// to use for the testcase below
    SQL> create or replace function FooPipe( n number ) return TIntegers pipelined is
      2  begin
      3          pipe row( trunc(n) );
      4          pipe row( trunc(n)*-1 );
      5          return;
      6  end;
      7  /
    
    Function created.
    
    SQL>
    SQL> with dataset( n ) as(
      2          --// ignore this part as it only builts a base table
      3          --// for us to use to select values for input to
      4          --// to the pipeline - in "real world" use this table
      5          --// will already exist
      6          select
      7                  level
      8          from    dual
      9          connect by level <= 10
     10  ),
     11  pipe_line( n, array ) as(
     12          --// we run the pipeline as a nested table column
     13          --// in the SQL projection - the CAST is important
     14          --// in order to establish the nested table type
     15          select
     16                  d.n,
     17                  cast(
     18                          FooPipe(d.n) as TIntegers
     19                  )
     20          from    dataset d
     21  )
     22  --// we now use a standard query to unnest the nested table column
     23  select
     24          p.n,
     25          pipe_val.*
     26  from       pipe_line p, TABLE(p.array)  pipe_val
     27  /
    
             N COLUMN_VALUE
    ---------- ------------
             1            1
             1           -1
             2            2
             2           -2
             3            3
             3           -3
             4            4
             4           -4
             5            5
             5           -5
             6            6
             6           -6
             7            7
             7           -7
             8            8
             8           -8
             9            9
             9           -9
            10           10
            10          -10
    
    20 rows selected.
    
    SQL>
    

    Not sure I like it. What is the real problem that this method (driving a pipeline with input of a base table rows) is supposed to address? There may be a simpler and more elegant approach...

  • Is it Possible to use a function when you create a table?

    Hello

    Is it possible to use a function during the construction of a table?

    I would like to browse my data returned from the db and call a function. The part where I call the function "myFunction [i]" doesn't seem to work. How can I solve this problem? I need to put the function call results in the table.

    var i: uint;

    for (i = 0; i < dataArray.Length; i ++)

    {

    dgArray = [{name: dataArray [i] .name, Type: myFunction [i]}];

    }

    Thank you!
    -Laxmidi

    Hi laxmi,

    Yes of course it is quite possible to use a function when you create a table... In your code, you made some mistakes...

    You used hooks to call the function myFunction [i]... where you are supposed to use parentheses... myFunc (i)... and other you must push the object in the dgArray but yous hould not not attribute...

    dgArray = [{name: dataArray [i] .name, Type: myFunction [i]}]; This will result in only the last table iterates in dgArray...

    So you should write dgArray.push ({name: dataArray [i] .name, Type: (i) myFunction});

    Check out the code below...


    http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete ="init (); » >

      private var dgArray:Array = new Array();
    private var myDataArray:Array = [{data: '1', name: 'Robert'}, {data: '2', name: 'Nicolas'}, {data: '3', name: "Bika"}]
     
    private function init (): void
    {
    for (var i: int = 0; i
    {
    dgArray.push ({name: dataArray [i] .name, Type: (i) myFunction});
    }
    }
      
    private void myFunction(i:int):String
    {
    Return 'Type' + i;
    }
    ]]>

    If this post answers your question or assistance, please mark it as such.

    Thank you

    Jean Claude Chari

  • I can't write CD on Satellite Pro P100-347

    I was recently bought a Satellite Pro P100-347 with Windows XP MCE installed as a desktop computer (the store didn't inform the person who has bought a laptop that was not networked). We have purchased a full copy of Windows XP Pro and booted from the disk, formatted the hard drive and installed XP Pro instead of the ERM and then downloaded and installed all the drivers on the Toshiba site.

    I had the "failure to obtain read handle" error starting but followed the recommendations on this site and removed the toshibarc.exe of the registry. Now, the only thing I still need is to get the CD of drivers, because even though I can play CDs and copy on their part, I can't write CD - if I put a blank CD in the drive and select the option to create the writable CD folder, I get an error that says ' D: / is not accessible. Incorrect function. "

    I downloaded and installed the DVD-RAM drivers, but I can't find those specifically for the CD. Can anyone help?

    Thanks in advance,

    Jeremy Jones

    Hello

    In my opinion, you should check the properties of the disk and click the recording tab.
    CD recording option on this drive must be marked.

    I had a similar problem and this hidden option was responsible for registration on my laptop problems

  • Why even after having changed the permissions can't write to my files?

    I moved files on "users / shared" on the imac 27 "my father Yosemite retina.  He got last June but was not able to migrate because of her old imac was in Florida and North Carolina.  So, I migrated the old imac again with time machine backup charges a few months after getting the computer.  Now, I'm trying to merge the 'old' on the new computer account with the migrated account 'new', I restored it with time machine from the old imac.  I thought I was smart "passage" large libraries of film and photo of users / shared and that the account migrated from old imac. (on the same computer again) But I have no write permissions for files on the migrated account.  And making matters worse, while I can't write to files, I'm still able to corrupt them trying to change permissions and try to load them with i-movie and what not.  So now, I have a 6 GB corrupted movie library and not backup.  I tried it duplication and corrupt also.

    So my question would be "why is it when I add to the new migration full privileges to user for these files, I always failed to write about them?  Now instead, I wonder if there is a way I can fix the corrupted film library file.  Film - I tried and failed on the double.    I tried available i-movie file to 'all' as well as the addition of the new migrated user full privileges to it.  While I was able to do it without error (it seems to take the changes) or the new migrated user or former user on the new computer can write to the file (i-film library) at this stage.

    Every article help I read says just to click on info and change the privileges for what I did.  So I'm pulling my hair out.

    Hope that I was not too confusing in the way that I want to talk about the two different accounts.

    Reset user - file property See post by Linc Davis

    You may need to restore the permissions on your user account. To do this, start on your recovery partition (hold down the command and R during startup) and open Terminal from the Utilities menu. In the Terminal, type: 'resetpassword' (without the), press return, and then select the admin user. You do not have to reset your password. Click the icon of your Mac hard drive at the top. In the list box below, select the user account that has problems. At the bottom of the window, you will see a box labeled restore Home Directory permissions and ACLs. Click the button to reset there. The process takes a few minutes. When you're finished, restart.

    Fix the permissions of the user

Maybe you are looking for