How to pass more than one value to the procedure

How can I pass more than one letting date to this procedure. If it is only one letting date, I do not have a problem but when it is more than one letting date at the same time then I am stuck. please help
example I would like to pass this three letting dates : '01/17/2010', '01/27/2010','05/22/2010'
CEATE OR REPLACE PROCEDURE TPLCP.PLANHOLDERSLIST
P_LettingDate IN  VARCHAR2,
p_results OUT sys_refcursor
AS
BEGIN
    OPEN p_results FOR
SELECT DISTINCT DECODE (TRIM (MIN (j.route)), NULL, 'N/A',TRIM (MIN (j.route))) rt,l.lcontid conid,
                 SUBSTR (q.cprojnum, 1, 10) pr, SUBSTR (l.letting, 3, 2)|| '-'|| SUBSTR (l.letting, 5, 2)|| '-'|| SUBSTR (l.letting, 1, 2) lt,
                (q.cdescr) jbtyp, INITCAP (q.clocat1 || q.clocat2) loc
           FROM vendor v,
                vendaddr r,
                letprop l,
                planhold p,
                proposal q,
                project j,
                propproj k,
                bidlet bd
          WHERE v.vendor = r.vendor
            AND k.contid = q.contid
            AND k.pcn = j.pcn
            AND l.lcontid = k.contid
            AND p.vendor = v.vendor
            AND l.letting = p.letting
            AND TO_CHAR (bd.datelet, 'MM/DD/YYYY') IN P_LettingDate
            AND l.CALL = p.CALL
            AND r.addrnum = p.billto
            AND bd.letting = l.letting
       GROUP BY v.vendor,
                r.addrnum,
                v.vnamel,
                r.aaddr1,
                p.billto,
                r.acity,
                r.astate,
                q.cdescr,
                q.clocat1,
                q.clocat2,
                bd.letting,
                r.azipcode,
                r.vasst1,
                r.aphone,
                l.letting,
                l.lcontid,
                q.cprojnum;
END PLANHOLDERSLIST;

you can create your on array type and then pass that as the parameter. I use the suffix of ttyp to represent a table type.  The name of the column when using the table() syntax is columnvalue.
I altered my session to set the default date format to match your format. you could have used the to_date function to set the values for the arr type.
Hope this helps.
create type msw_ttyp as table of date
create or replace
procedure msw_test(p_arr     in msw_ttyp) as
v     integer;
begin
select count(*)
   into v
   from table(p_arr);
dbms_output.put_line('count: '||v);
for rec in (select column_value
               from table(p_arr))
loop
  dbms_output.put_line(rec.column_value);
end loop;
end msw_test;
alter session set nls_date_format = 'MM/DD/YYYY';
set serveroutput on size 1000000
exec msw_test(msw_ttyp('01/17/2010', '01/27/2010','05/22/2010'));
begin
msw_test(msw_ttyp(to_date('01/17/2010', 'MM/DD/YYYY'),
                   to_date('01/27/2010', 'MM/DD/YYYY'),
                   to_date('05/22/2010', 'MM/DD/YYYY')));
end;
/

