How to pass the value entered for the parameter IN a function

Hello
I'm new to pl/sql programming.
The function below is used inside a package and the package is called in visual studio.
The function uses the input parameters 2.
Out what "in_report_parameter_id" value comes through the application of service job processor.
The second IN the parameter values are hard coded into the function.
I am not able to understand this.
If the values are hard coded, how to ensure that only the hard coded values are the right ones?
Please could someone explain?
I don't really have good idea on how to move the INPUT parameter to the function or procedure
Is there any nice document that could give me good understanding about what are the ways or types we could transmit values to the input in the subprogrammes parameter?

Thanks in advance.

CREATE OR REPLACE FUNCTION get_class_text_str
(
     in_report_parameter_id IN NUMBER,
     in_which                IN VARCHAR2 DEFAULT 'SELECT'
)
RETURN VARCHAR2
IS
         end_text            VARCHAR2 (50)   := ''; 
         my_class_text_str  VARCHAR2(10000) := '';
         my_class_value_str VARCHAR2(10000) := '';
 
     CURSOR class_text(c_1_text VARCHAR2, c_2_text VARCHAR2) IS
     SELECT c_1_text || report_parameters.report_parameter_value 
                           || c_2_text
                           || report_parameters.report_parameter_value 
                           || '" '
      FROM report_parameters
     WHERE report_parameters.report_parameter_id     = 3690
       AND report_parameters.report_parameter_group  = 'CLASS'
       AND report_parameters.report_parameter_name   = 'CLASS'
 GROUP BY report_parameters.report_parameter_value
 ORDER BY CAST(report_parameters.report_parameter_value AS NUMBER);
 
BEGIN

     IF (in_which = 'SUM') THEN     
  
          OPEN class_text ( 'SUM(NVL("Class ', '", 0)) "Class ' );
    
     ELSIF (in_which = 'PERC')THEN
  
          OPEN class_text ( 'ROUND((("Class ', '" / "Total") * 100), 2) "Class ' );
          end_text := ', DECODE("Total", -1, 0, 100) "Total" ';
    
     ELSE
  
          OPEN class_text ( 'SUM(DECODE(bin_id, ', ', bin_value, 0)) "Class ' );
    
     END IF;
 
     LOOP
          FETCH class_text INTO my_class_value_str;
          EXIT WHEN class_text%NOTFOUND;
 
          my_class_text_str := my_class_text_str || ', ' || my_class_value_str;
     END LOOP;
 
     CLOSE class_text;
  
     my_class_text_str := my_class_text_str || end_text;
 
     RETURN my_class_text_str;
     
END get_class_text_str;
/
Published by: user10641405 on November 19, 2009 08:16

Published by: user10641405 on November 19, 2009 08:30

This is not a conception I would use, but should work if coded correctly. I would probably create a reference text cursor query and use a fetch of open and close.

You have 2 input parameters, in_report_parameter_id and in_which. I could not find where in_report_parameter_id has been used in the program, but the value passed to in_which is used in the logic of the FI to decide on opening the cursor. After the cursor is opened lines are to be read and possibly the cursor is closed.

The in_which values are compared to the are hard-coded. It is the programming interface to ensure that the values are the values and the measures taken are also correct. Your program is assuming that if the first 2 values are not met the third listed is the one you want.

To pass values of entry in a procedure you simply provide the values as a literal or something like variable in the call,

whatever := get_class_text_str(1,'SELECT');

Tags: Database

