View based on PL/SQL table?

I'd like to create a view based on a PL/SQL memory table (records of %rowtype). Has anyone done this? The idea is, based on the where clause (or lack of one), the view definition containts call to a stored procedure that builds the rows to be returned. Ideas?
Tom-

Pipelined function - based example:
SQL> create or replace package my_pkg
  2  is
  3   type nested_tab_type is table of emp%rowtype;
  4   nt_instance nested_tab_type := nested_tab_type();
  5   function get_nt_instance return nested_tab_type pipelined;
  6  end;
  7  /
Package created.
SQL> create or replace package body my_pkg
  2  is
  3   function get_nt_instance return nested_tab_type pipelined
  4   is
  5   begin
  6    for j in 1..nt_instance.count loop
  7     pipe row(nt_instance(j));
  8    end loop;
  9    return;
10   end;
11  end;
12  /
Package body created.
SQL> create or replace view nt_view as
  2  select ename,sal from table(my_pkg.get_nt_instance)
  3  /
View created.
SQL> begin
  2   select * bulk collect into my_pkg.nt_instance
  3   from emp
  4   where deptno = 10;
  5  end;
  6  /
PL/SQL procedure successfully completed.
SQL> select * from nt_view;
ENAME             SAL
CLARK            2450
KING             5000
MILLER           1300
SQL> begin
  2   my_pkg.nt_instance.delete;
  3   select * bulk collect into my_pkg.nt_instance
  4   from emp
  5   where deptno = 20;
  6  end;
  7  /
PL/SQL procedure successfully completed.
SQL> select * from nt_view;
ENAME             SAL
SMITH            1000
JONES            2975
SCOTT            3000
ADAMS            1100
FORD             3000Object -based example:
SQL> create or replace type emp_obj is object (ename varchar2(10), sal number(7,2));
  2  /
Type created.
SQL> create or replace type emp_obj_t is table of emp_obj;
  2  /
Type created.
SQL> create or replace package my_pkg
  2  is
  3   emp_t_instance emp_obj_t := emp_obj_t();
  4   function get_emp_t_instance return emp_obj_t;
  5  end;
  6  /
Package created.
SQL> create or replace package body my_pkg
  2  is
  3   function get_emp_t_instance return emp_obj_t
  4   is
  5   begin
  6    return emp_t_instance;
  7   end;
  8  end;
  9  /
Package body created.
SQL> create or replace view nt_view as
  2  select ename,sal from table(my_pkg.get_emp_t_instance)
  3  /
View created.
SQL> begin
  2   select emp_obj(ename,sal) bulk collect into my_pkg.emp_t_instance
  3   from emp
  4   where deptno = 10;
  5  end;
  6  /
PL/SQL procedure successfully completed.
SQL> select * from nt_view;
ENAME             SAL
CLARK            2450
KING             5000
MILLER           1300
SQL> begin
  2   my_pkg.emp_t_instance.delete;
  3   select emp_obj(ename,sal) bulk collect into my_pkg.emp_t_instance
  4   from emp
  5   where deptno = 20;
  6  end;
  7  /
PL/SQL procedure successfully completed.
SQL> select * from nt_view;
ENAME             SAL
SMITH            1000
JONES            2975
SCOTT            3000
ADAMS            1100
FORD             3000Rgds.

