Apex french version of collection returns less records

Hi,
I have a collection when debuging it, I can see 5 rows on my collection which is correct but the actual report only shows two records (excludes ones with empty columns).
This is the result of my report which is based on this query
select c001,c002,c003||' km',c004,c005,c006 Description,c007
from wwv_flow_collections where
collection_name = 'C_QTY_SITE_DIST'
order by to_number(c003),c001
Magasin Quantité Distance Store Phone Store address Description Retail Sku
748 1 7,76 km 604-492-6262 Park Royal , 580 Park Royal North, West Vancouver BB 8520 NOIR 1386451
746 1 10,52 km 604-473-2500 Kitsilano , 2202 York Avenue, Vancouver BB 8520 NOIR 1386451
1 - 2
and this is my debug
C_QTY_SITE_DIST 1 783 - 1,04 604-492-5647 Caulfield Express , #190, 5341 Headland Drive, West Vancouver - - - - - - - - - - - - -
C_QTY_SITE_DIST 2 748 1 7,76 604-492-6262 Park Royal , 580 Park Royal North, West Vancouver BB 8520 NOIR 1386451 8520BLK2R - - - - - - - - - -
C_QTY_SITE_DIST 3 720 - 10,1 604-468-7800 Davie , 1674 Davie Street, Vancouver - - - - - - - - - - - - -
C_QTY_SITE_DIST 4 746 1 10,52 604-473-2500 Kitsilano , 2202 York Avenue, Vancouver BB 8520 NOIR 1386451 8520BLK2R - - - - - - - - - -
C_QTY_SITE_DIST 5 717 - 10,52 604-498-6750 Marine Drive , 972 Marine Drive, North Vancouver - - - -
This problem is only happens on French version of my application; I tried and published it few times but no luck.
M.

Hi,
I have a collection when debuging it, I can see 5 rows on my collection which is correct but the actual report only shows two records (excludes ones with empty columns).
This is the result of my report which is based on this query
select c001,c002,c003||' km',c004,c005,c006 Description,c007
from wwv_flow_collections where
collection_name = 'C_QTY_SITE_DIST'
order by to_number(c003),c001
Magasin Quantité Distance Store Phone Store address Description Retail Sku
748 1 7,76 km 604-492-6262 Park Royal , 580 Park Royal North, West Vancouver BB 8520 NOIR 1386451
746 1 10,52 km 604-473-2500 Kitsilano , 2202 York Avenue, Vancouver BB 8520 NOIR 1386451
1 - 2
and this is my debug
C_QTY_SITE_DIST 1 783 - 1,04 604-492-5647 Caulfield Express , #190, 5341 Headland Drive, West Vancouver - - - - - - - - - - - - -
C_QTY_SITE_DIST 2 748 1 7,76 604-492-6262 Park Royal , 580 Park Royal North, West Vancouver BB 8520 NOIR 1386451 8520BLK2R - - - - - - - - - -
C_QTY_SITE_DIST 3 720 - 10,1 604-468-7800 Davie , 1674 Davie Street, Vancouver - - - - - - - - - - - - -
C_QTY_SITE_DIST 4 746 1 10,52 604-473-2500 Kitsilano , 2202 York Avenue, Vancouver BB 8520 NOIR 1386451 8520BLK2R - - - - - - - - - -
C_QTY_SITE_DIST 5 717 - 10,52 604-498-6750 Marine Drive , 972 Marine Drive, North Vancouver - - - -
This problem is only happens on French version of my application; I tried and published it few times but no luck.
M.