Similar Questions

  • How to pass the parameter one form to another form?

    Hello

    I want to pass the parameter one form to another form called.

    What are the steps I want to do.

    Please guide me

    Iqbal

    Published by: Sabrina on July 21, 2010 23:38

    You want to see this link...

    sheikyerbouti.developpez.com/forms/Forms_Parameters.doc

  • How to pass the parameter to the script for interface/Package in ODI

    Hello

    Yesterday I asked a question how to pass a parameter to run the script interface or the procedure?

    I don't know if it's possible.

    Any clarification will help you.

    Kind regards

    Mahesh

    Mahesh, why not try this in your machine? This will give you more clarity and confidence.

    ODI has always check if there is any variable used inside an object regardless of the interface or procedure or package. So whenever you generate the script, you will be asked to select the boot parameters. She's. Whenever you use this scenario, make sure you that you add the variables in the additional variables section of the Properties tab.

    So answer is that it is possible.

    Bravo!

  • How to pass the parameter of workflow

    As being new owb, I'm still trying to figure out how to pass a parameter through workflow.

    I have this map with an input parameter, and I included this mapping in this workflow. I wonder how to pass a parameter value for this workflow and bind it to the mapping?

    ~ Prabha

    Prabha,
    Select the activity start then in the Explorer window (in the left upper corner of the process editor) on green sign more for adding parameter processflow.
    Enter the name of the parameter and specify the type of data (perhaps by default).
    Select your map, and then in the Exporer window click parameter mapping entry.
    now the object details window, you can bind the input parameter to the parameter processflow with change of binding property

    Kind regards
    Oleg

  • How to pass the parameter of column in a table of trinidad to the next page?

    Hello
    In fact, we work with trinidad tables and forms on our pages snce we will deploy to mobile.
    I saw a video shared by Shay, parameter passing between pages with adf components - the column was converted to create a link, then it a setProperty earphone is placed on the table to catch the parameter.
    How can do us same with paintings of the Trinity? I do not see any place to convert the column link, but in vain.
    I tried to use a radio button select with the table, but I do not know how to extract the value of this.
    Please provide your valuable suggestions on this.

    Concerning

    Hello

    If you go to the source of table view you see something like

    TR:column containing--> tr:outputText

    You would simply change the tr:outputText to tr:commandLink

    Frank

  • How to pass the parameter in where clause contained in the custom file?

    I have the tracking query

    Blue are the parameters

    I paste this to a custom folder

    and

    Select last_update_date, creation_date

    of ra_customer_trx_all

    "where trunc (last_update_date) = 29-SEP-2012."

    and customer_trx_id = 1109

    in another folder custom return 1 row only and create a different worksheet in the same workbook and create

    3 setting and 2 of them pointing to the 1 row to query and create a calcualtion

    SET_CONTEXT ("Date_From", TO_CHAR(:Date From)) and SET_CONTEXT ('Date_TO', TO_CHAR(:Date To))

    and 1 condition 1 = SET_PARAM3(:Period)

    but this does not work for me, no data back please help

    Select m.party_name TENANT_NAME

    b.interface_line_attribute10 lease_num

    -, b.interface_line_attribute12 «PPS Number.

    b.interface_line_attribute2 LOCATION_CODE

    flexv.description property_name

    INVOICE_NUMBER a2.trx_number

    -, t.nom "Type of Transaction".

    -, e.attribute15 "AS400 Key."

    , b2.description 'BILL_ITEM_INVOCIE_DESCRIPTION '.

    , case when gcc.segment5 like 6% ' then ' P/L '.

    When gcc.segment5 like 7% ' then ' P/L '.

    When gcc.segment5 as 8% ' then ' P/L '.

    When gcc.segment5 like 9% ' then ' P/L '.

    else "B/S".

    end as account_nature

    -, gcc.concatenated_segments as 'account of burden '.

    gcc.segment1 company_code

    gcc.segment2 department_code

    gcc.segment3 property_code

    gcc.segment4 business_segment

    gcc.segment5 account_code

    gcc.segment6 project_code

    gcc.segment7 intercom_code

    gcc.segment8 spare1

    gcc.segment9 spare2

    b2.extended_amount BILL_ITEM_INVOICE_AMOUNT

    to_char (substr(ps.gl_date,4,8)) gl_period

    b.interface_line_attribute11 bill_start_date

    b.interface_line_attribute14 bill_end_date

    decode (a2.invoicing_rule_id, '-2',

    DECODE (TO_CHAR ("b.RULE_START_DATE, ' YYYYMM"), to_char (to_date (to_char (TRUNC (to_date (SETPARAM.) GET_PARAM3, "YYYYMM"), 'Month')-1), "MON-DD-YYYY"), "YYYYMM"), "Current", "Forward").

    'In progress' Bill_nature)

    , to_char (a2.trx_date, ' MON-DD-YYYY "") invoice_date

    pal.lease_commencement_date

    pal.lease_termination_date

    h.user_name created_by

    -, NULL as remarks

    of ra_customer_trx_all one

    ra_customer_trx_lines_all b

    pn_leases_all d

    e pn_tenancies_all

    hz_cust_accounts l

    hz_parties m

    fnd_user h

    ar_payment_schedules_all ps

    RA_CUST_TRX_LINE_GL_DIST_ALL dist

    gl_code_combinations_kfv gcc

    AR_RECEIVABLE_APPLICATIONS_all app

    ra_customer_trx_all a2

    ra_customer_trx_lines_all b2

    RA_CUST_TRX_TYPES_all t

    fnd_flex_values_vl flexv

    pn_lease_details_all pal

    where

    App. APPLICATION_TYPE = "CM".

    and flexv.flex_value = gcc.segment3

    and flexv. FLEX_VALUE_SET_ID = 1014916

    and pal.lease_id = d.lease_id

    and app.applied_customer_trx_id = a.customer_trx_id

    and app.customer_trx_id = a2.customer_trx_id

    and a2.cust_trx_type_id = t.cust_trx_type_id (+)

    and a2.org_id = t.org_id (+)

    and b.customer_trx_line_id = b2.previous_customer_trx_line_id

    and dist. CUSTOMER_TRX_LINE_ID = b2. CUSTOMER_TRX_LINE_ID

    and dist.account_class = 'REV '.

    and dist.account_set_flag = DECODE (NVL(a2.invoicing_rule_id,1)-2, 'Y', 'n')

    and gcc. CODE_COMBINATION_ID (+) is Dist. CODE_COMBINATION_ID

    and b.interface_line_attribute10 = d.lease_num

    and d.lease_id = e.lease_id

    and e.primary_flag = 'Y '.

    and b2.customer_trx_id = a2.customer_trx_id

    and a2.bill_to_customer_id = l.cust_account_id

    and l.party_id = m.party_id

    and a2.created_by = h.user_id

    and ps.customer_trx_id = app.customer_trx_id

    and ps.gl_date between trunc (trunc (TO_DATE (SYS_CONTEXT ('DISCO_CONTEXT', 'Date_From')), 'MM')-1, 'MM') and trunc (TO_DATE (SYS_CONTEXT ('DISCO_CONTEXT', 'Date_To')), 'MM')-1

    What exactly is the problem with the results? Can you do the report include the gl_date, so that you can see exactly what is included?

    The only way to solve this is back to basics. You must be certain that the setting and calculations for the date work 100%. You have granted the Execute permission on the function to your landlord EUL - Yes? I did create the function in a package belonged to EUL_US, then I got no problem with permissions or grant.

    Also, gl_date is a DATE string and not a right? I ask because if it is not a date, but a string then a few dates could be left out.

    Assuming that you are 100% some of the building blocks, you should start by including only the gl_date and the primary key of the table you are using. Once you are sure you have found the right data, you can start adding in addition to fields.

    I note that you use the E-Business Suite objects. I copied the code in my system where I don't use rental. So I put comment references to tables 3 PN. I had 150 lines of data when I asked for it by using the parameter, and then when I hard coded the BETWEEN operator for the gl_date. You don't have to make sure that your landlord EUL got right SELECT all tables and views used in your code and, if you want to share this code with someone else, you must also have LICENSING rights.

    Try your code in a SQL like TOAD tool and see what happens. Are you absolutely sure that each of your transactions has an entry in the tables PN? Maybe it's why you don't get the results you expect. You can try, as I did, to comment these lines out and then see what happens.

    Hopefully this has given you enough to solve your problem

    Michael

    PS. It would be nice to know your name. You have not used once it in your thread.

  • How to pass multiple values in a single parameter

    Hi all

    I have a setting in my report called dept, this setting takes values in a list. I am using a sql query to populate the list. then the values available for dept are HR, FINANCE, MARKETING.

    In the setting column, I checked the option "MULTIPLE SÉLECTION" AND "CAN SELECT ALL" and I select "all THE VALUES PASSED.

    Now my data model sql looks like

    Select * from emp where Department: dept

    When I try to view the report and select ALL the list of values I don't get any results out of it. In short, I want to run my query for all values of the Department and I want that this query to run when I select ALL from the list.

    Select * from emp where Department ('HR', 'FINANCE', 'MARKETING')

    But I don't get all the data, is it passing null? How to solve this?

    Any help will be really appreciated

    Thank you
    Ronny

    You can change the code to sql data model looks like

    select * from emp where department in (:dept )
    
  • How to pass the parameter of type array of ADF

    12.1.2 jdev

    I want to call a stored procedure with parameters of type Table entry in the oracle database. Please let me have an example about that.

    create or replace type forecast_rec as object  ( pYear varchar2(4), pQtr varchar2(1), pAmount number(17,2));
    
    create or replace TYPE FORECAST_TABLE AS TABLE OF forecast_rec;
    
    create or replace PROCEDURE FORECAST_INSERT_TEST(p_iorec IN FORECAST_TABLE) AS
    BEGIN
    if p_iorec is null or  p_iorec.count = 0 
    then 
      return;
    end if;
    FOR i IN 1..p_iorec.count LOOP
    --get p_iorec(i).EMP_NAME
    insert into forecast_rec_test values(p_iorec(i).pYear, p_iorec(i).pQtr, p_iorec(i).pAmount);
    END LOOP;
    END;
    

    Thank you

    Sanjay Chatterji

    Please see:

    http://technology.amis.nl/2008/07/16/oracle-jdbc-passing-a-table-of-custom-object-type-to-a-stored-procedure-implementing-efficient-single-round-trip-data-exchange-part-two-of-an-adf-application-on-a-plsql-api/

    Thank you

  • OWB11gR2, model mapping - how to pass the parameter

    Hello
    There is a problem with the passing of input (e.g. in processflow) parameter for the Mapiing model with non-Oracle target.

    According to literature OWB parameter mapping Input operator only is not supported if the target table is non-Oracle
    (and really OWB error VLD-1330: assignment of invalid code model.) Enforcement unit... contains PL/SQL INPUT_PARAMETER operator and only Oracle target models of code can be assigned to it.).

    Are there ways to pass parameters to the model mapping in processflow?

    Thank you
    Oleg

    Oleg,

    Variable duration can be used to substitute values during execution.
    Variable duration can act as an input parameter (I don't know what looks like your CT mappings and what it does).
    I hope it's useful.

    More details can be found here http://blogs.oracle.com/warehousebuilder/2009/10/owb_11gr2_template_mapping_variables.html

    Its easy to set up and use.

    Thank you.

    Published by: user571269 on May 26, 2010 06:50

  • How to pass the parameter between two adapplications (remote application)

    Hi friendz,.
    Please help me...
    I use JDEV 11.1.2.2.0 version.
    My problem is the following,
    When I have two applications of mapping through the jar files.
    It works well, but I want to continue setting an application to another application...
    How can I do this?
    Thank you...
    -Rude-

    Edited by: Harsh1 December 10, 2012 19:10

    Hello

    Check this: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/52-taskflow-in-lib-169195.pdf

    Arun-

  • How to pass the parameter DATE to a DBMS_JOB package

    create or replace procedure proc_day as
    number of l_job;
    Start
    dbms_job. Submit (l_job,'pro_duration_alarms_daily(''05/09/2012'') ;');)
    dbms_job. Submit (l_job,'pro_duration_alarms_daily(''05/10/2012'') ;');)
    dbms_job. Submit (l_job,'pro_duration_alarms_daily(''05/11/2012'') ;');)

    COMMIT;
    end;

    When calling the above procedure, it gives the following error message, what's not here

    ERROR on line 1:
    ORA-06550: line 1, column 93:
    PLS-00306: wrong number or types of arguments in the call to
    'PRO_DURATION_ALARMS_DAILY '.
    ORA-06550: line 1, column 93:
    PL/SQL: Statement ignored
    ORA-06512: at "SYS." Dbms_job", line 82
    ORA-06512: at "SYS." Dbms_job", line 140
    ORA-06512: at "ORPHEUSNZ. PROC_DAY', line 4
    ORA-06512: at line 1

    What's not here.. ? in case of normal use, I'll call the procedure as below

    exec pro_duration_alarms_daily('05/09/2012');

    Describe exactly "does not work".

    Now maybe YYY YYYY not for example?

    Show us the arguments to this procedure if there is a procedure.

    In addition, you must wrap a procedure with a call "begin... end; ' when calling DBMS_JOB.

    that is assuming that pro_duration_alarms_daily is a procedure that accepts a single parameter DATE so

    dbms_job.submit(l_job,' begin pro_duration_alarms_daily(to_date(''05/09/2012'',''MM/DD/YYYY'')) ; end;'); 
    

    Is what version?
    No reason DBMS_JOB not DBMS_SCHEDULER that offers more flexibility?

    You can test this out DBMS_JOB quite easily.

    It work?

    begin pro_duration_alarms_daily(to_date('05/09/2012','MM/DD/YYYY')) ; end;
    

    If this isn't the case, then you can understand why without DBMS_JOB being in the picture.

    Published by: Dom Brooks on July 19, 2012 11:55

  • How to pass the parameter of function (Alert.show) confirm closing?

    <! [CDATA]
    Mx.controls import. *;
    Mx.events import. *;
    private void deleteItem(guid:String):void
    {
    Alert.Show ("Are sure you want to delete?", "Confirm deletion", Alert.YES |) Alert.NO, this, alertClicked);
    }
    private void alertClicked(event:CloseEvent) {}

    if(Event.detail == Alert.Yes) {}
    Alert.Show ("Yes" + guid); <-I would like to get the guid
    }
    Else if (event.detail == Alert.NO) {}
    Alert.Show ("n");
    return;
    }
    }
    []] >

    Thank you.

    Hi Itambs,

    You can do the following:


    http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete = 'deleteItem ("Dummy GUID VALUE")' >

      Mx.controls import. *;
    Mx.events import. *;
    private var myAlert:Alert;
      
    private void deleteItem(guid:String):void
    {
    myAlert = Alert.show ("Are sure you want to delete?", "Confirm deletion", Alert.YES |) Alert.NO, this, alertClicked);
    myAlert.data = guid;
    myAlert.height = 150;
    myAlert.width = 300;
    }
    private void alertClicked(event:CloseEvent):void {}
      
    if(Event.detail == Alert.Yes) {}
        
    Alert.Show ("Yes" + guid); //<-- here="" i="" want="" to="" get="">
    Alert.Show ("Yes" + myAlert.data);
    }
    Else if (event.detail == Alert.NO) {}
    Alert.Show ("n");
    return;
    }
    }

    ]]>

    "" Note: you can also do this another way of decalring a guid variable as global... private var _guid:String = "";

    Define _guid = guid. in the deleteItem() function, and then based on the alertClicked() you can access the value as _guid again... which contains the saved value...

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

    Thank you

    Jean Claude Chari

  • How to pass the Visa Resource Name parameter to labview dll in labwindows/cvi

    Hello world

    I build a dll of labview, the prototype is: double getchannelpower (double f, uintptr_t * VISAResourceName);

    I don't know how to go from VISAResourceName to this function.

    Is it related to the ViPSession paremeter in function viOpen(REES ViSession, rn ViRsrc, ViAccessMode am, ViUInt32 ti,ViPSession vi)?

    BRs,

    lotusky

    Hey, guys:

    I figured out how to pass the parameter.

    In labview, you must replace the control of visa with string control. In this way, the generated dll function at the entrance of the string type.

    I hope this will help others!

    lotusky

  • Pass the parameter page fragment in a dynamic region

    Hello.

    I use Jdeveloper 11.1.1.3.

    Can someone explain to me how to pass the parameter page fragment in a dynamic region?

    My situation is:

    I have only 1 page: index.jspx.

    This page includes 2 items:
    1. < af:tree >
    < af:tree id = "t1" var = 'node' rowSelection = 'single '.
    value = "#{bindings." Rendering FpsrVO1.treeModel}"="true"expandAllEnabled ="true ".
    contentDelivery = "lazy" initiallyExpanded = "false".
    contextMenuSelect = 'false' fetchSize '-1' = >
    < f: facet name = "nodeStamp" >
    < af:commandLink id = "cl1" rendered = 'true '.
    actionListener = "#{backingBeanScope.RegionDynamicBean.treeClick}" >
    < af:outputFormatted id = "outForm' value = ' #{node." Name}' has made = "true" / >
    < name f: attribute = "Flash" value = "#{node." Code} "/ >"
    < / af:commandLink >
    < / f: facet >
    < / af:tree >
    2. < af:region >:
    < af:region value = "#{bindings.dynamicRegion1.regionModel} '"
    ID = "r1" / >
    region could be changed to 3 delimited taskFows who have just a fragment of page.

    Can someone explain to me how I can send < name f: attribute = "Flash" value = "#{node." Code} "/ > element tree to page fragment that will appear on the screen?"

    You can move a card to the dynamic region that would take the parameters of workflow task in the form of key-value pairs.


    taskFlowId = "${backingBeanScope.TestPageBean.dynamicTaskFlowId}" "
    Activation = "deferred."
    xmlns = "http://xmlns.oracle.com/adf/controller/binding."
    parametersMap="#{backingBeanScope.TestPageBean.parameters}"/ >

    When reloading the taskflow, ensure that the settings are loaded into the taskflow.

    See this example from exactly your use case:
    http://adfsampleapplications.googlecode.com/svn/trunk/TaskflowParamSampleApp.zip

    Thank you
    Nini

  • pass the parameter in PL/SQL on UNIX "such what."

    Hello
    I need the 4 parameters of Oracle procedure through Unix Shell script...
    procedure signature :-
    PROCEDURE Builder(csvFileName OUT VARCHAR2,pdfFileName   OUT VARCHAR2, fileId IN NUMBER, csvresult OUT VARCHAR2,pdfresult OUT VARCHAR2);
    UNIX Shell script:
    BudResult=$(exec_Builder $fileId)  
    echo $BudResult | read csvfileName pdfFileName csvresult pdfresult
    Problem: 1 suppose pdffile pdfresult has Null values in the procedures of the Oracle, and unix shell will read parameters with spaces so
    I am incorrect parameter values in UNIX script.
                   
    Oracle Procedure result:                   Unix Shell Result
    csvfile = ABC.csv                         csvfile = ABC.csv
    pdfFile = NULL                            pdfFile = Success
    csvresult = Success                       csvresult = 
    pdfresult = NULL                          pdfresult = 
                   
    2. suppose csvresult has value "Userdefined Exception" in oracle procedure but Unix reads it as following
    
    Oracle Procedure result:                 Unix Shell Result
    csvfile = ABC.csv                         csvfile = ABC.csv
    pdfFile = XYZ.pdf                         pdfFile = XYZ.pdf
    csvresult = Userdefined Exception         csvresult = Userdefined
    pdfresult = Success                       pdfresult = Exception Success
    In nut shell how to pass the parameter "like what" PL/SQL in UNIX...

    Thank you
    Sandy

    So, what kind of problem you know now? What output do you get it?

    echo oenResult=$oenResult
    
  • How to pass the value of the run-time file .sh by Oracle procedure

    I have a file test.sh that contain

    #1/bin/bash

    exp test/test@orcl file=/home/oracle/dump/test.dmp log=/home/oracle/dump/test.dmp grants = Y = index constraints Y = Y = (test) owner statistics = none

    Exit 0

    I craete a work called Create_job_proc in this work, I want to pass the value of job_action is the location of the file test.sh to

    /U01/home/Oracle/dump/test.sh and want to spend the test/test@orcl as a variable...

    Please suggest me... how to pass the value of Job_Action which will replace the .sh file content test/test@orcl to the value of the time of execution as scott/tiger@hr

    Thank you much Parth... It works perfectly...

    Thank you all for your help...

Maybe you are looking for