Similar Messages

  • Bulk selection based on PL/SQL table

    Hi forum,
    I have a defined a pl/sql table named keys, contains 2 column keys(i).key and keys(i).desc.Now my requirement is to fetch the data based on from oracle table based on key strored in pl/sql table.
    I know that one option is to iterate through the table.like
    for i in 1..keys.count
    select value into x from <table> where key = keys(i).key
    Any options available to fetch the data in bulk by passing pl/sql table keys at once?
    Thanks in advance...
    Rgds,
    Aneesh A

    Something like this:
    SELECT empno, ename
      FROM emp
    WHERE deptno = 10
    ORDER BY deptno
         EMPNO ENAME
          7782 CLARK
          7839 KING
          7934 MILLER
    -- "record type"
    CREATE TYPE dept_type AS OBJECT (
       deptno NUMBER(2),
       dname  VARCHAR2(14),
       loc    VARCHAR2(13)
    -- nested table type
    CREATE TYPE dept_tab_type AS TABLE OF dept_type
    SET SERVEROUTPUT ON
    DECLARE
       l_dept_tab dept_tab_type;
    BEGIN
       SELECT dept_type (deptno, dname, loc)
         BULK COLLECT INTO l_dept_tab
         FROM dept
        WHERE deptno = 10;
       FOR rec IN (
         SELECT empno, ename
           FROM emp e,
                TABLE (l_dept_tab) d -- <=
          WHERE e.deptno = d.deptno
          ORDER BY empno)
       LOOP
          DBMS_OUTPUT.PUT_LINE (rec.empno || ' ' || rec.ename);
       END LOOP;
    END;
    7782 CLARK
    7839 KING
    7934 MILLERBut:
    1. you can't use associative array ("PL/SQL table" is Oracle 7 termin) - you must use nested table
    2. nested table type (and "record type") must be server defined
    3. (or 1.) using collection for million of records is not good approach - use SQL instead of PL/SQL!
    Regards,
    Zlatko Sirotic

  • Listing Views based on a given Table

    With a query how to list the names of views that are based on a given table.

    SELECT NAME,  REFERENCED_NAME FROM ALL_DEPENDENCIES
    WHERE TYPE = 'VIEW'
       AND REFERENCED_NAME = 'table_name'
    [/CODE]

  • Forms based on  PL/SQL table/ref_cursor

    I fail to tetrieve selected records from a stored package.procedure(which I have created as a ref_cursor to PL/SQL table and specifying a criteria in the forms where clause)
    Please any one suggest ?

    I suggest you read the [url http://forums.oracle.com/forums/help.jspa]FAQ and [url http://blogs.oracle.com/shay/2007/03/02]The 10 Commandments on OTN Forum Posting
    Forms version and an error message would help us to help you, we don't have crystal balls, we cannot guess.

  • Create Materialized View  based on another database table using db link?

    SQL> SELECT sysdate
    2 FROM dual@CBRLINK ;
    SYSDATE
    21-NOV-12
    SQL> CREATE MATERIALIZED VIEW USERCBR.V_T24_COUNTRY1
    2 REFRESH COMPLETE
    3 START WITH SYSDATE NEXT SYSDATE + (5/24)
    4 AS
    5 SELECT sysdate
    6 FROM dual@CBRLINK ;
    CREATE MATERIALIZED VIEW USERCBR.V_T24_COUNTRY1
    ERROR at line 1:
    ORA-04052: error occurred when looking up remote object SYS.DUAL@CBRLINK
    ORA-00600: internal error code, arguments: [ORA-00600: internal error code,
    arguments: [qksfroFXTStatsLoc() - unknown KQFOPT type!], [0], [], [], [], [],
    ORA-02063: preceding line from CBRLINK

    It works for me:orcl>
    orcl> CREATE MATERIALIZED VIEW scott.V_T24_COUNTRY1
      2  REFRESH COMPLETE
      3  START WITH SYSDATE NEXT SYSDATE + (5/24)
      4  AS
      5  SELECT sysdate
      6  FROM dual@l1 ;
    Materialized view created.
    orcl> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for 32-bit Windows: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    orcl>so there is no problem with the code. HTH.

  • Grand Total Not working on Materialized view based table ??

    Hi all,
    I have a complex report report by using sum and decode function. I precalculated my requirment in database and then create a materialized view based on my sql statement. I import this view in physical and BM model and its results very fine and efficient. But the problem create when I implement Grand Total on my report in table view it did'nt work means (Grand Total is not working on this MV based table) Any idea why ??
    any reply would by higly appriciated.
    Regards

    Hi Zishan,
    Check the Aggregation Rule and set it to sum in the table view.
    That is go to the "edit formula" tab of the column for which you want grand total and set that to sum.
    Hope this will help.
    Thanks
    Ashok

  • Update a field in view, based on change in one of it's tables.

    Hi,
    I have created a Maintenance view based on three DB tables.
    My requirement is if i change data in one the database tables the view should get automatically updated with the new data.
    Could anyone please soleve my issue, points are definite.
    Thanks and regards,
    raghavendra goutham p.

    Hi,
       any changes to the database field value will
       automatically gets reflected in view .
       please check it.
    Regards
    Amole

  • Global Temp Table or PL/SQL Table

    I am trying to determine if this can be done only using PL/SQL table. If not, will the usage of the global temp table affects the performance.
    Here is the situation,
    I have a data block that is based on a stored procedure. This stored procedure will return table of records from different database tables with join conditions. Some of the fields within the table of records will not have data returned from database tables. They will be the fields displayed on the form and the data will be entered by user.
    For example:
    Records will look like:
    Id          (will be populated by procedure)
    Hist_avg     (will be populated by procedure)
    My_avg     (will be used as field on the form so that user can enter their own avg)
    Cheked     (will be populated by procedure)
    My questions are:
    1.     Is this doable in form using a data block based on PL/SQL table?
    2.     Will users be able to manipulate (update) the data that based on the PL/SQL table in the memory as they wish and invoke the procedure to update the underlying table when clicking on a button (Update Avg)?
    3.     What is the advantage of using PL/SQL table and global temp table from database and form point of views?
    Any info is appreciated.

    Hi there...
    Here is the Reference...
    http://asktom.oracle.com/pls/ask/f?p=4950:8:2939484874961025998::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:604830985638
    Best Regards...
    Muhammad Waseem Haroon

  • Creating View based on Current and previous data from same table

    I am trying to create a view based on a table called “my_companies”. The table has following columns: “company_id”, “start_date”, “product_type_code”, “partner_id”
    The main purpose of this view is to obtain previous company_id’s associated with a particular “partner_id“and “product_type_code”. So basically, I’m looking to create an extra column, say “prev_company_id” in the view along with all the other columns. The “previous” data can be obtained depending on the “start_date”. I’m not able to write a query successfully to do this.
    Can anyone help? Thanks in advance.

    Hi,
    Whenver you have a question, it helps to post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data
    (4) Your best attempt so far
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    Formatted tabular output is okay for (3). Type before and after the tabular text, to preserve spacing.  The sample results should include any special cases that you foresee, such as one company having many previous companies, or vice-versa.
    It sounds like might need a +self-join+, where you have two copies of the same table, as if the current companies were in one table and the previous companies were in another, even though they are all actually in the same table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Want to update data in a view based on multiple tables

    Hi
    I am facing a problem i want to update data in tables using a view. As that view is based on multiple tables so i am unable to update data. i came to know we can update table from view only if view is based on single table. so if anyone knows any alternative please let me know.
    Thanx
    Devinder

    Devinder,
    The table can be updated through a view based on multiple tables, if and only if the table is a "key preserved" table. Rather than explaining myself, i avoided the burden of typing by finding the material in Oracle Docs and pasting it for you :-)
    If you want a join view to be updatable, all of the following conditions must be
    true:
    1. The DML statement must affect only one table underlying the join.
    2. For an INSERT statement, the view must not be created WITH CHECK
    OPTION, and all columns into which values are inserted must come from a
    key-preserved table. A key-preserved table in one for which every primary
    key or unique key value in the base table is also unique in the join view.
    3. For an UPDATE statement, all columns updated must be extracted from a
    key-preserved table. If the view was created WITH CHECK OPTION, join
    columns and columns taken from tables that are referenced more than once
    in the view must be shielded from UPDATE.
    4. For a DELETE statement, the join can have one and only one key-preserved
    table. That table can appear more than once in the join, unless the view was
    created WITH CHECK OPTION.
    HTH
    Naveen

  • Table View in View-based Application

    Hi.
    I want to use an UITableView in a View-based Application.
    All examples I found are for Navigation-based Applications.
    I Found only one example for View-based Applications, but it create all components himself without the Interface-Builder.
    I search an example with Interface-Builder.
    My main problem is, when i create a view with Interface-Builder, the controller class does not inherit from UITableViewController.

    GrinderFX wrote:
    I want to use an UITableView in a View-based Application.
    Hi, and welcome to the Dev Forum!
    Firstly, I would point out that you don't need to use UITableViewController to control a table view. The table view controller is just more convenient. So for example, you could simply drag a table view from the library in IB and drop it onto your view. Then you could hook up the table view's dataSource and delegate outlets to the File's Owner. Then you would add the data source and delegate protocols to the @interface of your UIViewController subclass and add the required data source and delegate methods to the @implementation.
    I mention the above because building your table view that way is very instructive. If you want to learn more about table views in general I would recommend Chapter 8 of +Beginning iPhone Development: Exploring the iPhone SDK by Mark and LaMarche+, which includes 3 table view projects that don't involve a navigation controller.
    My main problem is, when i create a view with Interface-Builder, the controller class does not inherit from UITableViewController.
    Returning to your specific question, IB allows you to change the class of an object. Here are the steps to use the View-Based Application template as you described (In the following I'm using Grinder as the name of the project; e.g. the app delegate class is named GrinderAppDelegate, and the view controller subclass is named GrinderViewController):
    1) _Change parent of view controller subclass in your code_
    In GrinderViewController.h, you only need to change the superclass from UIViewController to UITableViewController:
    @interface GrinderViewController : UITableViewController {
    However it will be easier later on if you make new files from the UITableViewController file template:
    a) Ctrl-click on GVC.h and GVC.m in the Groups & Files tree; select Delete->Also Move to Trash;
    b) Ctrl-click on Classes; select Add->New File->iPhone OS->Cocoa Touch Classes;
    c) Select UITableViewController subclass from the right center panel and click Next;
    d) File Name: GrinderViewController.m; check Also create GrinderViewController.h;
    e) Make sure the name for these new files is exactly the same as the ones you deleted; if you make a mistake here, delete the new files and start over, because that name must be the same in several other files;
    f) Click Finish; the replacement files should now appear under Classes.
    2) _Change the view controller class in IB_
    a) Double click on MainWindow.xib under Resources in the Groups & Files tree;
    b) Make sure the MainWindow.xib window is open by selecting Window->Document from the IB menu;
    c) Locate the View Mode switch, upper-left, in the xib window, and select the Center position;
    d) The xib window should now be displaying two columns with small icons on the left;
    e) Select the Grinder View Controller icon;
    f) Select Edit-Delete to delete that icon;
    g) Select Tools->Library from the menu, and expand Controllers in the Library Panel;
    h) Drag a Table View Controller to the xib window and drop it right under the app delegate icon;
    i) Select Tools->Identity Inspector from the menu to open the Grinder View Controller Identity Panel (the new Table View Controller should still be selected in the xib window);
    j) Under Class Identity, select Grinder View Controller from the list; tab out of the Class field to be sure the selection is recorded;
    k) Ctrl-Click on Grinder App Delegate and connect the view controller outlet (ctrl-drag) to Grinder View Controller;
    l) Expand GVC in the xib window and delete the Table View icon (since we want it in the other xib file);
    m) Reselect the GVC icon and open the Grinder View Controller Attributes panel;
    n) Under View Controller, select GrinderViewController from the NIB Name list;
    o) In the Table View Controller IB Editor window, select GrinderViewController.nib to open the other xib file;
    p) Make sure the GrinderViewController.xib window is open in small icon mode as in steps b-d above;
    q) The class of the File's Owner should be GrinderViewController;
    r) Delete the View icon;
    s) Drag a Table View from the Library to where the View icon was;
    t) Ctrl-click on File's Owner and connect (ctrl-drag) it's view outlet to the Table View;
    u) Ctrl-click on Table View: connect both the dataSource and delegate outlets to File's Owner;
    v) File->Save both xib files.
    3) _Make some rows in the table view and test_
    a) Open GrinderViewController.m in Xcode;
    b) Add the commented lines (be sure to use the correct line for your target OS);
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 20; // <-- change to more than zero
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    // Configure the cell
    // add this line for OS 2.x
    cell.text = [NSString stringWithFormat:@"Row %d", indexPath.row];
    // add this line for OS 3.0
    // cell.textLabel.text = [NSString stringWithFormat:@"Row %d", indexPath.row];
    return cell;
    c) Build and Go.
    I should add that the procedure might be a little easier if you start with the Window-Based Application Template. But the above is good practice in editing xib files.
    Hope that's helpful!
    - Ray

  • Creating a PL/SQL table based on XML file.

    I have created two procedures to try and achieve the problem at hand.
    It retrieves and displays the record from a DBMS_OUTPUT.PUT_LINE prospective as indicated in (1&2), but I am having difficulty loading these values into a PL/SQL table from the package labeled as (3).
    All code compiles. (1&2) work together, (3) works by itself but will not populate the table, and I get no errors.
    1.The first being the one that retrieves the XML file and parses it.
    CREATE OR REPLACE procedure xml_main is
    P XMLPARSER.Parser;
    DOC CLOB;
    v_xmldoc xmldom.DOMDocument;
    v_out CLOB;
    BEGIN
    P := xmlparser.newParser;
    xmlparser.setValidationMode(p, FALSE);
    DOC := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <com.welligent.Student.BasicStudent.Create>
    <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" messagePriority="1" messageType="Sync">
    <Sender>
    <MessageId>
    <SenderAppId>com.openii.SyncRouter</SenderAppId>
    <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
    <MessageSeq>53</MessageSeq>
    </MessageId>
    <Authentication>
    <AuthUserId>Router</AuthUserId>
    </Authentication>
    </Sender>
    <Datetime>
    <Year>2001</Year>
    <Month>3</Month>
    <Day>23</Day>
    <Hour>13</Hour>
    <Minute>47</Minute>
    <Second>30</Second>
    <SubSecond>223</SubSecond>
    <Timezone>6:00-GMT</Timezone>
    </Datetime>
    </ControlAreaSync>
    <DataArea>
    <NewData>
    <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    <StudentNumber>052589F201</StudentNumber>
    <ExternalIdNumber>1234567890</ExternalIdNumber>
    <StateIdNumber>123456</StateIdNumber>
    <Name>
    <LastName>Lopez</LastName>
    <FirstName>Maria</FirstName>
    <MiddleName>S</MiddleName>
    </Name>
    <Gender>Female</Gender>
    <BirthDate>
    <Month>1</Month>
    <Day>1</Day>
    <Year>1995</Year>
    </BirthDate>
    <Race>Hispanic</Race>
    <Ethnicity>Hispanic</Ethnicity>
    <PrimaryLanguage>English</PrimaryLanguage>
    <HouseholdLanguage>Spanish</HouseholdLanguage>
    <Address>
    <Street>123 Any Street</Street>
    <ApartmentNumber>12-D</ApartmentNumber>
    <City>Los Angeles</City>
    <County>Los Angeles</County>
    <State>CA</State>
    <ZipCode>90071</ZipCode>
    </Address>
    </BasicStudent>
    </NewData>
    </DataArea>
    </com.welligent.Student.BasicStudent.Create>';
    --v_out  := DOC;
    SYS.XMLPARSER.PARSECLOB ( P, DOC );
    v_xmldoc := SYS.XMLPARSER.getDocument(P);
    --DBMS_LOB.createtemporary(v_out,FALSE,DBMS_LOB.SESSION);
    --v_out := SYS.XMLPARSER.PARSECLOB ( P, DOC );
    --SYS.XMLDOM.writetoCLOB(v_xmldoc, v_out);
    --INSERT INTO TEST (TEST_COLUMN)
    --VALUES(V_OUT);
    --printElements(v_xmldoc);
    printElementAttributes(v_xmldoc);
    exception
    when xmldom.INDEX_SIZE_ERR then
    raise_application_error(-20120, 'Index Size error');
    when xmldom.DOMSTRING_SIZE_ERR then
    raise_application_error(-20120, 'String Size error');
    when xmldom.HIERARCHY_REQUEST_ERR then
    raise_application_error(-20120, 'Hierarchy request error');
    when xmldom.WRONG_DOCUMENT_ERR then
    raise_application_error(-20120, 'Wrong doc error');
    when xmldom.INVALID_CHARACTER_ERR then
    raise_application_error(-20120, 'Invalid Char error');
    when xmldom.NO_DATA_ALLOWED_ERR then
    raise_application_error(-20120, 'Nod data allowed error');
    when xmldom.NO_MODIFICATION_ALLOWED_ERR then
    raise_application_error(-20120, 'No mod allowed error');
    when xmldom.NOT_FOUND_ERR then
    raise_application_error(-20120, 'Not found error');
    when xmldom.NOT_SUPPORTED_ERR then
    raise_application_error(-20120, 'Not supported error');
    when xmldom.INUSE_ATTRIBUTE_ERR then
    raise_application_error(-20120, 'In use attr error');
    END;
    2. The second which displays the values from the .xml file I initialized above.
    CREATE OR REPLACE procedure printElementAttributes(doc xmldom.DOMDocument) is
    nl XMLDOM.DOMNODELIST;
    len1           NUMBER;
    len2 NUMBER;
    n      XMLDOM.DOMNODE;
    e      XMLDOM.DOMELEMENT;
    nnm      XMLDOM.DOMNAMEDNODEMAP;
    attrname VARCHAR2(100);
    attrval VARCHAR2(100);
    text_value VARCHAR2(100):=NULL;
    n_child XMLDOM.DOMNODE;
    BEGIN
    -- get all elements
    nl := XMLDOM.getElementsByTagName(doc, '*');
    len1 := XMLDOM.getLength(nl);
    -- loop through elements
    FOR j in 0..len1-1 LOOP
    n := XMLDOM.item(nl, j);
    e := XMLDOM.makeElement(n);
    DBMS_OUTPUT.PUT_LINE(xmldom.getTagName(e) || ':');
    -- get all attributes of element
    nnm := xmldom.getAttributes(n);
         n_child:=xmldom.getFirstChild(n);
    text_value:=xmldom.getNodeValue(n_child);
    dbms_output.put_line('val='||text_value);
    IF (xmldom.isNull(nnm) = FALSE) THEN
    len2 := xmldom.getLength(nnm);
              dbms_output.put_line('length='||len2);
    -- loop through attributes
    FOR i IN 0..len2-1 LOOP
    n := xmldom.item(nnm, i);
    attrname := xmldom.getNodeName(n);
    attrval := xmldom.getNodeValue(n);
    dbms_output.put(' ' || attrname || ' = ' || attrval);
    END LOOP;
    dbms_output.put_line('');
    END IF;
    END LOOP;
    END printElementAttributes;
    3. The package trying to insert into a PL/SQL table.
    CREATE OR REPLACE PACKAGE BODY XMLSTUD2 AS
    PROCEDURE STUDLOAD
    IS
    v_parser xmlparser.Parser;
    v_doc xmldom.DOMDocument;
    v_nl xmldom.DOMNodeList;
    v_n xmldom.DOMNode;
    DOC CLOB;
    v_out CLOB;
    n2 XMLDOM.DOMNODELIST;
    TYPE stuxml_type IS TABLE OF STUDENTS%ROWTYPE;
    s_tab stuxml_type := stuxml_type();
    --l_sturec students%rowtype;
    BEGIN
    -- Create a parser.
    v_parser := xmlparser.newParser;
    xmlparser.setValidationMode(v_parser, FALSE);
    DOC := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <com.welligent.Student.BasicStudent.Create>
    <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" messagePriority="1" messageType="Sync">
    <Sender>
    <MessageId>
    <SenderAppId>com.openii.SyncRouter</SenderAppId>
    <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
    <MessageSeq>53</MessageSeq>
    </MessageId>
    <Authentication>
    <AuthUserId>Router</AuthUserId>
    </Authentication>
    </Sender>
    <Datetime>
    <Year>2001</Year>
    <Month>3</Month>
    <Day>23</Day>
    <Hour>13</Hour>
    <Minute>47</Minute>
    <Second>30</Second>
    <SubSecond>223</SubSecond>
    <Timezone>6:00-GMT</Timezone>
    </Datetime>
    </ControlAreaSync>
    <DataArea>
    <NewData>
    <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    <StudentNumber>052589F201</StudentNumber>
    <ExternalIdNumber>1234567890</ExternalIdNumber>
    <StateIdNumber>123456</StateIdNumber>
    <Name>
    <LastName>Lopez</LastName>
    <FirstName>Maria</FirstName>
    <MiddleName>S</MiddleName>
    </Name>
    <Gender>Female</Gender>
    <BirthDate>
    <Month>1</Month>
    <Day>1</Day>
    <Year>1995</Year>
    </BirthDate>
    <Race>Hispanic</Race>
    <Ethnicity>Hispanic</Ethnicity>
    <PrimaryLanguage>English</PrimaryLanguage>
    <HouseholdLanguage>Spanish</HouseholdLanguage>
    <Address>
    <Street>123 Any Street</Street>
    <ApartmentNumber>12-D</ApartmentNumber>
    <City>Los Angeles</City>
    <County>Los Angeles</County>
    <State>CA</State>
    <ZipCode>90071</ZipCode>
    </Address>
    </BasicStudent>
    </NewData>
    </DataArea>
    </com.welligent.Student.BasicStudent.Create>';
    -- Parse the document and create a new DOM document.
    SYS.XMLPARSER.PARSECLOB ( v_parser, DOC );
    v_doc := SYS.XMLPARSER.getDocument(v_parser);
    -- Free resources associated with the Parser now it is no longer needed.
    xmlparser.freeParser(v_parser);
    -- Get a list of all the STUD nodes in the document using the XPATH syntax.
    v_nl := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address');
    dbms_output.put_line( 'New Stud processed on '||to_char(sysdate, 'YYYY-MON-DD'));
    -- Loop through the list and create a new record in a tble collection
    -- for each STUD record.
    FOR stud IN 0 .. xmldom.getLength(v_nl) - 1 LOOP
    v_n := xmldom.item(v_nl, stud);
    s_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
         --s_tab(s_tab.last).STUDENT_ID :=xslprocessor.valueOf(v_n,'StudentNumber');
         --s_tab(s_tab.last).SSN :=xslprocessor.valueOf(v_n,'ExternalIdNumber');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'StateIdNumber');
         s_tab(s_tab.last).STUDENT_LAST_NAME :=xslprocessor.valueOf(v_n,'LastName');
         --dbms_output.put_line( s_tab(s_tab.last).STUDENT_LAST_NAME);
         s_tab(s_tab.last).STUDENT_FIRST_NAME :=xslprocessor.valueOf(v_n,'FirstName');
         --s_tab(s_tab.last).STUDENT_MI :=xslprocessor.valueOf(v_n,'MiddleName');
         --s_tab(s_tab.last).STUDENT_GENDER :=xslprocessor.valueOf(v_n,'Gender');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Month');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Day');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Year');
         --s_tab(s_tab.last).STUDENT_RACE :=xslprocessor.valueOf(v_n,'Race');
         --s_tab(s_tab.last).STUDENT_ETHNIC :=xslprocessor.valueOf(v_n,'Ethnicity');
         --s_tab(s_tab.last).STUDENT_PRI_LANG :=xslprocessor.valueOf(v_n,'PrimaryLanguage');
         --s_tab(s_tab.last).STUDENT_SEC_LANG :=xslprocessor.valueOf(v_n,'HouseholdLanguage');
         --s_tab(s_tab.last).STUDENT_STREET :=xslprocessor.valueOf(v_n,'Street');
         --s_tab(s_tab.last).STUDENT_APART_NO :=xslprocessor.valueOf(v_n,'ApartmentNumber');
         --s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'City'); 
         --s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'County');
         --s_tab(s_tab.last).STUDENT_STATE :=xslprocessor.valueOf(v_n,'State');
         --s_tab(s_tab.last).STUDENT_ZIP :=xslprocessor.valueOf(v_n,'ZipCode');
    END LOOP;
    FOR stud IN s_tab.first..s_tab.last LOOP
    dbms_output.put_line( s_tab(s_tab.last).STUDENT_LAST_NAME);
    INSERT INTO STUDENTS (
    SHISID, SSN, DOE_SCHOOL_NUMBER,
    PATIENT_TYPE, TEACHER, HOMEROOM,
    STUDENT_LAST_NAME, STUDENT_FIRST_NAME, STUDENT_MI,
    STUDENT_DOB, STUDENT_BIRTH_CERT, STUDENT_COMM,
    STUDENT_MUSA, STUDENT_FAMSIZE, STUDENT_FAMINCOME,
    STUDENT_UNINSURED, STUDENT_LUNCH, STUDENT_ZIP,
    STUDENT_STATE, STUDENT_COUNTY, STUDENT_STREET,
    STUDENT_APART_NO, STUDENT_PHONE, STUDENT_H2O_TYPE,
    STUDENT_WASTE_TRT, STUDENT_HOME_SET, STUDENT_NONHOME_SET,
    STUDENT_GENDER, STUDENT_RACE, STUDENT_ETHNIC,
    STUDENT_PRI_LANG, STUDENT_SEC_LANG, STUDENT_ATRISK,
    EMER_COND_MEMO, ASSIST_DEVICE_TYPE, SCHOOL_ENTER_AGE,
    STUDENT_CURR_GRADE, S504_ELIG_DATE, S504_DEV_DATE,
    S504_REV_DATE, STUDENT_504, STUDENT_IEP,
    IEP_EXP_DATE, GRAD_CLASS, TYPE_DIPLOMA,
    GRADE_RETAIN, LIT_PASS_TEST_MATH, LIT_PASS_DATE_MATH,
    LIT_PASS_TEST_WRITE, LIT_PASS_DATE_WRITE, LIT_PASS_TEST_READ,
    LIT_PASS_DATE_READ, SPEC_ED_ELIG, SPEC_ED_CODE,
    TRANSPORT_CODE, TRANSPORT_NO, PRIME_HANDICAP,
    PRIME_HANDICAP_PERCENT, PRIME_HANDI_MANAGER, FIRST_ADD_HANDI,
    FIRST_ADD_HANDICAP_PERCENT, FIRST_ADD_HANDI_504, FIRST_ADD_HANDI_504_DATE,
    SECOND_ADD_HANDI, SECOND_ADD_HANDICAP_PERCENT, MED_EXTERNAL_NAME,
    INS_TYPE, INS_PRI, INS_NAME,
    INS_MEDICAID_NO, ELIGDATE, INS_PRIV_INSURANCE,
    INS_APPR_BILL, INS_APPR_DATE, INS_PARENT_APPR,
    INS_POL_NAME, INS_POL_NO, INS_CARRIER_NO,
    INS_CARRIER_NAME, INS_CARRIER_RELATE, INS_AFFECT_DATE,
    INS_COPAY_OV, INS_COPAY_RX, INS_COPAY_AMBUL,
    INS_COPAY_EMER, INS_COPAY_OUTPAT, STUDENT_INACTIVE,
    PHYS_ID, ENCOUNTERNUM, USERID,
    MODDATE, STUDENT_ID, S504_DISABILITY,
    CHAPTER1, WELLNESS_ENROLL, SCHOOL_OF_RESIDENCE,
    INITIAL_IEP_DATE, CALENDAR_TRACK, USA_BORN,
    ALT_ID, FUTURE_SCHOOL, IEP_LAST_MEETING,
    IEP_LAST_SETTING, IEP_LAST_REFER_EVAL, THIRD_ADD_HANDI,
    LEP, GIFTED, IEP_EXIT_REASON,
    CASE_MANAGER_ID, INTAKE_NOTES, CALLER_PHONE,
    CALL_DATE, CALLER_RELATIONSHIP, CALLER_NAME,
    BUSINESS_PHONE, FAX, EMAIL,
    HIGHEST_EDUCATION, INTAKE_DATE, SERVICE_COORDINATOR,
    DISCHARGE_DATE, DISCHARGE_REASON, DISCHARGE_NOTES,
    INTAKE_BY, INTAKE_STATUS, IEP_LAST_SERVED_DATE,
    IEP_APC_DATE, IEP_EXIT_DATE, ADDRESS2,
    LEGAL_STATUS, RELIGION, EMPLOYMENT_STATUS,
    TARG_POP_GROUP1, TARG_POP_GROUP2, MARITAL_STATUS,
    THIRD_ADD_HANDI_PERCENT, LAST_INTERFACE_DATE, SERVICE_PLAN_TYPE,
    CURRENT_JURISDICTION, FIPS, BIRTH_PLACE_JURISDICTION,
    BIRTH_PLACE_HOSPITAL, BIRTH_PLACE_STATE, BIRTH_PLACE_COUNTRY,
    OTHER_CLIENT_NAME, SIBLINGS_WITH_SERVICES, PERM_SHARE_INFORMATION,
    PERM_VERIFY_INSURANCE, REFERRING_AGENCY, REFERRING_INDIVIDUAL,
    AUTOMATIC_ELIGIBILITY, INTAKE_IEP_ID, FUTURE_SCHOOL2,
    FUTURE_SCHOOL3, TRANSLATOR_NEEDED, TOTAL_CHILDREN_IN_HOME,
    REFERRED_BY, FAMILY_ID, SCREENING_CONSENT_FLAG,
    PICTURE_FILE, DUAL_ENROLLED, DOE_SCHOOL_NUMBER2)
    VALUES (123456789012, null,null ,
    null,null,null ,s_tab(stud).STUDENT_LAST_NAME
    , s_tab(stud).STUDENT_LAST_NAME,null ,
    null ,null ,null ,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null, null,null );
    END LOOP;
    COMMIT;
    -- Free any resources associated with the document now it
    -- is no longer needed.
    xmldom.freeDocument(v_doc);
    END STUDLOAD;
    END XMLSTUD2;
    /

    Hi
    I have created a PLSQL package based Oracle Portal
    form. This is created a s a databse provider. I have
    following questions to check :
    1. How to capture return values from the package and
    display different messages on success or failure ?
    - http://download.oracle.com/docs/cd/B14099_19/portal.1014/b14135/pdg_portletbuilder.htm#BABBAFGI
    Step 16
    2. How to return to blank form by intializing already
    entered values after successfuly process of the form
    data.
    - http://download.oracle.com/docs/cd/B14099_19/portal.1014/b14135/pdg_portletbuilder.htm#BABGBCHH
    thanks
    Manjith

  • Strange behaviour of view based on several tables join with union all

    Dear fellows we r facing a strange problem we have a view based on several tables joined by union all ,when we issue an ordered query on date,rows returned are unusually different than they should be .
    Is oracle has some special behaviour for view based on union all ?
    I m using oracle 8.1.6 on windows 2000
    Kashif Sohail

    Did you ever solve this problem? I have two select statements based on 4 tables and 3 views using about 5 more tables. When I execute each select individually I get exactly what is expected. When I UNION ALL both selects together, I get "no rows returned", however when I UNION them I get exactly what is expected. I should get the same answer for both UNION ALL and UNION. The two select statements are identical, except for one column where I changed the constant to be different. Any thoughts?

  • Developing database views between Oracle and SQL Server tables

    I am on Oracle 10.2, my organization has many SQL Server databases as well and has now made
    SQL server as company standard so many new databases will be developed in SQL Server. It is of course
    not possible to convert all Oracle databases to SQL Server, so a mix environment will exist. Two questions:
    1.     Is it possible to develop database views in Oracle (10g in my case) which join Oracle tables with tables in SQL Server 2008? If yes, how. I have seen some heterogeneous connectivity setup to connect SQL Server to Oracle, but not sure whether it is possible to develop a database view across two databases.
    2.     I know it is not a SQL Server forum, but many DBA’s know both Oracle and SQL Server. Is it possible to develop views in SQL Server (SQL Server 2008 R2 in my case) which join Oracle 10g and SQL Server 2008 tables? I know in SQL Server, there is way to set up linked servers, but do not know whether it is possible to develop views.
    Thanks a lot for your insight.

    You can create views that join local Oracle tables and remote SQL Server tables. I'm pretty sure you can do the reverse as well but I haven't personally done it.
    However, I would be very concerned about the performance you'd get if you created that sort of view. You'd very frequently end up in a situation where Oracle has to pull all the data in the remote table across the database link in order to apply predicates and join the data locally. That could be disastrous from a performance standpoint.
    Justin

  • View link between view based on entity(table) and view based on stored proc

    I've created a view based on a stored procedure. I need to link this view to a view based on an entity which is based on a table.
    I can create the view without issue, but when I attempt to run the application module that contains the relationship I get this error:
    (oracle.jbo.InvalidOperException) JBO-26016: Cannot set user query to view "SalesentityModuleApiView2" because it is a destination in a view link
    One thing that may be notable about this is that this view started out based on a database view. I later overrode the select related methods using the example here:
    http://download-east.oracle.com/docs/html/B25947_01/bcadvvo008.htm
    Any ideas? I will gladly post some code if someone will let me know what might help diagnose this.

    Hi,
    I solved my problem with adding transient field, and changing the value of it (true | false) on set method of field that can be changed so I can get which row was updated. What exactly do you mean when you say not updateable, I'm using a vo with no entity, and I can add, remove rows, in fact I think it's a good solution because I don't want to write to database immediately.