Similar Messages

  • HT4743 I accidentally downloaded the french version of breaking bad but I wanted English.  Is there anyway I can return it or do I need to buy the English version now?

    I accidentally downloaded the french version of breaking bad but I wanted English.  Is there anyway I can return it or do I need to buy the English version now?

    Welcome to the Apple Community.
    Apple's policy on sales of digital content is that all sales are final. If however you wish to appeal to Apple, select the content which is causing a problem and use the 'Report a problem' button in Your Purchase History on your computer.
    Currently, if your purchase happens to be your most recent purchase you will not be redirected to the report form, in this case use the report a problem option from the invoice that was emailed to you.

  • Returning only records that have no entry in a specific field

    Hello,
    I'm new to this forum and relatively new to Crystal Reports, so I apologize if this information is "plain as day" somewhere.  I've been hunting for this info for quite a while and can't find anything that makes sense!
    I am trying to put together a very simple report that will return only records where a certain field is blank.
    It is an Access database, in an information management program specific to our type of business.  CR 11 software was included with the LIMS (Laboratory Information Management System), as the reports generated from the LIMS software are in CR.  I've learned enough to be able to tweak reports and make some basic reports, but I can't find a simple answer to what I think is a simple question! 
    I have the report set up to access the following fields in the database:  Invoice number, Client name, Due date, Invoice amount, and Payment Received.  This will be used as a "cross check" - not as any major accounting tool - as the Payment Received field is simply the date that the payment was received.  If no payment has been received, the field is left blank.
    I want the report to return ONLY those records where that field is blank (i. e. a list of invoices/clients whose payment has not yet been received).
    Ideally, I would also like to be able to return only those records where that field is blank OR within a certain date range (i. e. less than 30 days from the date that the report is run).  However, we'll probably only use this report a couple of times a month, so that is not as critical.
    I know I need to filter the records according to the Payment Received field, but don't know how to construct a formula that says "just show the fields where there is nothing entered."
    Thank you!
    Brenda

    This is the hardest function to find:  IsNull
    If isNull(field) then  
        //  if the above fails on a numberic field or text field then see the following two-some databases are picky.
    If IsNull(field) or field=0 then  //this one maybe needed for a numeric field
    If IsNull(field) or field=""    //  this one maybe needed for a text field
    if IsNull(field) or field=<value>
    or
    if IsNull(field) or field like <value*>
    You always want the IsNull statement to be the first statement, and it is especially usefull when testing for not equal
    If IsNull(field) or field <>  <value>

  • PLS-00630: pipelined functions must have a supported collection return type

    Hello, I created an TYPE of OBJECT and a PLSQL Function as shown below, but the function compilation errors with following. Not sure where is the issue?
    PLS-00630: pipelined functions must have a supported collection return typeThis is on Oracle 10g r2
    CREATE OR REPLACE TYPE cxs_plsql_profiler_object_type AS OBJECT (
       cxs_object_name      VARCHAR2 (128),
       cxs_object_type      VARCHAR2 (19),
       cxs_object_status    VARCHAR2 (7),
       cxs_read_execution   NUMBER,
       cxs_buffer_gets      NUMBER,
       cxs_disk_reads       NUMBER,
       cxs_executions       NUMBER,
       cxs_sorts            NUMBER,
       cxs_sharable_mem     NUMBER,
       cxs_address          NUMBER,
       cxs_hashvalue        NUMBER,
       cxs_osuser           VARCHAR2 (30),
       cxs_username         VARCHAR2 (30),
       cxs_module           VARCHAR2 (48),
       cxs_machine          VARCHAR2 (64),
       cxs_status           VARCHAR2 (8),
       cxs_terminal         VARCHAR2 (16),
       cxs_percentconsume   NUMBER,
       cxs_percentrepeat    NUMBER,
       cxs_plan             VARCHAR2 (120),
       target_name          VARCHAR2 (200),
       referenced_name      VARCHAR2 (200),
       referenced_type      VARCHAR2 (200),
       targetowner          VARCHAR2 (200),
       refowner             VARCHAR2 (200)
    )and here is the API
        FUNCTION CXS_GENERATE_PLSQL_PROFILER
    RETURN cxs_plsql_profiler_object_type
    PIPELINED IS
    out_rec cxs_plsql_profiler_object_type ;
    plsbatch plsql_batch;
    skount integer;
    dpendrec depend_tab;
    dkount integer;
    CURSOR objects
          IS
             SELECT object_name, object_type
               FROM dba_objects
              WHERE status = 'VALID'
                AND owner NOT IN ('SYS', 'SYSTEM')
                AND object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION');
          CURSOR apis (p_object dba_objects.object_name%TYPE)
          IS
             SELECT DISTINCT *
                        FROM (SELECT   SUBSTR (a.sql_text, 1, 50) sql_text,
                                       TRUNC
                                          (  a.disk_reads
                                           / DECODE (a.executions,
                                                     0, 1,
                                                     a.executions
                                          ) reads_per_execution,
                                       a.buffer_gets, a.disk_reads, a.executions,
                                       a.sorts, a.sharable_mem, a.address,
                                       a.hash_value, b.osuser, b.username,
                                       b.module, b.machine, b.status, b.terminal,
                                       ROUND
                                          (cxs_db_info.kompute_percentofsql
                                                                   (a.sharable_mem),
                                           5
                                          ) percentkonsume,
                                       cxs_db_info.kount_repeat
                                                             (b.osuser,
                                                              b.terminal
                                                             ) percentr,
                                       c.operation explainplan
                                  FROM v$sqlarea a, v$session b, v$sql_plan c
                                 WHERE b.sql_hash_value = a.hash_value
                                   AND b.sql_address = a.address
                                   AND a.hash_value = c.hash_value
                                   AND a.address = c.address
                                   AND b.status = 'ACTIVE'
                                   AND UPPER (a.sql_text) LIKE
                                                            '%' || p_object || '%'
                                   AND c.ID = 0
                              ORDER BY 2 DESC)
                       WHERE ROWNUM <= 50;   --profile option
    BEGIN
    skount := 0;
    dkount := 0;
    FOR i IN objects
          LOOP
             FOR j IN apis (i.object_name)
             LOOP
                skount := skount + 1;
                plsbatch(skount).cxs_object_name  := i.object_name;
       plsbatch(skount).cxs_object_type      :=  i.object_type;
       plsbatch(skount).cxs_object_status    :=  i.object_status;
       plsbatch(skount).cxs_read_execution   := j.reads_per_execution;
       plsbatch(skount).cxs_buffer_gets      := j.buffer_gets;
       plsbatch(skount).cxs_disk_reads       := j.disk_reads;
       plsbatch(skount).cxs_executions       := j.executions;
       plsbatch(skount).cxs_sorts            := j.sorts;
       plsbatch(skount).cxs_sharable_mem     := j.sharable_mem;
       plsbatch(skount).cxs_address          := j.address;
       plsbatch(skount).cxs_hashvalue        := j.hashvalue;
       plsbatch(skount).cxs_osuser           := j.osuser;
       plsbatch(skount).cxs_username         := j.username;
       plsbatch(skount).cxs_module           := j.module;
       plsbatch(skount).cxs_machine          := j.machine;
       plsbatch(skount).cxs_status           := j.status;
       plsbatch(skount).cxs_terminal         := j.terminal;
       plsbatch(skount).cxs_percentconsume   := j.percentconsume;
       plsbatch(skount).cxs_percentrepeat    := j.percentrepeat;
       plsbatch(skount).cxs_plan             := j.explainplan;
             END LOOP;
             FOR dd IN dpend (i.object_name)
             LOOP
                dkount := dkount + 1;
                dependrec (dkount).target_name := dd.NAME;
                dependrec (dkount).refname := dd.referenced_name;
                dependrec (dkount).reftype := dd.referenced_type;
                dependrec (dkount).target_owner := dd.owner;
                dependrec (dkount).refowner := dd.referenced_owner;
             END LOOP;
          END LOOP;
    for a in 1..skount loop
       out_rec.cxs_object_type      := plsbatch(a).object_type;
       out_rec.cxs_object_status    := plsbatch(a).object_status;
       out_rec.cxs_read_execution   := plsbatch(a).reads_per_execution;
       out_rec.cxs_buffer_gets      := plsbatch(a).buffer_gets;
       out_rec.cxs_disk_reads       := plsbatch(a).disk_reads;
       out_rec.cxs_executions       := plsbatch(a).executions;
       out_rec.cxs_sorts            := plsbatch(a).sorts;
       out_rec.cxs_sharable_mem     := plsbatch(a).sharable_mem;
       out_rec.cxs_address          := plsbatch(a).address;
       out_rec.cxs_hashvalue        := plsbatch(a).hashvalue;
       out_rec.cxs_osuser           := plsbatch(a).osuser;
       out_rec.cxs_username         := plsbatch(a).username;
       out_rec.cxs_module           := plsbatch(a).module;
       out_rec.cxs_machine          := plsbatch(a).machine;
       out_rec.cxs_status           := plsbatch(a).status;
       out_rec.cxs_terminal         := plsbatch(a).terminal;
       out_rec.cxs_percentconsume   := plsbatch(a).percentconsume;
       out_rec.cxs_percentrepeat    := plsbatch(a).percentrepeat;
       out_rec.cxs_plan             := plsbatch(a).explainplan;
       PIPE ROW(out_rec);
    end loop;
    for b in 1..dkount loop
        out_rec.target_name := dd.NAME;
                out_rec.refname := dependrec (b).referenced_name;
                out_rec.reftype := dependrec (b).referenced_type;
                out_rec.target_owner := dependrec (b).owner;
                out_rec.refowner := dependrec (b).referenced_owner;
                PIPE ROW(out_rec);
    end loop;
    RETURN;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.format_error_backtrace);
    DBMS_OUTPUT.PUT_LINE(SQLCODE);
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
    END; and below are tradtional table types that are used in code above.
    TYPE type_plsql_rec IS RECORD (
       cxs_object_name      VARCHAR2 (128),
       cxs_object_type      VARCHAR2 (19),
       cxs_object_status    VARCHAR2 (7),
       cxs_read_execution   NUMBER,
       cxs_buffer_gets      NUMBER,
       cxs_disk_reads       NUMBER,
       cxs_executions       NUMBER,
       cxs_sorts            NUMBER,
       cxs_sharable_mem     NUMBER,
       cxs_address          NUMBER,
       cxs_hashvalue        NUMBER,
       cxs_osuser           VARCHAR2 (30),
       cxs_username         VARCHAR2 (30),
       cxs_module           VARCHAR2 (48),
       cxs_machine          VARCHAR2 (64),
       cxs_status           VARCHAR2 (8),
       cxs_terminal         VARCHAR2 (16),
       cxs_percentconsume   NUMBER,
       cxs_percentrepeat    NUMBER,
       cxs_plan             VARCHAR2 (120)
       TYPE plsql_batch IS TABLE OF type_plsql_rec
          INDEX BY BINARY_INTEGER;
           TYPE type_depend_tab IS RECORD (
          target_name    dba_dependencies.NAME%TYPE,
          refname        dba_dependencies.referenced_name%TYPE,
          reftype        dba_dependencies.referenced_type%TYPE,
          target_owner   dba_dependencies.owner%TYPE,
          refowner       dba_dependencies.referenced_owner%TYPE
       TYPE depend_tab IS TABLE OF type_depend_tab
          INDEX BY BINARY_INTEGER;
    Thank you for your time in reading this post
    R

    Thank you Billy and Saubhik,
    I have followed your guidelines and was able to resolve this error. Now, after successfully compiling the code, I attempted to execute it in a following way.
    SELECT * FROM TABLE (cxs_generate_plsql_profiler);It gives following error: ORA-00904: "CXS_GENERATE_PLSQL_PROFILER": invalid identifier
    I also tried putting in quotes like below
    SELECT * FROM TABLE ('cxs_generate_plsql_profiler');Then, it gives following error:
    ORA-22905: cannot access rows from a non-nested table item
    Any Idea where I am doing wrong?
    Thanks,
    R

  • WKT polygon returns extra records on intersect query

    We have spatially enabled table with min/max lat/long with 1 degree cell data on which we perform queries coming from an application using well known text. We need to use WKT because we need to support user defined shapes of point, line, polygon, etc. (My test cases uses a rectangle). Our WKT data is accurate to 4 decimal places.
    //WKT version returns 100 records: (this is bad result)
    SELECT COUNT(*) from (select * from MAP_TABLE WHERE series='downunder') where sdo_relate(geometry,sdo_util.rectify_geometry(mdsys.sdo_geometry
    ('POLYGON((117.0627 -31.8451,117.0627 -27.0075,134.5875 -27.0075, 134.5875 -31.8451, 117.0627 -31.8451)))',8307),0.00005),'mask=anyinteract,querytype=window') = 'TRUE'
    // array version returns 90 records: (this is expected result)
    SELECT COUNT(*) from (select * from MAP_TABLE WHERE series='downunder') where sdo_relate(geometry,mdsys.sdo_geometry(2003,8307,null,mdsys.sdo_elem_info_array(1,1003,3),
    mdsys.sdo_ordinate_array(117.0627, -31.8451,134.5875,-27.0007)),'mask=anyinteract,querytype=window') = 'TRUE'
    The WKT seems to return extra records as if a .5 rounding error on the spatial query. We checked for tolerance; in USER_SDO_GEOM_METADATA, SDO_TOLERENCE for lon and lat in DIMINFO column are set to .0000005, and SRID of 8307, and the spatial index for the table has been recreated with .0000005 (just in case).
    Why is WKT not accurate?

    Hi Mike,
    Well, I'll be the first to line up and say that the WKT implementation has some issues. You already know them as you are doing that rectify_geometry step to account for some of them (incorrectly rotated rings which is what your example has).
    Noel is right that your example is not pushing along your case since an optimized rectangle is not the same as a regular rectangle, particularly in a geodetic cs. And that is one tiny tolerance in the rectify step! Is all your data at that tolerance? That's 0.0019685 inches! Wikipedia says the width of a human hair is 0.003937 inches so your tolerance is 1/3 of the width of a human hair. :)
    Anyhow, the second link Noel posted has the blurb we want: "When Spatial constructs the MBR internally for the query, lines along latitude lines are densified by adding points at one-degree intervals. This might affect results for objects within a few meters of the edge of the MBR (especially objects in the middle latitudes in both hemispheres)." So your optimized rectangle when its used internally by Oracle spatial looks like the results from this query:
    SELECT
    SDO_CS.TRANSFORM(
       MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(117.0627, -31.8451,134.5875,-27.0007)),
       8307
    FROM
    dualSo you can probably expect some differences in query results in comparison to the four point rectangle that your WKT input creates. And certainly will happen at the follicle scale!
    Could you post a different example that does not use an optimized rectangle where the SDO and WKT produce different outputs?
    If your data is stored as WKT, how did an optimized rectangle get into this story in the first place? If you need to store an optimized rectangle as WKT - well you can't do that. You could do the above transform trick on any optimized rectangles in your data and then put all the resulting points into your WKT. Then things should match on the output query side. But that would mean chucking out the whole concept of optimized triangles from your dataset.
    Cheers,
    Paul

  • How to create a French version of your survey?

    I would like to add a French version of my survey but I need all the information collected to be stored in the same area as the English version. Is this possible?

    Sorry we do not support this feature yet.
    Chrome does have a extension/plugin which can translate pages in a many different languages (For example : https://chrome.google.com/webstore/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcle b?hl=en). Or you can have both languages on your form ("First Name/Prénom : ________________")
    Gen

  • PipeLine Function Taking time to return Table record

    Hi,
    I want to use a function in join clause. so i go for pipelined function(using for loop to get record & 1 more loop to fetch in table type variable). i achieved what i required. but problem is it takes much time to fetch data. is there any other approach which returns table records without pipelined function.
    please suggest me a better approach as soon as possible.

    Hi,
    Thanks all for the quick response.
    I am using oracle 10g
    this is the table details & the entire function.
    Create object & table type to use in the function
    CREATE OR REPLACE TYPE SYSADM.STR_TYPE AS OBJECT(COLUMNVALUE VARCHAR2(8),FromNo Int,ToNo Int)
    CREATE OR REPLACE TYPE SYSADM.STR_ARRAY AS TABLE OF STR_TYPE
    table involved
    View : VesselType
    column : Code varchar2(5)
    Table : T065_SHIP
    column : SKIPS_KODE varchar2(4)
    CODE_SHIPTYPE varchar2(5)
    Table : SelsKap
    column : SELSKAPSKODE varchar2(4)
    Table : t041_shiptypeusers
    column : Code_ShipType varchar2(5)
    USERID varchar2(8)
    View : PositionBook
    column : VesselCode varchar2(8)
    VoyageNo integer
    Company varchar2(4)
    Table : T62_BRUKER_SELSKAP
    column : SELSKAPSKODE varchar2(4)
    BRUKER varchar2(8)
    Pipelined function
    CREATE OR REPLACE FUNCTION SYSADM.TF_ShiporShipTypeByUser
    In_UserName IN VARCHAR2,
    In_Type IN VARCHAR2,
    In_VesselCode IN VARCHAR2,
    In_CompanyHistory IN NUMBER DEFAULT 0
    RETURN str_array PIPELINED AS
    l_ShipTypeUser NUMBER(10,0);
    l_CompanyUser NUMBER(10,0);
    l_UseCompanyHistory NUMBER(1,0);
    l_Snicsacct NUMBER(1,0);
    BEGIN
    BEGIN
    SELECT shiptype_user,
    company_user
    INTO l_ShipTypeUser,
    l_CompanyUser
    FROM User_Segregation;
    EXCEPTION
    WHEN OTHERS THEN
    l_ShipTypeUser := NULL;
    l_CompanyUser := NULL;
    END;
    BEGIN
    SELECT 1 INTO l_Snicsacct
    FROM DUAL
    WHERE NOT EXISTS ( SELECT 1 FROM sn_user_cfg WHERE UserID='SNICS' and CfgID='ACCTSYS');
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    IF In_CompanyHistory = 1
    THEN
    BEGIN
    SELECT CfgData
    INTO l_UseCompanyHistory
    FROM SN_User_Cfg
    WHERE CfgID = 'USE COMPANY HISTORY'
    AND UserID = 'SNICS';
    EXCEPTION
    WHEN OTHERS THEN
    l_UseCompanyHistory := 0;
    END;
    END IF;
    IF In_UserName = 'SYSADM' OR (l_CompanyUser = 0 AND l_ShipTypeUser = 0)
    OR (l_CompanyUser = 1 and l_Snicsacct =1 ) or (In_CompanyHistory = 0 and l_CompanyUser = 1 and In_Type ='ShipType')
    OR (l_ShipTypeUser = 1 and In_Type = 'Company')
    THEN
    BEGIN
    IF In_Type = 'ShipType'
    THEN
    BEGIN
    FOR cur IN (SELECT Code ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM VesselType )
    LOOP
    PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
    END LOOP;
    RETURN;
    END;
    ELSIF In_Type = 'Ship'
    THEN
    BEGIN
    FOR cur IN (SELECT SKIPS_KODE ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM T065_SHIP
    WHERE SKIPS_KODE = NVL(In_VesselCode,SKIPS_KODE ))
    LOOP
    PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
    END LOOP;
    RETURN;
    END;
    ELSIF In_Type = 'Company'
    THEN
    BEGIN
    FOR cur IN (SELECT SELSKAPSKODE ShipCode
    , NULL VoyageFrom
    , NULL VoyageTo
    FROM SelsKap)
    LOOP
    PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
    END LOOP;
    RETURN;
    END;
    END IF;
    END;
    ELSE
    IF In_Type = 'Ship'
    THEN
    BEGIN
    IF l_ShipTypeUser =1
    THEN
    BEGIN
    FOR cur IN (SELECT S.SKIPS_KODE ShipCode
    , 1 FromVoyage
    , 999999999 ToVoyage
    FROM T065_SHIP S
    JOIN t041_shiptypeusers U
    ON S.CODE_SHIPTYPE = U.Code_ShipType
    AND USERID = In_UserName
    WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
    GROUP BY S.SKIPS_KODE)
    LOOP
    PIPE ROW(str_type(cur.ShipCode,cur.FromVoyage,cur.ToVoyage));
    END LOOP;
    RETURN;
    END;
    ELSIF l_CompanyUser = 1
    THEN
    BEGIN
    IF l_UseCompanyHistory = 1 AND In_CompanyHistory = 1
    THEN
    FOR cur IN (SELECT a.VesselCode ShipCode
    , a.VoyageNo VoyageFrom
    , a.VoyageNo VoyageTo
    FROM PositionBook a
    JOIN T62_BRUKER_SELSKAP b
    ON a.Company = b.SELSKAPSKODE
    AND b.BRUKER = In_UserName
    WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
    UNION
    SELECT a.VesselCode ShipCode
    , a.VoyageNo VoyageFrom
    , a.VoyageNo VoyageTo
    FROM PositionBook a
    LEFT JOIN T62_BRUKER_SELSKAP b
    ON a.company = b.SELSKAPSKODE
    WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
    AND b.SELSKAPSKODE IS NULL
    GROUP BY a.VesselCode,
    a.VoyageNo,
    a.VoyageNo)
    LOOP
    PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
    END LOOP;
    RETURN;
    ELSE
    FOR cur IN (SELECT a.SKIPS_KODE ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM T065_SHIP a
    JOIN T62_BRUKER_SELSKAP b
    ON a.Company = b.SELSKAPSKODE
    AND b.BRUKER = In_UserName
    WHERE a.SKIPS_KODE = NVL(In_VesselCode, a.SKIPS_KODE)
    AND NVL(l_UseCompanyHistory,0) = 0
    UNION
    SELECT a.SKIPS_KODE ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM T065_SHIP a
    LEFT JOIN T62_BRUKER_SELSKAP b
    ON a.company = b.SELSKAPSKODE
    WHERE a.SKIPS_KODE = NVL(In_VesselCode, a.SKIPS_KODE)
    AND b.SELSKAPSKODE IS NULL
    GROUP BY a.SKIPS_KODE)
    LOOP
    PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
    END LOOP;
    RETURN;
    END IF;
    END;
    END IF;
    END;
    ELSIF In_Type = 'ShipType'
    THEN
    IF l_ShipTypeUser = 1
    THEN
    BEGIN
    FOR cur IN (SELECT S.CODE_SHIPTYPE ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM T065_SHIP S
    JOIN t041_shiptypeusers U
    ON S.CODE_SHIPTYPE = U.Code_ShipType
    AND USERID = In_UserName
    WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
    GROUP BY S.CODE_SHIPTYPE)
    LOOP
    PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
    END LOOP;
    RETURN;
    END;
    ELSIF l_CompanyUser = 1
    THEN
    IF l_UseCompanyHistory = 1 AND In_CompanyHistory = 1
    THEN
    BEGIN
    FOR cur IN (SELECT a.VesselType ShipCode
    , a.VoyageNo VoyageFrom
    , a.VoyageNo VoyageTo
    FROM PositionBook a
    JOIN T62_BRUKER_SELSKAP b
    ON a.COMPANY = b.SELSKAPSKODE
    AND b.BRUKER = In_UserName
    WHERE a.VesselCode = NVL(In_VesselCode,a.VesselCode)
    UNION
    SELECT a.VesselType ShipCode
    , a.VoyageNo VoyageFrom
    , a.VoyageNo VoyageTo
    FROM PositionBook a
    LEFT JOIN T62_BRUKER_SELSKAP b
    ON a.company = b.SELSKAPSKODE
    WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
    AND b.SELSKAPSKODE IS NULL
    GROUP BY a.VesselType,
    a.VoyageNo,
    a.VoyageNo)
    LOOP
    PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
    END LOOP;
    RETURN;
    END;
    ELSE
    BEGIN
    FOR cur IN (SELECT S.CODE_SHIPTYPE ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM T065_SHIP S
    JOIN T62_BRUKER_SELSKAP b
    ON S.company = b.SELSKAPSKODE
    AND B.BRUKER = In_UserName
    WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
    AND NVL(l_UseCompanyHistory,0) = 0
    UNION
    SELECT S.CODE_SHIPTYPE ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM T065_SHIP S
    LEFT JOIN T62_BRUKER_SELSKAP b
    ON S.company = b.SELSKAPSKODE
    WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
    AND b.SELSKAPSKODE IS NULL)
    LOOP
    PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
    END LOOP;
    RETURN;
    END;
    END IF;
    END IF;
    ELSIF In_Type = 'Company'
    THEN
    BEGIN
    FOR cur IN (SELECT a.SELSKAPSKODE ShipCode
    , NULL VoyageFrom
    , NULL VoyageTo
    FROM Selskap a
    JOIN T62_BRUKER_SELSKAP b
    ON a.SELSKAPSKODE = b.SELSKAPSKODE
    WHERE b.BRUKER = In_UserName
    Union All
    Select a.SELSKAPSKODE ShipCode
    , NULL VoyageFrom
    , NULL VoyageTo
    From Selskap a
    LEFT JOIN T62_BRUKER_SELSKAP b
    ON a.SELSKAPSKODE = b.SELSKAPSKODE
    Where b.SELSKAPSKODE IS NULL
    GROUP BY a.SELSKAPSKODE)
    LOOP
    PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
    END LOOP;
    RETURN;
    END;
    END IF;
    END IF;
    END;
    select statement which i call the function it takes minimum 6 seconds to execute. It gives 8339 records
    WITH deftbl AS ( SELECT /*+ CACHE(deftbl) */
    /*+ result_cache */
    a.VesselCode,
    a.VoyageNo,
    CASE a.BallastLeg When 0
    THEN MIN(a.ArrivalDate)
    ELSE NVL(( SELECT MAX(DepartureDate)
    FROM PositionBook b
    WHERE b.VesselCode = a.VesselCode
    AND b.VoyageNo = (Select MAX(VoyageNo) From PositionBook c Where c.VesselCode = a.VesselCode and c.VoyageNo<a.VoyageNo)
    ),MIN(a.ArrivalDate))
    END AS StartOfVoyage,
    MAX(DepartureDate) EndOfVoyage
    FROM PositionBook a
    JOIN TABLE(*TF_ShiporShipTypeByUser*('BKA', 'Ship', NULL, 1)) D        /*Calling the function*/
    ON D.ColumnValue = a.VesselCode
    AND a.VoyageNo BETWEEN D.FromVoyageNo AND D.ToVoyageNo
    GROUP BY VesselCode,VoyageNo,a.BallastLeg )
    SELECT /*+ result_cache */
    ROW_NUMBER() OVER(PARTITION BY a.VesselCode ORDER BY a.VoyageNo DESC) as "Row"
    ,a.VesselCode
    ,v.Name AS VesselName
    ,a.VoyageNo
    ,c.StartOfVoyage AS FromPort
    ,c.EndOfVoyage AS ToPort
    /*,a.FROMPORT
    ,a.TOPORT*/
    , CASE
    WHEN ( SELECT PortName
    FROM PositionBook b
    WHERE b.VesselCode = a.VesselCode
    AND b.VoyageNo = a.VoyageNo
    AND SYSDATE BETWEEN ArrivalDate AND DepartureDate ) IS NOT NULL
    THEN ( SELECT FIRST_VALUE(PortName) OVER(PARTITION BY b.vesselcode,b.VoyageNo ORDER BY b.vesselcode,b.VoyageNo,b.ArrivalDate,b.secondarytime)
    FROM PositionBook b
    WHERE b.VesselCode = a.VesselCode
    AND b.VoyageNo = a.VoyageNo
    AND SYSDATE BETWEEN ArrivalDate AND DepartureDate
    AND ROWNUM=1
    WHEN SYSDATE BETWEEN c.StartOfVoyage AND c.EndOfVoyage
    THEN ( SELECT 'Steam From '||FIRST_VALUE(UPPER(PortName)) OVER(PARTITION BY b.vesselcode,b.VoyageNo ORDER BY b.vesselcode,b.VoyageNo,b.ArrivalDate desc,b.secondarytime desc)
    FROM POSITIONBOOK b
    WHERE b.VesselCode = a.VesselCode AND b.VoyageNo = a.VoyageNo
    AND b.ArrivalDate<SYSDATE
    AND ROWNUM=1
    WHEN (c.StartOfVoyage-SYSDATE)>0
    THEN 'Voyage Not Started'
    WHEN (c.EndOfVoyage-SYSDATE)<0
    THEN 'Voyage Completed'
    ELSE Null
    END "Location"
    ,( SELECT MIN(b.PortName) KEEP(DENSE_RANK FIRST ORDER BY b.ArrivalDate,b.secondarytime) OVER(PARTITION BY b.VesselCode,b.VoyageNo)
    FROM POSITIONBOOK b
    WHERE b.VesselCode = a.VesselCode AND b.VoyageNo = a.VoyageNo
    AND b.ArrivalDate>SYSDATE
    AND ROWNUM=1
    ) AS NextPort
    , ( SELECT MIN(b.ArrivalDate) KEEP(DENSE_RANK FIRST ORDER BY b.ArrivalDate,b.secondarytime) OVER(PARTITION BY b.VesselCode,b.VoyageNo)
    FROM POSITIONBOOK b
    where b.VesselCode = a.VesselCode AND b.VoyageNo = a.VoyageNo
    AND b.ArrivalDate>SYSDATE
    AND ROWNUM=1
    ) AS NextETA
    ,a.STATUS VoyageStatus
    ,a.Trade
    ,UFN_MyVoyConcatinate_Values('FIXNOTE', a.VesselCode, a.VoyageNo) FixNote
    ,UFN_MyVoyConcatinate_Values('CHARTERER', a.VesselCode, a.VoyageNo) Charterer
    ,CASE WHEN st.CurrentStatus=0
    THEN 1
    WHEN st.CurrentStatus=1
    THEN 0
    ELSE st.CurrentStatus
    END AS CurrentStatus
    FROM Positionbook a
    JOIN deftbl c
    ON a.VesselCode = c.VesselCode
    AND a.VoyageNo = c.VoyageNo
    JOIN Vessel v
    ON v.Code = c.VesselCode
    LEFT JOIN GTT_VOYAGESTATUS st
    ON st.VesselCode = c.Vesselcode
    AND st.VoyageNo = c.VoyageNo
    GROUP BY a.VesselCode
    , v.Name
    , a.VoyageNo
    , c.StartOfVoyage
    , c.EndOfVoyage
    /*, a.FROMPORT
    , a.TOPORT*/
    , a.Status
    , a.Trade
    , st.CurrentStatus;
    Note:
    i changed the function without pipelined also. but it doesnt show much difference
    non pipelined function
    CREATE OR REPLACE FUNCTION TF_ShiporShipTypeByUser_nonp
    In_UserName IN VARCHAR2,
    In_Type IN VARCHAR2,
    In_VesselCode IN VARCHAR2,
    In_CompanyHistory IN NUMBER DEFAULT 0
    RETURN str_array AS
    l_ShipTypeUser NUMBER(10,0);
    l_CompanyUser NUMBER(10,0);
    l_UseCompanyHistory NUMBER(1,0);
    l_Snicsacct NUMBER(1,0);
    l_str_array str_array:=str_array();
    BEGIN
    BEGIN
    SELECT shiptype_user,
    company_user
    INTO l_ShipTypeUser,
    l_CompanyUser
    FROM User_Segregation;
    EXCEPTION
    WHEN OTHERS THEN
    l_ShipTypeUser := NULL;
    l_CompanyUser := NULL;
    END;
    BEGIN
    SELECT 1 INTO l_Snicsacct
    FROM DUAL
    WHERE NOT EXISTS ( SELECT 1 FROM sn_user_cfg WHERE UserID='SNICS' and CfgID='ACCTSYS');
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    IF In_CompanyHistory = 1
    THEN
    BEGIN
    SELECT CfgData
    INTO l_UseCompanyHistory
    FROM SN_User_Cfg
    WHERE CfgID = 'USE COMPANY HISTORY'
    AND UserID = 'SNICS';
    EXCEPTION
    WHEN OTHERS THEN
    l_UseCompanyHistory := 0;
    END;
    END IF;
    IF In_UserName = 'SYSADM' OR (l_CompanyUser = 0 AND l_ShipTypeUser = 0)
    OR (l_CompanyUser = 1 and l_Snicsacct =1 ) or (In_CompanyHistory = 0 and l_CompanyUser = 1 and In_Type ='ShipType')
    OR (l_ShipTypeUser = 1 and In_Type = 'Company')
    THEN
    BEGIN
    IF In_Type = 'ShipType'
    THEN
    BEGIN
    SELECT STR_TYPE(Code,1,999999999)
    BULK COLLECT INTO l_str_array
    FROM VesselType;
    RETURN l_str_array;
    END;
    ELSIF In_Type = 'Ship'
    THEN
    BEGIN
    SELECT STR_TYPE(SKIPS_KODE,1,999999999)
    BULK COLLECT INTO l_str_array
    FROM T065_SHIP
    WHERE SKIPS_KODE = NVL(In_VesselCode,SKIPS_KODE);
    RETURN l_str_array;
    END;
    ELSIF In_Type = 'Company'
    THEN
    BEGIN
    SELECT STR_TYPE(SELSKAPSKODE,NULL,NULL)
    BULK COLLECT INTO l_str_array
    FROM SelsKap;
    RETURN l_str_array;
    END;
    END IF;
    END;
    ELSE
    IF In_Type = 'Ship'
    THEN
    BEGIN
    IF l_ShipTypeUser =1
    THEN
    BEGIN
    SELECT STR_TYPE(S.SKIPS_KODE,1,999999999)
    BULK COLLECT INTO l_str_array
    FROM T065_SHIP S
    JOIN t041_shiptypeusers U
    ON S.CODE_SHIPTYPE = U.Code_ShipType
    AND USERID = In_UserName
    WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
    GROUP BY S.SKIPS_KODE;
    RETURN l_str_array;
    END;
    ELSIF l_CompanyUser = 1
    THEN
    BEGIN
    IF l_UseCompanyHistory = 1 AND In_CompanyHistory = 1
    THEN
    SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
    BULK COLLECT INTO l_str_array
    FROM ( SELECT a.VesselCode ShipCode
    , a.VoyageNo VoyageFrom
    , a.VoyageNo VoyageTo
    FROM PositionBook a
    JOIN T62_BRUKER_SELSKAP b
    ON a.Company = b.SELSKAPSKODE
    AND b.BRUKER = In_UserName
    WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
    UNION
    SELECT a.VesselCode ShipCode
    , a.VoyageNo VoyageFrom
    , a.VoyageNo VoyageTo
    FROM PositionBook a
    LEFT JOIN T62_BRUKER_SELSKAP b
    ON a.company = b.SELSKAPSKODE
    WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
    AND b.SELSKAPSKODE IS NULL
    GROUP BY a.VesselCode,
    a.VoyageNo,
    a.VoyageNo);
    RETURN l_str_array;
    ELSE
    SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
    BULK COLLECT INTO l_str_array
    FROM (SELECT a.SKIPS_KODE ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM T065_SHIP a
    JOIN T62_BRUKER_SELSKAP b
    ON a.Company = b.SELSKAPSKODE
    AND b.BRUKER = In_UserName
    WHERE a.SKIPS_KODE = NVL(In_VesselCode, a.SKIPS_KODE)
    AND NVL(l_UseCompanyHistory,0) = 0
    UNION
    SELECT a.SKIPS_KODE ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM T065_SHIP a
    LEFT JOIN T62_BRUKER_SELSKAP b
    ON a.company = b.SELSKAPSKODE
    WHERE a.SKIPS_KODE = NVL(In_VesselCode, a.SKIPS_KODE)
    AND b.SELSKAPSKODE IS NULL
    GROUP BY a.SKIPS_KODE);
    RETURN l_str_array;
    END IF;
    END;
    END IF;
    END;
    ELSIF In_Type = 'ShipType'
    THEN
    IF l_ShipTypeUser = 1
    THEN
    BEGIN
    SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
    BULK COLLECT INTO l_str_array
    FROM (SELECT S.CODE_SHIPTYPE ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM T065_SHIP S
    JOIN t041_shiptypeusers U
    ON S.CODE_SHIPTYPE = U.Code_ShipType
    AND USERID = In_UserName
    WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
    GROUP BY S.CODE_SHIPTYPE);
    RETURN l_str_array;
    END;
    ELSIF l_CompanyUser = 1
    THEN
    IF l_UseCompanyHistory = 1 AND In_CompanyHistory = 1
    THEN
    BEGIN
    SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
    BULK COLLECT INTO l_str_array
    FROM ( SELECT a.VesselType ShipCode
    , a.VoyageNo VoyageFrom
    , a.VoyageNo VoyageTo
    FROM PositionBook a
    JOIN T62_BRUKER_SELSKAP b
    ON a.COMPANY = b.SELSKAPSKODE
    AND b.BRUKER = In_UserName
    WHERE a.VesselCode = NVL(In_VesselCode,a.VesselCode)
    UNION
    SELECT a.VesselType ShipCode
    , a.VoyageNo VoyageFrom
    , a.VoyageNo VoyageTo
    FROM PositionBook a
    LEFT JOIN T62_BRUKER_SELSKAP b
    ON a.company = b.SELSKAPSKODE
    WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
    AND b.SELSKAPSKODE IS NULL
    GROUP BY a.VesselType,
    a.VoyageNo,
    a.VoyageNo);
    RETURN l_str_array;
    END;
    ELSE
    BEGIN
    SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
    BULK COLLECT INTO l_str_array
    FROM ( SELECT S.CODE_SHIPTYPE ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM T065_SHIP S
    JOIN T62_BRUKER_SELSKAP b
    ON S.company = b.SELSKAPSKODE
    AND B.BRUKER = In_UserName
    WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
    AND NVL(l_UseCompanyHistory,0) = 0
    UNION
    SELECT S.CODE_SHIPTYPE ShipCode
    , 1 VoyageFrom
    , 999999999 VoyageTo
    FROM T065_SHIP S
    LEFT JOIN T62_BRUKER_SELSKAP b
    ON S.company = b.SELSKAPSKODE
    WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
    AND b.SELSKAPSKODE IS NULL);
    RETURN l_str_array;
    END;
    END IF;
    END IF;
    ELSIF In_Type = 'Company'
    THEN
    BEGIN
    SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
    BULK COLLECT INTO l_str_array
    FROM ( SELECT a.SELSKAPSKODE ShipCode
    , NULL VoyageFrom
    , NULL VoyageTo
    FROM Selskap a
    JOIN T62_BRUKER_SELSKAP b
    ON a.SELSKAPSKODE = b.SELSKAPSKODE
    WHERE b.BRUKER = In_UserName
    Union All
    Select a.SELSKAPSKODE ShipCode
    , NULL VoyageFrom
    , NULL VoyageTo
    From Selskap a
    LEFT JOIN T62_BRUKER_SELSKAP b
    ON a.SELSKAPSKODE = b.SELSKAPSKODE
    Where b.SELSKAPSKODE IS NULL
    GROUP BY a.SELSKAPSKODE);
    RETURN l_str_array;
    END;
    END IF;
    END IF;
    END;please kindly provide me your valuable suggestions
    Edited by: ganex27lin on Mar 16, 2011 1:54 AM

  • How to select english movie in french version of itunes?

    This WE, I rent a movie of 2009, but I only find it in french version ( I am using itunes in french). How can I have access to old english movie?

    minia92,
    The appropriate update will update the Folio Builder Panel only. This does not affect the authoring tools, and therefore does not change which version of the viewer is needed. The version which updates the authoring tools has not yet been released. (v.16 is the latest version of the authoring tools)
    You are required to update the Folio Builder Panel to continue using it (there's no way around it).
    See: http://www.adobe.com/support/downloads/collection.jsp?collID=4&platform=Macintosh
    "Folio Producer tools" will update the authoring tools, and requires a corresponding update to the Content Viewer on the back-end. The latest version of the authoring tools available is v.16.
    "Folio Builder panel only" will only update the Folio Builder panel itself, and does not require any update to the Content Viewer.

  • Query is returning multiple records for a bank account id and party id

    Hi All,
    I am not getting why this query is returning multiple records for a particular bank account id and party id:
    SELECT instrument_payment_use_id
    ,instrument_type
    ,instrument_id
    ,start_date
    ,ext_pmt_party_id
    FROM iby_pmt_instr_uses_all
    WHERE instrument_id =:lv_num_ext_bank_account_id
    and exists (select 1 from iby_external_payees_all b where PAYEE_PARTY_ID= :lv_num_party_id and b.ext_payee_id = ext_pmt_party_id)
    I want above values to be used in api iby_disbursement_setup_pub.set_payee_instr_assignment in R12.
    Please help asap.
    Thanks

    O/P of query run for
    SELECT rowid, instrument_payment_use_id
    FROM iby_pmt_instr_uses_all
    WHERE instrument_id =6642
    AND EXISTS (
    SELECT 1
    FROM iby_external_payees_all b
    WHERE payee_party_id= 85470
    AND b.ext_payee_id = ext_pmt_party_id);
    is below:
    Rowid     INSTRUMENT_PAYMENT_USE_ID
    AABiDXAGIAABhiKAAS     236586
    AABiDXAGRAABSjtAAz     148437
    The version is R12

  • Can select statement return 'No Record found' for each of invalid inputs.

    Let say when you select a invalid booking number, oracle will
    return nothing, but do u know how to make oracle return a record
    saying it's invalid?
    Example, the following sql normally return 3 records cause
    only 3 numbers are valid, is there anyway to make it return
    4 records and indicate those invalid ones are invalid somehow.
    select booking_service, BOOKING_NO from tb_booking where booking_no in ('valid1','INVALID', 'valid2', 'valid3')

    Along the same lines you could use object types to achieve the same result. This would remove the need for a temporary table, and also allow you to create the list of ids to check with PL/SQL without i/o. As an example
    CREATE TYPE booking_id_typ IS OBJECT (id NUMBER);
    CREATE TYPE booking_id_list_typ IS TABLE OF booking_id_typ;
    CREATE TABLE bookings (booking_id booking_id_typ);
    (you could have booking_id as type NUMBER, but for consistency with subsequent SQL I've used booking_id_typ)
    INSERT INTO bookings VALUES (booking_id_typ(10));
    INSERT INTO bookings VALUES (booking_id_typ(20));
    INSERT INTO bookings VALUES (booking_id_typ(40));
    INSERT INTO bookings VALUES (booking_id_typ(50));
    The following SQL statement creates a collection on the fly, rather than using an IN clause.
    SELECT i.id booking_id, DECODE(b.booking_id.id, NULL, 'Invalid', 'Ok') status
    FROM bookings b,
    SELECT id
    FROM TABLE(booking_id_list_typ(booking_id_typ(10), booking_id_typ(20), booking_id_typ(30), booking_id_typ(40)))
    ) i
    WHERE i.id = b.booking_id.id (+)
    BOOKING_ID STATUS
    10 Ok
    20 Ok
    30 Invalid
    40 Ok
    This SQL statement works in 9i. I get the following error in 8i, but you might be able to CAST the TABLE to booking_id_list_typ, or depending on your application, create a PL/SQL variable of type booking_id_list_typ and CAST that instead.
    ERROR at line 5:
    ORA-22905: cannot access rows from a non-nested table item

  • PLSQL web service returning multiple records

    Hello,
    I am trying to create a web service using oracle 11g which should be able to return multiple records.
    Based on hints and code samples found on the internet here is my code :
    CREATE OR REPLACE TYPE test_rec is OBJECT (
        s_nume_adre                    NUMBER ,
        c_eta_civi                     VARCHAR2(4 BYTE),
        l_nom1_comp                    VARCHAR2(40 BYTE),
        l_nom2_comp                    VARCHAR2(40 BYTE),
        l_nom3_comp                    VARCHAR2(40 BYTE),
        l_pren_comp                    VARCHAR2(30 BYTE),
        d_date_nais                    DATE);
    CREATE OR REPLACE TYPE test_array AS TABLE OF test_rec;
    CREATE OR REPLACE PACKAGE test_pkg AS
      function get_rows(snume_adre in number) return test_array;
    END;
    CREATE OR REPLACE PACKAGE BODY test_pkg AS
      function get_rows(snume_adre in number) return test_array is
        v_rtn   test_array := test_array(null);
        v_first boolean := true;
        cursor c_get_rows(snume_adre in number) is
          SELECT a.s_nume_adre,
                 nvl(a.c_eta_civi, '') c_eta_civi,
                 nvl(a.l_nom1_comp, '') l_nom1_comp,
                 nvl(a.l_nom2_comp, '') l_nom2_comp,
                 nvl(a.l_nom3_comp, '') l_nom3_comp,
                 nvl(a.l_pren_comp, '') l_pren_comp,
                 nvl(a.d_date_nais, to_date('01.01.1900', 'dd.mm.yyyy')) d_date_nais
        FROM bro.z45 a
      where a.s_nume_adre = snume_adre or snume_adre is null;
      begin
        for rec in c_get_rows(snume_adre) loop
          if v_first then
            v_first := false;
          else
            v_rtn.extend;
          end if;
        v_rtn(v_rtn.last) := test_rec(rec.s_nume_adre, rec.c_eta_civi, rec.l_nom1_comp, rec.l_nom2_comp,
                                    rec.l_nom3_comp, rec.l_pren_comp, rec.d_date_nais);
        end loop;  
        return v_rtn;
      end;
    END;
    --select * from table (test_pkg.get_rows(null));
    I am able to retrieve the data using the select.
    However when I try to access its wsdl I get an error :
    <soap:Envelope>
       <soap:Body>
          <soap:Fault>
             <faultcode>soap:Client</faultcode>
             <faultstring>Error processing input</faultstring>
             <detail>
                <OracleErrors></OracleErrors>
             </detail>
          </soap:Fault>
       </soap:Body>
    </soap:Envelope>
    If I comment the function call in the package declaration I get a "correct" wsdl :
    <definitions name="GET_ROWS" targetNamespace="http://xmlns.oracle.com/orawsv/TEST/TEST_PKG/GET_ROWS" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/orawsv/TEST/TEST_PKG/GET_ROWS" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      <types>
        <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/TEST/TEST_PKG/GET_ROWS" elementFormDefault="qualified">
          <xsd:element name="GET_ROWSInput">
            <xsd:complexType>
              </xsd:complexType>
          </xsd:element>
          <xsd:element name="GET_ROWSOutput">
            <xsd:complexType>
              </xsd:complexType>
          </xsd:element>
       </xsd:schema>
      </types>
      <message name="GET_ROWSInputMessage">
        <part name="parameters" element="tns:GET_ROWSInput"/>
      </message>
      <message name="GET_ROWSOutputMessage">
        <part name="parameters" element="tns:GET_ROWSOutput"/>
      </message>
      <portType name="GET_ROWSPortType">
      <operation name="GET_ROWS">
          <input message="tns:GET_ROWSInputMessage"/>
          <output message="tns:GET_ROWSOutputMessage"/>
        </operation>
      </portType>
      <binding name="GET_ROWSBinding" type="tns:GET_ROWSPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GET_ROWS">
          <soap:operation soapAction="GET_ROWS"/>
          <input>
            <soap:body parts="parameters" use="literal"/>
          </input>
          <output>
            <soap:body parts="parameters" use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="GET_ROWSService">
        <documentation>Oracle Web Service</documentation>
        <port name="GET_ROWSPort" binding="tns:GET_ROWSBinding">
           <soap:address location="http://server.domain.ch:8080/orawsv/TEST/TEST_PKG/GET_ROWS"/>
         </port>
      </service>
    </definitions>
    Any hint as how to create and access pl sql web service returning multiple rows?
    I don't use java and don't have access to tools like JDeveloper.
    Thanks!

    The actual issue is that collection types are not supported for return parameters.
    The solution is to wrap the collection into another object.
    Here's a working example based on your settings :
    CREATE OR REPLACE TYPE test_rec is OBJECT ( 
      empno  number(4)
    , ename  varchar2(10)
    , hiredate date
    CREATE OR REPLACE TYPE test_array AS TABLE OF test_rec; 
    CREATE OR REPLACE TYPE test_array_wrapper is OBJECT ( arr test_array );
    CREATE OR REPLACE PACKAGE test_pkg AS 
      function get_rows(p_deptno in number) return test_array_wrapper; 
    END; 
    CREATE OR REPLACE PACKAGE BODY test_pkg AS 
      function get_rows(p_deptno in number) return test_array_wrapper is 
        results  test_array; 
      begin 
        select test_rec(empno, ename, hiredate)
        bulk collect into results
        from scott.emp
        where deptno = p_deptno;    
        return test_array_wrapper(results); 
      end; 
    END; 
    The wsdl is then generated correctly :
    SQL> select httpuritype('http://DEV:dev@localhost:8080/orawsv/DEV/TEST_PKG/GET_ROWS?wsdl').getxml() from dual;
    HTTPURITYPE('HTTP://DEV:DEV@LOCALHOST:8080/ORAWSV/DEV/TEST_PKG/GET_ROWS?WSDL').GETXML()
    <definitions name="GET_ROWS" targetNamespace="http://xmlns.oracle.com/orawsv/DEV/TEST_PKG/GET_ROWS" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/orawsv/DEV/TEST_PKG/GET_
    ROWS" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      <types>
        <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/DEV/TEST_PKG/GET_ROWS" elementFormDefault="qualified">
          <xsd:element name="CTEST_ARRAY_WRAPPER-GET_ROWSInput">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="P_DEPTNO-NUMBER-IN" type="xsd:double"/>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="GET_ROWSOutput">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="RETURN" type="tns:TEST_ARRAY_WRAPPERType"/>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:complexType name="TEST_ARRAY_WRAPPERType">
            <xsd:sequence>
              <xsd:element name="TEST_ARRAY_WRAPPER">
                <xsd:complexType>
                  <xsd:sequence>
                    <xsd:element name="ARR">
                      <xsd:complexType>
                        <xsd:sequence>
                          <xsd:element name="TEST_REC" type="tns:TEST_REC_IntType" maxOccurs="unbounded" minOccurs="0"/>
                        </xsd:sequence>
                      </xsd:complexType>
                    </xsd:element>
                  </xsd:sequence>
                </xsd:complexType>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
          <xsd:complexType name="TEST_REC_IntType">
            <xsd:sequence>
              <xsd:element name="EMPNO" type="xsd:double"/>
              <xsd:element name="ENAME">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:maxLength value="10"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
              <xsd:element name="HIREDATE" type="xsd:date"/>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:schema>
      </types>
      <message name="GET_ROWSInputMessage">
        <part name="parameters" element="tns:CTEST_ARRAY_WRAPPER-GET_ROWSInput"/>
      </message>
      <message name="GET_ROWSOutputMessage">
        <part name="parameters" element="tns:GET_ROWSOutput"/>
      </message>
      <portType name="GET_ROWSPortType">
        <operation name="GET_ROWS">
          <input message="tns:GET_ROWSInputMessage"/>
          <output message="tns:GET_ROWSOutputMessage"/>
        </operation>
      </portType>
      <binding name="GET_ROWSBinding" type="tns:GET_ROWSPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GET_ROWS">
          <soap:operation soapAction="GET_ROWS"/>
          <input>
            <soap:body parts="parameters" use="literal"/>
          </input>
          <output>
            <soap:body parts="parameters" use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="GET_ROWSService">
        <documentation>Oracle Web Service</documentation>
        <port name="GET_ROWSPort" binding="tns:GET_ROWSBinding">
          <soap:address location="http://localhost:8080/orawsv/DEV/TEST_PKG/GET_ROWS"/>
        </port>
      </service>
    </definitions>

  • Multiple UNION ALL views within a view returning incorrect records?

    Hi,
    I have a view which selects from multiple views with UNION ALL joining them. If I just select from the larg UNION ALL query I return more records (correct amount) than If I create a view, and select from it.
    e.g.
    SELECT *
    FROM vw_load_1
    UNION ALL
    SELECT *
    FROM vw_load_2
    UNION ALL
    SELECT *
    FROM vw_load_3
    UNION ALL
    SELECT *
    FROM vw_load_4
    UNION ALL
    SELECT *
    FROM vw_load_5
    Returns 405 Records
    but
    CREATE VIEW vw_master_load
    AS
    SELECT *
    FROM vw_load_1
    UNION ALL
    SELECT *
    FROM vw_load_2
    UNION ALL
    SELECT *
    FROM vw_load_3
    UNION ALL
    SELECT *
    FROM vw_load_4
    UNION ALL
    SELECT *
    FROM vw_load_5;
    SELECT COUNT(*)
    FROM vw_master_load
    Returns 307 records
    Can anyone explain why, or how to get around this?
    Oracle version: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production

    Hi,
    Are you saying that you run:
    select count(*) from (
      SELECT *
      FROM vw_load_1
      UNION ALL
      SELECT *
      FROM vw_load_2
      UNION ALL
      SELECT *
      FROM vw_load_3
      UNION ALL
      SELECT *
      FROM vw_load_4
      UNION ALL
      SELECT *
      FROM vw_load_5
    result is: 307 And then you run
      SELECT *
      FROM vw_load_1
      UNION ALL
      SELECT *
      FROM vw_load_2
      UNION ALL
      SELECT *
      FROM vw_load_3
      UNION ALL
      SELECT *
      FROM vw_load_4
      UNION ALL
      SELECT *
      FROM vw_load_5
    returns 405 rowsIf so, that is very strange.
    Can you an example we can re-produce?
    Regards,
    Peter

  • I have quicktime pro and it does NOT have the screen record mode that Quicktime is suppose to have.  Can I uninstall it and go back to an older version that would have screen recording?  If so, how?  Step by step needed.  Thank you for your time.

    I have quicktime pro and it does NOT have the screen record mode that Quicktime is suppose to have.  Can I uninstall it and go back to an older version that would have screen recording?  If so, how?  Step by step needed.  Thank you for your time.

    Did you remove Quicktime X?
    On a normal install Quicktime 7 is installed in the Utilities folder and Quicktime Pro in the main Applications folder.
    You will need to reinstall OS X to get Quicktime X back if you have deleted it.
    I notice yor profile says 10.5.8. Quicktime X is only available on 10.6 and above.

  • Full load from a DSO to a cube processes less records than available in DSO

    We have a scenario, where every Sunday I have to make a full load from a DSO with OnHand Stock information to a cube, where I register on material and stoer level a counter if there is stock available.
    The DTP has no filters at all and has a semantic group on 0MATERIAL and 0PLANT.
    The key in the DSO is:
    0MATERIAL
    0PLANT
    0STOCKTYPE
    0STOR_LOC
    0BOM
    of which only 0MATERIAL, 0PLANT and 0STORE_LOC are later used in the transformation.
    As we had a growing number of records, we decided to delete in the START routine all records, where the inventory is not GT zero, thus eliminating zero and negative inventory records.
    Now comes the funny part of the story:
    Prior to these changes I would [in a test system, just copied from PROD] read some 33 million of records and write out the same amount of records. Of course, after the change we expected to write out less. To my total surprise I was reading now however 45 million of records with the same unchanged DTP, and writing out the expected less records.
    When checking the number of records in the DSO I found the 45 million, but cannot explain why in the loads before we only retrieved some 33 millions from the same unchanged amount of records.
    When checking in PROD - same result: we have some 45 million records in the DSO, but when we do the full load from the DSO to the cube the DTP only processes some 33 millions.
    What am I missing - is there a compression going on? Why would the amount of records in a DSO differ from the amount of records processed in the DataPackgages when I am making a FULL load without any filter restrictions and only a semantic grouping in place for parts of the DSO key?
    ANY idea, thought is appreciated.

    Thanks Gaurav.
    I did check if there were more/any loads doen inbetween - there were none in the test system.  As I mentioned that it was a new copy from PROD to TEST, I compared the number of entries in the DSO and that seems to be a match between TEST and PROD, ok a some more in PROD but they can be accounted for. In test I loaded the day before the changes were imported to have a comparison, and between that load and the one ofter the changes were imported nothing in the DSO was changed.
    Both DTPs in TEST and PW2 load from actived DSO [without archive]. The DTPs were not changed in quite a while - so I ruled that one out. Same with activation of data in the DSO - this DSO get's loaded and activated in PROD daily via process chain and we load daily deltas into the cube in question. Only on Sundays, for the begin of the new week/fiscal period, we need to make a full load to capture all materials per site with inventory. The deltas loaded during the week are less than 1 million, but the difference between the number of records in the DSO and the amount processed in the DataPackages is more than 10 millions per full load even in PROD.
    I really appreciated the knowledgable answer, I just wished you would pointed out something that I missed out on.

  • Parameter Field Value returns "no records"

    I am using Crystal 11 and am new to Crystal but not to other Reportwriters.  I have a Crystal report that has 2 parameter fields, one is "Enter Date" that prompts for the start and end date, the other "Select Items" prompts for the supply Item Numbers to be included in the report.  In the "Edit Parameter: Select Items:" edit/create parameter dialog, the Select Item parameter has "Allow Multiple values" and "Allow discrete values" set to true. The report runs fine and returns any items entered in the "Select Items" prompt that has usage during the start & end date.  My problem is ... if the entered Item Number for the Select Items parameter returns no records, I cannot report that Item Number as having zero usage.  I cannot find a way at the time of report running to identify and report the "not found" items.  I would also like to report the Start and End Dates parameters requested, but cannot, the Enter Date parameter returns an empty parameter field across the whole report.  I'm sure other users have had this problem of reporting the requested parameter values.   Need assistance.  

    Jeff's answer is one way to do it.  There are others:
    If you want the items with no data interspersed with the other items (say, in item number order), then you'd change the report to use your item master table and do a left join from that to the usage data.  If a field from the usage table is null, then there was no usage, and you can condition a message based on that.
    Or, if your parameter selects item numbers without some type of "ALL" option, then you can use arrays to keep track of which if the selected items printed.  Then in the report footer, compare the list of items reported to the parameter items, and show which item numbers had no usage.  (This might run a tad faster than the separate subreport that Jeff suggested - but maybe not...)
    HTH,
    Carl

Maybe you are looking for

  • A TWM that can use Trayer/Tint2? Plus some other things I "need" in it

    I know the beauty of TWM and all, but here's the real problem I'm having: I want to use my tray/bar setup. I've got it exactly how I want it and I don't want to mess with it right now. Specifically, I have conky, tint, and trayer all on the same line

  • How to set a keyboard shortcut for open with VLC player

    Hey everyone! I have reffered the earlier discussion upon creating a shortcut for the open with function and the below is the correct answer for it by using applescript editor submitted by Barney. However, I couldn't get past the 1st paragraph. It al

  • How do I delete a digital certificate that is no longer valid?

    Whenever I try to send an email I get an alert about an invalid digital certificate that is no longer valid but I don't know how to get rid of it.  The email account was deleted some time ago.  It also shows up in my address book and  in my calendar

  • :K8N Neo4 SLI Platinum bios problem

     I have a strange problem with this bios, it goes back to default when you shut it down for awhile. The date goes back to Jan 1 2004 and all settings go to default. I've changed the battery thinking sure that was the problem, I've heard they've had s

  • No sound or mic on windows 10

    HI,Can't  seem to get my Tablet 2on wndows 10 to play music, sounds or record anything. tips?