Similar Messages

  • How to pass more than one value for one column in procedure

    hi
    select id, name from col_tab where dept_name in ('ECE','CIVIL');
    when i was running this it is working well.
    CREATE OR REPLACE PACKAGE pack_str
    AS
    TYPE type_refcur IS REF CURSOR;
    PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur);
    END pack_str;
    CREATE OR REPLACE PACKAGE BODY pack_str
    AS
    PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur)
    IS
    BEGIN
    OPEN ans FOR
    select id,name from col_tab where dept_name in char_in ;
    END str;
    END pack_str;
    the package was created.
    my doubt is
    1.how to pass more than one value for char_in (e.g ('ECE','CIVIL'))
    2. when i was storing the value in string like val = 'ECE,CIVIL' ,
    how to get the id,name for ECE and CIVIL.
    plz help me

    Hi Rebekh ,
    I am recreating your packages for the desired output.
    CREATE OR REPLACE PACKAGE pack_str
    AS
         TYPE type_refcur IS REF CURSOR;
         PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur);
    END pack_str;
    CREATE OR REPLACE PACKAGE BODY pack_str
    AS
         PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur)
         IS
              lv_t varchar2(200);
         BEGIN
              lv_t := REPLACE(char_in,',',''',''');
              lv_t := 'select id,name from col_tab where dept_name in (''' || lv_t || ''')' ;
              OPEN ans FOR lv_t;
         END str;
    END pack_str;
    Note:-
    Input Parameter char_in is a comma seperated value for dept_name
    -Debamalya

  • URGENT: passing more than one value at the same parameter

    Hello friends at www.oracle.com,
    if I have a Forms program that sends some parameters to a Report, how can I send more than one value at the same parameter that is being sent?
    For example: the Reports parameter P_CODE should receive (from Forms) and print the values 1, 2, 3 and 4, each one in a different page. But, only 4 is being printed, and these values aren't saved at a database, so I have to pass the other three values too. How can I solve this problem?
    This is quite urgent and I need help on this.
    Best regards,
    Franklin Gongalves Jr.
    [email protected]

    Thanks to Oracle Reports Team for answering! I'm sure this will work.
    Best regards,
    Franklin Gongalves Jr.
    [email protected]
    hello,
    on the forms side, you will have to build the list for this parameter by e.g. string concat.
    on the reports side you will have to "decode" this parameter according to how you built it in forms.
    e.g. if you pass the list like this "10~20~30" you might use a where-clause in the query
    ... where instr(myCol, :myParam) >0
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

  • How to send more than one value to the Jump target report variable screen.

    Hi,
       I have two reports with Plant variable on their input variable screens. Say this Plant can take two values X and Y. The first report is executed with Plant value X and displays data. When a jump is made  to report two, Plant value X is retrievd into report two's plant varible value. Now how to send value Y also to Report two when jump is made. I think we can do it with a customer exit? Any help is appreciated
    Thanks
    Bhanu

    Hi Bhanu,
    I guess u have created a Variable with Sinlge value ,So Create a Variable which has Multiple Sinlge Values or Interval so that u can have more than one value and if u hvae more than value u will get data for those values and when u do a jump then u can see the data in the JUMP query for both the Values of Input.
    Rgds
    SVU123

  • How to pass more than one value in RfcRequest ?

    Hi  Experts,
    I have a FModule (addition) which is exposed as an Enterprise Service. This FM takes two values as input(VAL1 and VAL2) and gives the result (RESULT). I have done the configuration to connect to the backend system via SAP Widget Foundation. When i tried to test in URL :
    http://localhost:7531/SapMiddleTier/REST/ewcs/service/rfct/form , i gave the input for the RFC Query Parameters as : <VAL1>10</VAL1><VAL2>20</VAL2> , but i get an error "Expecting Expression" .
    Am i giving the input in the wrong format ?
    I wrote another FM which doesnt take any input but returns some text as output and  when i queried it via the above URL, i get the correct result. I again tested with changing the Fmodule that accepts one input and returns one output and i find that it returning perfectly.  But when i try with more than one input i get the below error.
    Could some one please help ?
    See the error :
    <?xml version="1.0" encoding="UTF-8"?>
          <root>
             <Status text="expecting expression" code="-1" type="E"/>
             <StatusDetailList>
                <StatusDetail type="I" text="expecting expression" code="0"/>
                <StatusDetail text="" code="0" type="I" source="net.axyana.qizxopen.xquery.XQEvalException: expecting expression at net.axyana.qizxopen.xquery.ext.XfnEval$Exec.eval(XfnEval.java:62) at net.axyana.qizxopen.xquery.op.Expression.evalAsEvents(Expression.java:556) at net.axyana.qizxopen.xquery.op.ElementConstructor.evalAsEvents(ElementConstructor.java:105) at net.axyana.qizxopen.xquery.op.FLWRExpr.evalAsEvents(FLWRExpr.java:423) at net.axyana.qizxopen.xquery.impl.CompiledQuery.evalAsEvents(CompiledQuery.java:82) at net.axyana.qizxopen.xquery.impl.XQueryExprImpl.doExecuteQuery(XQueryExprImpl.java:267) at
    Best Regards,
    Sam..

    Hi John,
    Thank you for your reply.
    Am trying to test my FM(using http://localhost:7531/SapMiddleTier/REST/ewcs/service/rfct/form) as mentioned in this link:
    http://nvpal168.pal.sap.corp:1080/widgetgallery/staticPage.seam?pageId=staticPage9
    I had downloaded the SAP Widget Foundation and its running.
    Using the link : http://localhost:7531/SapMiddleTier/REST/ewcs/service/rfct/form we can test exposed function modules . If you are using SAP Widget Foundation, then the above link will open up a form
    where in the user gives RFC parameters.
    I gave it as <VAL1>10</VAL1><VAL2>20</VAL2> and click on Query RFC = > i get the above mentioned error. If this works, then i can call my function module via Adobe flex using HTTP Service with the service url as "http://localhost:7531/SapMiddleTier/REST/ewcs/service/rfct/form".
    Best Regards,
    Sam.

  • URGENT: passing more than one value to Reports

    Hello friends at www.oracle.com,
    if I have a Forms program that sends some parameters to a Report, how can I send more than one value at the same parameter that is being sent?
    For example: the Reports parameter P_CODE should receive (from Forms) and print the values 1, 2, 3 and 4, each one in a different page. But, only 4 is being printed, and these values aren't saved at a database, so I have to pass the other three values too. How can I solve this problem?
    This is quite urgent and I need help on this.
    Best regards,
    Franklin Gongalves Jr.
    [email protected]

    Hello Shay,
    thanks for your answer, I think this will solve my problem. I hope my description of the problem was clear enough.
    Just a comment about the (very interesting) new design of this Forum: Preview button is not working here.
    Best regards,
    Franklin Gongalves Jr.
    [email protected]
    How about sending the paramter value p_code='1,2,3,4'
    and in Reports use lexical parameters (look at the online help on this).
    Select .... Where Code in (&P_CODE)
    I think this should work.

  • How to pass more than one parameter

    Hello,
    This is my code.
    How to pass more than one parameter:
    SELECT:responsibility_name responsibility_name,
    LPAD(' ', 6*(LEVEL-1))
      || menu_entry.entry_sequence sequence ,
      LPAD(' ', 6*(LEVEL-1))
      || menu.user_menu_name SubMenu_Description ,
      LPAD(' ', 6*(LEVEL-1))
      || func.user_function_name Function_Description ,
      LPAD(' ', 6*(LEVEL-1))
      || menu_entry.prompt prompt
      ,menu.menu_id ,
      func.function_id
      --menu_entry.grant_flag Grant_Flag ,
      --DECODE( menu_entry.sub_menu_id , NULL, 'FUNCTION' , DECODE( menu_entry.function_id , NULL, 'SUBMENU' , 'BOTH') ) Type
    FROM fnd_menu_entries_vl menu_entry ,
      fnd_menus_tl menu ,
      fnd_form_functions_tl func
    WHERE menu_entry.sub_menu_id    = menu.menu_id(+)
    AND menu_entry.function_id      = func.function_id(+)
    AND MENU.LANGUAGE(+) = 'US'
    AND FUNC.LANGUAGE(+) = 'US'
    --AND func.user_function_name LIKE '%Primary Care Providers%'
    AND grant_flag                  = 'Y'
      START WITH menu_entry.menu_id =
      (SELECT menu2.menu_id
      FROM fnd_menus_tl menu2,apps.fnd_responsibility_vl resp
      WHERE menu2.menu_id=resp.menu_id
      and resp.responsibility_name= :responsibility_name
      --and menu2.user_menu_name = ('ATCO HR INQ USER'
      AND LANGUAGE = 'US'
      CONNECT BY MENU_ENTRY.MENU_ID = PRIOR MENU_ENTRY.SUB_MENU_ID
       and menu_entry.function_id not in (select func.function_id
                                       from --fnd_form_functions_vl fnc,
                                       apps.fnd_resp_functions exc,
                                       apps.fnd_responsibility_vl res
                                      where func.function_id = exc.action_id
                                      and res.responsibility_name =:responsibility_name
                                      and res.responsibility_id=exc.responsibility_id)
      and menu_entry.sub_menu_id  not in (select menu.menu_id
                                       from --fnd_menus_vl imn,
                                       apps.fnd_resp_functions exc,
                                       apps.fnd_responsibility_vl res
                                       where menu.menu_id = exc.action_id
                                       and res.responsibility_name =:responsibility_name
                                      and res.responsibility_id=exc.responsibility_id)
    ORDER SIBLINGS BY menu_entry.entry_sequence;
    Thank you for your help
    Shuishenming

    Hi, Ming,
    One way is to put the "parameters" in a table, and join to that table in your query.  If you make it a Global Temporary Table, then multiple sessions can run the query at the same time, and each can be seeing different responsibilities.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.  Since this problem involves parameters, you should give a couple of different sets of parameters, and the results you want from the same sample data for each set.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Html check box pass more than one value into bean

    Hi all'
    I have group of check box in html , I need to pass more than one value
    into bean an ddisplay in jsp
    what do i do wrong
    private Vector select =new Vector();
      private String mybox =null;
      public download() {
         again(); 
      /* Accessor Methods */
    private void addmybox(String name){
        select.addElement(name);}
    public void setMybox(String name) {
         mybox = name;
    public String[] getMybox() {
         String[] s = new String[select.size()];
         select.copyInto(s);
         return s;
            in my htmli have <%
         String[] mybox= format.getMybox();
         for (int i=0; i<Mybox.length; i++) {
             <%= format.getMybox%>
    %>
    i got error at <%= format.getMybox[i]%>

    Hi ram,
    thank you, I don't have ideal in my mide .
    in my jsp I have
    <td>  <input type=checkbox name=mybox value=<%= link.getNewNum()%>></td>in my servlet I have something like
    String[] checked = request.getParameterValues("mybox");
            try {
            conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433","A#$","RE@89");
            conn.setCatalog("sequences");  
          stmt = conn.createStatement();  
           for(int i=0; i<checked.length; i++){
                   String select=checked;
    String Sql=" select NewNum, Name, Length, Segment, Sequence";
    Sql+=" from Sec04";
    Sql+=" where NewNum='"+select+"'";
    Sql+=" union";
    Sql+=" select NewNum, Name, Length, Segment, Sequence";
    Sql+=" from MySec";
    Sql+=" where NewNum='"+select+"'";
    Sql+=" union";
    Sql+=" select NewNum, Name, Length, Segment, Sequence";
    Sql+=" from Sec03";
    Sql+=" where NewNum='"+select+"'";
    Sql+=" union";
    Sql+=" select NewNum, Name, Length, Segment, Sequence";
    Sql+=" from Sec02";
    Sql+=" where NewNum='"+select+"'";
    Sql+=" union";
    Sql+=" select NewNum, Name, Length, Segment, Sequence";
    Sql+=" from Sec01";
    Sql+=" where NewNum='"+select+"'";
    rs = stmt.executeQuery (Sql);
    while(rs.next()) {              
    String Name = rs.getString("Name");
    String Segment =rs.getString("Segment");
    String Length = rs.getString("Length");
    String Sequence = storeSequenceData(rs.getString("Sequence"));
    String SContent = Name + " ," Segment ", "+ Length + "\n" +Sequence  ;
    now I want
    String SContent = Name + " ," +Segment + ", "+ Length +  "\n" +Sequence  +"\n" + Name+"Segment+","+length+"+"\n" +Name......untill the end
    it sees like I need to look st on shipp car. is that right??
    Thank you !!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Can anyone give me simple instructions on how to use more than one ipod on the same computer with itunes? Both my daughters have ipods, my wife has one

    Dear All
    Can anyone give me simple instructions on how to use more than one ipod on the same computer with itunes. My daughters have a different generation 'nano' each & my wife a 'shuffle'?
    Many thanks

    Click here for options.
    (69081)

  • How to pass more than one parameter using common...

    Hi,
    I am using ODP.NET with my 2005 VB
    I want to create function from where I can pass more than one parameter to execute SP, or query just like i created for SQL SERVER as below
    Public shared Function CreateParameter(ByVal paramname As String, ByVal paramvalue As Object) As DbParameter
    Dim param As DbParameter
    param = New SqlParameter
    param.ParameterName = paramname
    param.Value = paramvalue
    Return param
    End Function
    Public Shared Function ExecuteQuery(ByVal sql As String, ByVal commtype As CommandType, ByVal ParamArray parameter As DbParameter())
    Dim cmd As DbCommand = New SqlCommand()
    cmd.Connection = OpenConnection()
    cmd.CommandType = commtype
    cmd.CommandText = sql
    cmd.Parameters.AddRange(parameter)
    Dim RetVal As Integer = cmd.ExecuteNonQuery()
    Return RetVal
    End Function
    specially part is in bold to be converted
    I tried like but oracleCommand.parameters doesnt support AddRange
    please help me out
    Regards

    Hello,
    I used the following way:
    pCommand.CommandText = "Update " + sDataTable + " set "
    + sColumnName + " = :1 ";
    pCommand.Parameters.Add("ValueToDb",
    this.DefaultDbType,
    this.m_Value,
    System.Data.ParameterDirection.Input);
    Of course, you can add :2,... to your command text, too.
    The way back is:
    sEndOfTheClause += " RETURNING " + sDataTable + "." + sColName + " INTO :iNewValue";
    pCommand.CommandText = ... + sEndOfTheClause;
    pCommand.Parameters.Add("iNewValue", this.DefaultDbType,
    ParameterDirection.Output);
    bool bReturn = (pCommand.ExecuteNonQuery() != 0);
    if ((bReturn == true) && (pCommand.Parameters.Count > 0))
    this.Value = DataService.Convert<DATA_TYPE>(pCommand.Parameters[0].Value);
    ....

  • How to display more than one data on the same page?

    Hello all,
    I have a question that is if I want to choose more one data on the same page and the data is selected from the same column.
    I.E I want to tick more than one boxes in the page but the data is selected from the same column.

    Select all the item to burn... right click...
    Or
    Place all items into a folder and burn the folder to the disc.
    Or
    Make a Burn Folder in the Finder (place items into the folder) and burn from there to a disc.

  • How to return more than one value from a  function

    hello everybody,
    Can anyone tell me how to return more than a single value from a function, the problem is i have 4 points,
    2 points form one line ,another 2 points form 2nd line ,each point is 3 dimensional(x,y,z coorinates) so i will pass these values to func(x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4), i will find the point of intersecton of two lines and i will get it as x,y,z , now how to return these 3 coordinates,usually the function returns only one value, please help me to solve it out.
    Thanks.

    I think the easiest way or trick here is (easiest isn't always the best as we know, but atleast this one will work) to create simple data array. and pass that. Create an array with:
    <code>
    class justArray {
    int x=0
    int y=0;
    int z= 0;
    ...somewhere
    justArray[] points= new justArray[4];
    points[0].x= ..
    points[0].y= ..
    points[0].z= ..
    points[1].x= ..
    return points[]
    </code>

  • How to have more than one playlist on the iPOD mini ...?

    This may seem a silly question - after all, isn't it the whole point of the iPOD ? Anyway, with my current setup, I cannot get more than one playlist onto my ipod mini.
    Using Win2000Pro, connecting using USB; there have been lots of other issues involving ' cannot read/write to ipod ' which have been reported on these forums , I started having problems after Apple 'upgraded' iTunes from 4.9 ...ended up with nothing on the ipod at all. Since then a few upgrades and now running iTunes 6.0 (not 6.0.1), it DOES sync with the ipod but does not let me manage the playlists:
    Since my library is > the ipod ( 4 GB model) I cannot use the option ' sync all songs & playlists' , which is what I originally used when the library was < the ipod. At that point I did get ( automatically I think..) a few playlists onto the ipod.
    Howeever, since the library got too big, I have to select 'sync to these playlists only' . I use 1 master list, which works, ( it syncs all the songs to the ipod and I get just that playlist on the 'pod) but any attempt to select another playlist from that dialogue box results in consistent hanging of iTunes, and you have to kikll it in task manager.
    I would have thought that you could simply drag n drop a playlist onto the connected ipod icon (that would be more elegant) but the inteface doesn't allow it..
    Oh and another thing ..why does the syncing tool delete ones on the go playlists from the pod ? I can't even get around this issue by making them manually on the 'pod as they get deleted when syncing.. Grrrrhhh
    Where to go from here guys & gals ??
    Thanks...any tips gratefully received
    Aries/ AMD Windows 2000 Draytek Wireless DSL 2 Mb

    Ok I'll try that, although I did try it earlier when I had iTunes 5.xx loaded, I think.
    As to size of playlists, I have a master (900 songs) that defines what will fit onto the ipod , I then generate all the others as subsets of the master (not of the library)- hence I know they will all fit
    Can you also clarify something for me: the dialogue box we are discussing is intended, I think, so that one can set the automatic synching of certain playlists between the PC & the ipod. Is that the only way one can select other playlists to go to the ipod - i.e. as static once-offs, not synchronised ?
    Apple' docs, I think, are poor in this regard - they assume most ipods are bigger then the users song library and they gloss over the details of this alternate mode of playlist synching.
    Thanks - Nick

  • How to pixalet more than one person on the same piece of footage?

    Trying to pixalet more than one person in a piece of video footage with Final Cut Pro X. Having problems trying to do more than one person.

    rebelrider1 wrote:
    Trying to pixalet more than one person…
    you can apply the Censor Effect, as most other effects, more than once:

  • How to burn more than one file on the same dvd?

    I would like to burn more than one file in to the same dvd. It seems to me that using Finder I can burn only a file. There is some alternative command? Thank's

    Select all the item to burn... right click...
    Or
    Place all items into a folder and burn the folder to the disc.
    Or
    Make a Burn Folder in the Finder (place items into the folder) and burn from there to a disc.

Maybe you are looking for

  • Combining 4:3 and 16:9 video in a single widescreen project

    I am working on my first DV widescreen project in iMovie 6. The majority of the video footage I'm using was shot in 16:9 (widescreen) format and imported just fine. I then imported into the same project some additional footage from a friend's camera

  • Frequent Locking

    Hi all, We were developing a system based on Oracle8i. Then we upgraded to Oracle9i, which provided nice performance enhancements. On the other hand, we keep facing a problem. The schema which contains the application we're developing keeps locking s

  • Help, out of memory error

    Hi all, I have been developing a Java application, which reads a text file and shows it as a table. In the table model (adapted from AbstractTableModel) I use, the core data structure is a 2D array. Since the text file is stored based on a 2D array u

  • .mac system pref

    Has anyone had any problems with .mac system pref?

  • Can we manually Win 7 Lenovo EE laptop ?

    hi i bought my thinkpad edge 13 0196-2zg with Free DOS , so i cant use Lenovo Win 7 EE features =( i had my original win 7 pro license and i installed it alone with clean install . so i wanna ask if i can manually set Lenovo Win 7 EE features ? BIOS