How to Use VARRAY Datatype?.

I have three rows in one table.I have done some modifications to that table.I want to Update the Total Table at Single Database call?.May I Use Collections for that?.I want to Know about Collections.

You should google before asking these questions.
Here is a example
-- VARRAY
DECLARE
TYPE varray_type IS VARRAY(5) OF INTEGER;
v_varray varray_type;
BEGIN
--v_varray := varray_type(10,20,30,40,50);
v_varray := varray_type();
v_varray.extend;
v_varray(1) := 10;
v_varray.extend;
v_varray(7) := 20;
DBMS_OUTPUT.PUT_LINE(v_varray(1));
END;
Cheers.

Similar Messages

  • How to register varray datatype input parameter in concurrent program

    Hi All,
    I had a code contains varray datatype input parameter... Now i need to register this in concurret program screen.. which datatype i need to select?... i can able to see only number and character data type in value set.
    Thanks

    As mentioned, the Concurrent progrm APIs are just wrappers and the datatypes are limited. Now, how many items you expect to have in the array as a maximum? You could use the same wrapper concept to collect the array values individually (up to 100) and then just load them to an array to be passed to your stored procedure. Just have an overloaded version with values1..valuesn that is only used as the entry point and then load the values to the structure needed by the program unit containing your logic. There is a limit of 100 parameters, though.

  • How to use attribute datatype date in LOV

    In LOV have attribute that datatype date when run it show message error
    "java.lang.ClassCastException"
    How to use datatype date in LOV ?
    Can set property of LovVO attribute, LOV Region to date?
    If answer from above question is "NO", Can you give me function and OAF syntax for convert string to date, and where to convert in VOImpl or AM or another.
    Thank you very much.

    After I get parameter date from LOV then click GO, it show below message error
    ## Detail 0 ##
    java.lang.ClassCastException
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.setWhereClauseFromCriteria(OAViewObjectImpl.java:1589)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4484)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:574)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:544)
         at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:619)
         at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3311)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3298)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:444)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.initQuery(OAViewObjectImpl.java:719)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.setCriteriaOnVO(OAWebBeanHelper.java:2268)
         at oracle.apps.fnd.framework.webui.OAQueryHelper.handleSubmitButton(OAQueryHelper.java:2689)
         at oracle.apps.fnd.framework.webui.OAQueryHelper.processFormRequestAfterController(OAQueryHelper.java:1248)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:820)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAQueryHelper.processFormRequest(OAQueryHelper.java:1036)
         at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processFormRequest(OAStackLayoutBean.java:370)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processFormRequest(OAStackLayoutBean.java:370)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1157)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2632)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1658)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:501)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:422)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    java.lang.ClassCastException
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.setWhereClauseFromCriteria(OAViewObjectImpl.java:1589)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4484)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:574)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:544)
         at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:619)
         at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3311)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3298)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:444)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.initQuery(OAViewObjectImpl.java:719)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.setCriteriaOnVO(OAWebBeanHelper.java:2268)
         at oracle.apps.fnd.framework.webui.OAQueryHelper.handleSubmitButton(OAQueryHelper.java:2689)
         at oracle.apps.fnd.framework.webui.OAQueryHelper.processFormRequestAfterController(OAQueryHelper.java:1248)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:820)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAQueryHelper.processFormRequest(OAQueryHelper.java:1036)
         at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processFormRequest(OAStackLayoutBean.java:370)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processFormRequest(OAStackLayoutBean.java:370)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1157)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2632)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1658)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:501)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:422)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)

  • How to use memo datatype in msaccess in the labview 7.1

    dear all
    i want to save 801 data values in one cell of the field of a ms access .but the option are OLE here i can't see the data values only long binary information is displayed & also while reading i can't read too.its giving invalid data type.
    the orther option is memo which has a limitation of 64k character that would serve the purpose but  i want to know how to write to the database & then again read from the database

    Hi,
    The recommended way to access MS Access or any database is to use the Database Connectivity Toolkit. The toolkit is recommended because it is fast and very easy to use. Here ia a tutorial note about it.
    If you don't have the Database Connectivity Toolkit, you can use ActiveX to access it by using Automation Open. This can be found by going to function palette >> Connectivity >> Automation Open. Once you
    have that on your block diagram, right click on it highlight select
    class, choose ActiveX, select browse. On the drop down menu, select either Microsoft ADO (ActiveX Data Object) or Microsoft DAO (Data Access Object). Both of them can be used to access the database. Once all that is set up, right click on the automation reference input and create a control.
    There are examples that ship with LabVIEW called Retrieving Data from Access and Sending Data to Access. Both these examples use DDE and not ActiveX.
    There is an example on this discussion forum that uses ActiveX to access the database.
    I also found a number of other examples scattered through the discussion forums. I recommded that you search through them as well.
    Warm regards,
    Karunya R
    National Instruments
    Applications Engineer

  • How to use complex datatypes, Document and RelatedObject in CAF

    Hi,
          We can find the Document and Related Object Complex data types under the services node of caf.core. How are they implemented in an Application Service.
          Is it possible to upload Document in CAF? If possible, are the above mentioned data types used for the same?
         Please provide an example if possible.

    Hi,
    Document BO and DocContent are predefined BO and service resp. Thses are used in integration with CAF and Knowledge Mangement(KM).
    See these links:
    [link1 |http://help.sap.com/saphelp_nwce10/helpdata/en/43/78a5fd869b6fcbe10000000a1553f6/content.htm]
    li[link2|http://help.sap.com/saphelp_nwce10/helpdata/en/44/32a73d7097060ae10000000a155369/content.htm]
    Thanks
    Edited by: Sampath Gunda on May 11, 2009 12:09 PM

  • VARRAYS - how to use in sub procedures and how to empty them?

    Hi!
    I made a procedure where i use three diffrent varrays. I got it working only after
    putting all code in one big MAIN-block. Looks nasty.
    If i try to use sub-procedures i allways got ORA-06531-message.
    = "Reference to uninitialized collection"
    How can i use varrays in sub-procedures? Is there some trick in delcare or in procedure call?
    I try to use IN OUT parameters, but i didn't get it working. Run out of time in trial and error, of cource...
    I seemed to me that varrays aren't same way usable allover in code as all other variables i have declared.
    Is it so?
    Now the MAIN-block is long as a year... I'm used to code short MAIN-block with many sub-procedures calls.
    (In same procedure, not different procedures in db).
    Another problem is how to empty a varray in effective way?
    I tried my_varray.DELELTE and my_varray.TRIM but they won't do the thing. These remove/trim the elements but i just need to
    empty varray before fetching a new line from db. If I my_varray := NULL; then that same ORA-06531 when next read/write in varray.
    Now i just use FOR i IN 1..120 LOOP
    my_varray(i) := NULL;
    END LOOP;
    but there must be better way, hope so.
    Cheers,
    SL

    You were rigth "3360" - i had three varrays too many. Just to the grabage bin and some recoding.
    The link you posted show me the way: Associative Arrays
    - easy to declare, easy to use, works fine in sub procedures. Great - just what i need.
    Thanks alot!
    I fully agree W. Robertson on this:
    "I often see questions on technical forums about arrays in PL/SQL, which type to use and what the differences are. Although the documentation has quite a lot to say on the subject, I feel it tries to introduce too many concepts at once and ends up being confusing, especially when it comes to choosing between VARRAYs and Nested Table collections, where most of the "which to use" advice is about collection columns of database tables (which you probably don't need), and not about PL/SQL at all."
    - sl -

  • Retrieving VArray Datatype columns thru DSI/ALDSP Shapes

    Hi,
    I have a physical table which consists column of 'VARRAY' datatype apart from other singular datatypes.
    when i created my physical ds thru SQL Function, it had thrown an error saying "VARRAY" datatypes are not supported.
    Hence, i had created a Java Function which queries this table and returns me the entire resultset in a String format like:
    <person><id>100</id><cn>Penny></cn><telephonenumber>06</telephonenumber><telephonenumber>428</telephonenumber><telephonenumber>3835849</telephonenumber><description>its penny</description>
    The above result/string corresponds to a table Person with columns id,cn,telephonenumber and description and the column:telephnonenumber is of VARRAY datatype.
    This string has to be mapped individually to respective schema elements like the schema below:
    <xs:complexType name="person">
         <xs:sequence>
              <xs:element name="id" type="xs:long" minOccurs="0">     </xs:element>
              <xs:element name="cn" type="xs:string" minOccurs="0"></xs:element>
              <xs:element name="telephoneNumber" type="xs:string" minOccurs="0" maxOccurs="unbounded"></xs:element>
              <xs:element name="description" type="xs:string" minOccurs="0"></xs:element>
         </xs:sequence>
         </xs:complexType>
    How can i map my return string to the above schema thru my Logical Ds.
    Please Advice. Earnest thanks for your time.

    You could - but there is a better way. You should take your schema and plop it in a Schema project and then generate the xmlbean classes and export the generated jar into your Java, then refresh the project (it might be possible to enable the xmlbean facet on your java project and put the schema in your java project - then you wouldn't need to introduce the schema project). Then change your java function to return an array of the generated person class.
    The other way - to return a string and in the xquery convert it to an element - would be to use the fn-bea:inlinedXML( ) function which will produce (untyped) xml from a string. To produce typed node from the untype - you need to 'validate' it... like so : let $person := validate{ fn-bea:inlinedXML(  $personString )
    And since you have multiple persons - you can either return an array of strings containing one person each and doing the above for each one - or you can return a string with a <PersonList><person>...</person><person>...</person><PersonList> and create a PersonList element which would be a sequence of your <element name="person" minOccurs="unlimited"/>
    returns me the entire resultset in a String formatEither way - returning as a string or as an array of person - keep in mind that this is a single object (or a single array of objects). Thus if your result set has 100,000 persons - you will have this much data in a single object and will use up that much memory.

  • How to use advanced PL/SQL concepts in oracle forms/reports

    Hi all,
    Can any one suggest me how to use the advanced PL/SQL Concepts(nested tables,PAA,Varrays,Objects...) in Oracle forms.
    Actually i Created a Table having column of Varray datatype. now i want to create a item in oracle forms on this field. can any one suggest me the way to do this.
    Thanks,
    Kumar

    Hello,
    Have a look at this one:
    http://sheikyerbouti.developpez.com/tutoforms10g/tutoforms10g.htm
    particularly the chapter about block that contain a collection (2.3.3). The sample is built around a nested table but you have the idea to adapt it to work with a varray.
    Kind regards,
    Alex
    If someone's answer is helpful or correct please mark it accordingly.

  • How to use multiple selection parameters in the data model

    Hi, after have looked all the previous threads about how to use multiple selection parameters , I still have a problem;
    I'm using Oracle BI Publisher 10.1.3.3.2 and I'm tried to define more than one multiple selection parameters inside the data template;
    Inside a simple SQL queries they work perfectly....but inside the data template I have errors.
    My data template is the following (it's very simple...I am just testing how the parameters work):
    <dataTemplate name="Test" defaultPackage="bip_departments_2_parameters">
    <parameters>
    <parameter name="p_dep_2_param" include_in_output="false" datatype="character"/>
    <parameter name="p_loc_1_param" include_in_output="false" datatype="character"/>
    </parameters>
    <dataTrigger name="beforeReport" source="bip_departments_2_parameters.beforeReportTrigger"/>
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    select deptno, dname,loc
    from dept
    &p_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_DEPT" source="Q2">
    <element name="deptno" value="deptno"/>
    <element name="dname" value="dname"/>
    <element name="loc" value="loc"/>
    </group>
    </dataStructure>
    </dataTemplate>
    The 2 parameters are based on these LOV:
    1) select distinct dname from dept (p_dep_2_param)
    2) select distinct loc from dept (p_loc_1_param)
    and both of them have checked the "Multiple selection" and "Can select all" boxes
    The package I created, in order to use the lexical refence is:
    CREATE OR REPLACE package SCOTT.bip_departments_2_parameters
    as
    p_dep_2_param varchar2(14);
    p_loc_1_param varchar2(20);
    p_where_clause varchar2(100);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    CREATE OR REPLACE package body SCOTT.bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    if (p_dep_2_param is not null) --and (p_loc_1_param is not null)
    then
    p_where_clause := 'where (dname in (' || replace (p_dep_1_param, '''') || ') and loc in (' || replace (p_loc_1_param, '''') || '))';
    else
    p_where_clause := 'where 1=1';
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    As you see, I tried to have only one p_where_clause (with more than one parameter inside)....but it doesn't work...
    Using only the first parameter (based on deptno (which is number), the p_where_clause is: p_where_clause := 'where (deptno in (' || replace (p_dep_2_param, '''') || '))';
    it works perfectly....
    Now I don't know if the problem is the datatype, but I noticed that with a single parameter (deptno is number), the lexical refence (inside the data template) works.....with a varchar parameter it doesn't work....
    So my questions are these:
    1) how can I define the p_where_clause (inside the package) with a single varchar parameter (for example, the department location name)
    2) how can I define the p_where_clause using more than one parameter (for example, the department location name and the department name) not number.
    Thanks in advance for any suggestion
    Alex

    Alex,
    the missing thing in your example is the fact, that if only one value is selected, the parameter has exact this value like BOSTON. If you choose more than one value, the parameter includes the *'*, so that it looks like *'BOSTON','NEW YORK'*. So you need to check in the package, if there's a *,* in the parameter or not. If yes there's more than one value, if not it's only one value or it's null.
    So change your package to (you need to expand your variables)
    create or replace package bip_departments_2_parameters
    as
    p_dep_2_param varchar2(1000);
    p_loc_1_param varchar2(1000);
    p_where_clause varchar2(1000);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    create or replace package body bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    p_where_clause := ' ';
    if p_dep_2_param is not null then
    if instr(p_dep_2_param,',')>0 then
    p_where_clause := 'WHERE DNAME in ('||p_dep_2_param||')';
    else
    p_where_clause := 'WHERE DNAME = '''||p_dep_2_param||'''';
    end if;
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || ' AND LOC IN ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || ' AND LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    else
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || 'WHERE LOC in ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || 'WHERE LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    I've written a similar example at http://www.oracle.com/global/de/community/bip/tipps/Dynamische_Queries/index.html ... but it's in german.
    Regards
    Rainer

  • How to use CLOB in OBIEE 11g (11115) Reporting

    Hello All,
    I have a CLOB object. I need to use that in the report.
    It just has text only. I defied it in RPD as LONGVARCHAR or OBJECT but it did not work out.
    I tried using evaluate with TO_CLOB but i am getting below error any time
    inconsistent datatypes: expected - got CLOB at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed.
    Please give me a clue how to use a CLOB column in report.
    I see a rittmen blog which is using as LOOKUP but i dont have that option either.
    Please let me know what wrong i am doing.
    Thanks in Advance.
    KN

    DBMS_LOB.substr(<table.columnname>,<length of characters>,<start position>)
    Check this
    http://shivabizint.wordpress.com/2010/04/20/varchar2-greater-than-4000-in-obiee/
    Mark if helps.
    Thanks,

  • How to use the function who returns an array?

    how to use getAllT in pls/sql or in java?
    --------------------------------------------------->
    create or replace package honghai as
         type TType is varray(25) of number;
    /*it can be like : type TType is table of number;
         function getCountT return number;
         function getAllT return TType;
    end honghai;
    create or replace package body honghai as
    a number;
    function getCountT return number is
         acount number;
         begin
              select count(*) into acount from testasb.t;
              return acount;
         end getCountT;
         function getAllT
         return TType is
         results TType;
         begin
              select testid into results(25) from testasb.T ;
              return results ;
         end getAllT;
    begin
         a := 2;     
    end honghai;
         

    For the java part, click on the link below:
    http://osi.oracle.com/~tkyte/ResultSets/index.html
    For the pl/sql part specific to your problem, see the code below. Since you did not provide any table structure or sample data, I used some simple data for demonstration purposes:
    SQL> CREATE TABLE t
      2    (testid NUMBER)
      3  /
    Table created.
    SQL> INSERT INTO t
      2  VALUES (1)
      3  /
    1 row created.
    SQL> INSERT INTO t
      2  VALUES (2)
      3  /
    1 row created.
    SQL> CREATE OR REPLACE PACKAGE honghai
      2  AS
      3    TYPE ttype IS REF CURSOR;
      4    FUNCTION getcountt RETURN NUMBER;
      5    FUNCTION getallt RETURN ttype;
      6  END honghai;
      7  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY honghai
      2  AS
      3    a NUMBER;
      4    FUNCTION getcountt RETURN NUMBER
      5    IS
      6      account nUMBER;
      7    BEGIN
      8      SELECT COUNT (*)
      9      INTO   account
    10      FROM   scott.t;
    11      RETURN account;
    12    END getcountt;
    13    FUNCTION getallt RETURN ttype
    14    IS
    15      results ttype;
    16    BEGIN
    17      OPEN results for 'SELECT testid FROM scott.t';
    18      RETURN results;
    19    END getallt;
    20  BEGIN
    21    a := 2;
    22  END honghai;
    23  /
    Package body created.
    SQL> VARIABLE g_num NUMBER
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC :g_num := honghai.getcountt
    PL/SQL procedure successfully completed.
    SQL> EXEC :g_ref := honghai.getallt
    PL/SQL procedure successfully completed.
    SQL> PRINT g_num
         G_NUM
             2
    SQL> PRINT g_ref
        TESTID
             1
             2

  • How to use array or type in "IN" criteria

    Hi all,
    anybody knows how to use group of same datatype data ( array or type ) in SQL statement
    For example
    ls_dept[1] = 'abc';
    ls_dept[2] = 'xyz';
    ls_dept[10] = 'ppr';
    i want to use this group of data in "IN" criteria like
    Select * from department where dept in ('abc','xyz'.....''ppr');
    if anybody know how to use please reply me as soon as possible.
    Thanks,

    I hope you are not suggesting concatenating literals from a web front-end application ;) Is it not what he was saying.. he is getting user input info from an application.. if the user sends multiple values.. he has to build a string with concatenating literals..
    correct me if I am wrong.

  • How to use EVALUATE_AGGR function

    Hi,
    How to use this function in OBIEE
    EVALUATE_AGGR('db_agg_function(%1...%N)' [AS datatype] [, column1, columnN])

    Hi solved,
    i have 3 rows as
    a
    b
    c
    i want to get a,b,c for that i used below code
    EVALUATE_AGGR('LISTAGG(%3) WITHIN GROUP (order BY %1,%2 DESC)',"KQ_TASK"."ASSIGNED_TO",',',"KQ_TASK"."ASSIGNED_TO")
    where %3 is third column which u want to get in single row

  • How to Create a datatype for a storeprocedure which has got array ?

    Hi All,
    Please tell me how to create a datatype for a storeprocedure which has got an array structure ?
    Thanks,
    Sindhu.

    Hi Sindhu.
    You would have to use a JDBC Cursor for this but it's possible only Output parameters, not Input parameters.
    It's describle in a help link:
    Defining an EXECUTE Statement  http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7b72b2fde93673e10000000a114a6b/frameset.htm
    The following SQL data types are supported:
    INTEGER, BIT, TINYINT, SMALLINT, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC, DECIMAL, CHAR, VARCHAR, STRING, LONGVARCHAR, DATE, TIME, TIMESTAMP, BINARY, VARBINARY, LONGVARBINARY, BLOB (input and output), CLOB (input and output), CURSOR (output; only in connection with the Oracle JDBC driver)
    I think you can execute your StoreProcedure many times depends of array occurs.
    Regards.
    Bruno.

  • How to use Transport Delay VI? Please show me some example.

    I want to delay signal with my selection delay time(example:second,period,number of sample). I saw in LabVIEW have,it have three delay function are 1.Transport Delay 2.Delay Value 3.Unit Delay .Now I take look for Transport Delay VI.I think this function can delay signal with specific time which I want.I tested it by use it to delay sine wavefrom(number of sample=1000,sampling rate =1000Hz),for Transport Delay,I set initize=TRUE,Delay=500. I think the result may sine waveform which same shape of original sine waveform but delay 500 sample after it but the result different from my think. Everyone please recommend me,How to use it?Show me some example.Or please tell me how to delay signal.If can not post picture on the board,mail to me.
    [email protected]
    [email protected]

    Hi TOTSAPORN!
    It sounds like you are trying to alter the timing of a waveform. What I would suggest to you is to look at the Waveform palette to explore the different ways of manipulating the waveform datatype. Also, I put together a small example (written in LV 7.1) to delay the waveform graph by 500 samples (500*dt seconds).
    Hope this helps!
    Travis H.
    National Instruments
    Travis H.
    LabVIEW R&D
    National Instruments
    Attachments:
    Waveform Offset.vi ‏64 KB

Maybe you are looking for

  • Fpb_S_Scenario does not exist

    Hi, we running a EP 7.0 with ECC 6.0 on ESS (patch level 8) project. Currently we are facing an error in almost every travel management iviews.  Has anybody of you an idea ? thx for your help Hans Georg com.sap.dictionary.runtime.DdException: Type co

  • Can I run a cat5 cable to a 4 port hub from a cisco router then connect one of the hub's output ports to an airport express to 'extend' my wireless range?

    Can I run a cat5 cable to a 4 port hub from a cisco router then connect one of the hub's output ports to an airport express to 'extend' my wireless range? Flow would be Cable modem---->cisco e2000 wifi router (This is broadcasting wifi but not strong

  • How to get rowcount on dynamic sql?

    Gurus, experts, and just plain people who are smarter than me. I've googled and googled and I while there are examples of how to do this, there is some complication that doesn't apply to me! I have a PLSQL function that depends upon knowing the numbe

  • Freight based on sales order total - FMS

    I have created the query below which works if I hard code the document number, or include the variable [%].   I get internal error when I use where T0.DocNum - $[$8.1.0] or where DocNum = $[ORDR.DocNum], I have also tried where T0.DocEntry = $[ORDR.D

  • Mavericks - no signal to projector

    I installed Mavericks on my MacBook Pro (early 2008) with the purpose of showing slideshows at my local camera club using FotoMagico 4, which required the latest version, as that's what I had used on my iMac to create the slideshow.  I was unable to