Maybe you are looking for

  • Average filter but the image is gray and not color RGB

    Hi, i use this code for an average filter 3x3, the result is the image whit average but gray and not RGB color.... why?? thanks in advance     public void Average()         int values[]=null;         int input2d[] = new int [image.getWidth()*image.ge

  • Cannot access SAPMNT hosted on NT Cluster

    We need to access SAPMNT hosted on CI node name R3-FFHK-CLS01 of the PRD NT cluster (CI and DB node) from another SAP QAS server name SAENUS. The SAPLOC and SAPMNT was created during SAP installation and have been granted everyone full control permis

  • Why is Photo stream not updating on my MacBook?

    Photostream is still very, very slow which is a little disappointing.. I have a very fast 100mbps down and 5mbps up Cable Internet connection so there is no problem there. The main problem tha I have is the iPhoto seems to not want to update the Phot

  • Not possible to add a new call in agenda with N97 ...

    I can not add a new call in the agenda, I dont understand if is a limit of N97 mini. It's a strange situation because with all my previous Nokia phone that was possible. It's a very usefull function because I can start the call directly with alert st

  • Flashing to grey desktop, post Mavericks install.

    I've got a  iMac on to which I installed Mavericks.  I lost the dock and the screen flashed between the normal desktop picture and  plain grey about every second or two (it's not constant).  I couldn't access mission control either.  I did have four