Passing function value into another procedure

Hi
From this package the value returned by the function " FIRST " needs to pass into another procedure as parameter in the same package, how could i do that in a better way.Oracle Version 8.1.7.4.0.
CREATE OR REPLACE package body PKG_CUST_CHECK is
FUNCTION FIRST(P_PARMS in varchar2) return varchar2 is
l_parms varchar2(62) := P_PARMS;
BEGIN
SECOND(l_parms);     
     return(l_parms);     
END;
PROCEDURE SECOND(P_PARMS in out varchar2) is
L_CUST Varchar2(30);
BEGIN
SELECT P_CUST INTO L_CUST FROM TABLE_A WHERE ROWNUM=1 ;
THIRD(P_CUST in VARCHAR2,
P_PARMS_VALID out VARCHAR2,
P_OK_FOR_CUST out VARCHAR2,
--Here the output of the above procedure will be concatinate and Return ;     
END CUST_CHECK;
end PKG_CUST_CHECK ;
Thanks

sorry for the confusion, not sure whether it will be clear enough.
the requirement is function "FOURTH" should get the value returned
by the function "FIRST" as in parameter value.
[ code ] CREATE OR REPLACE package body PKG_CUST_CHECK is
FUNCTION FIRST(P_PARMS in varchar2) return varchar2 is
l_parms varchar2(62) := P_PARMS;
BEGIN
SECOND(l_parms);     
return(l_parms); --here the value which is returning is updated one by the THIRD procedure       
END;
PROCEDURE SECOND(P_PARMS in out varchar2) is
l_parms varchar2(62) := P_PARMS;
BEGIN
--the procedure THIRD will get the parameter values after
--extracting the values from l_PARMS by another function EXTRACT
THIRD(P_CUST in VARCHAR2,
P_PARMS_VALID out VARCHAR2,
P_OK_FOR_CUST out VARCHAR2,
return;                    
--Here the output of the above procedure will be concatinate and Return ;     
END CUST_CHECK;
FUNCTION FOURTH(P_PARMS in varchar2) return varchar2 is
l_parms varchar2(62) := P_PARMS;
BEGIN
--the procedure FIFTH will get the parameter values after
--extracting the values from l_PARMS by another function EXTRACT
FIFTH(P_CUST in VARCHAR2,
P_PARMS_VALID out VARCHAR2,
P_OK_FOR_CUST out VARCHAR2,
return;                    
--Here the output of the above procedure will be concatinate and Return ;     
END CUST_CHECK;
end PKG_CUST_CHECK; [ /code ]

Similar Messages

  • Passing function name into another function?

    Hi
    I have a movieclip prototype thats scales and moves any
    movieclips depending
    on the parameters passed in. I want to be able to pass in a
    function name
    that is executed when the main function has finished. The
    problem is the
    line of code that calls the main function executes the
    function name that I
    m trying to pass in as a parameter. Is there something I m
    missing?
    see my code below:
    "mcMainAnimation.moveFadeTransform(0, mcMainAnimation._y,
    -100,
    mcMainAnimation._xscale, -30, 50,moveToX());"
    MovieClip.prototype.moveFadeTransform = function(t, oldY,
    diffY, oldScale,
    newScale, tTime, funcToCall) {
    this.onEnterFrame = function() {
    t++;
    if (t<=tTime) {
    this._y = easeIn(t, oldY, diffY, tTime);
    this._xscale = easeIn(t, oldScale, newScale, tTime);
    this._yscale = easeIn(t, oldScale, newScale, tTime);
    } else {
    t = 0;
    funcToCall;
    this.onEnterFrame = null;
    moveToX = function () {
    trace("called");
    Thank in advance
    Shaun

    Hi!
    Try to modify code to:
    mcMainAnimation.moveFadeTransform(0, mcMainAnimation._y,
    -100,
    mcMainAnimation._xscale, -30, 50,moveToX);"
    ... so don't use () at end of function. That should do the
    trick.
    Also, you need to add the () to funcToCall, so that instead
    of:
    t = 0;
    funcToCall;
    this.onEnterFrame = null;
    you should have
    t = 0;
    funcToCall();
    this.onEnterFrame = null;
    /Jensen/
    "forums.macromedia.com" <[email protected]>
    wrote in message
    news:e6m428$qa0$[email protected]..
    > Hi
    >
    > I have a movieclip prototype thats scales and moves any
    movieclips
    > depending on the parameters passed in. I want to be able
    to pass in a
    > function name that is executed when the main function
    has finished. The
    > problem is the line of code that calls the main function
    executes the
    > function name that I m trying to pass in as a parameter.
    Is there
    > something I m missing?
    >
    > see my code below:
    >
    > "mcMainAnimation.moveFadeTransform(0,
    mcMainAnimation._y, -100,
    > mcMainAnimation._xscale, -30, 50,moveToX());"
    >
    > MovieClip.prototype.moveFadeTransform = function(t,
    oldY, diffY, oldScale,
    > newScale, tTime, funcToCall) {
    > this.onEnterFrame = function() {
    > t++;
    > if (t<=tTime) {
    > this._y = easeIn(t, oldY, diffY, tTime);
    > this._xscale = easeIn(t, oldScale, newScale, tTime);
    > this._yscale = easeIn(t, oldScale, newScale, tTime);
    > } else {
    > t = 0;
    > funcToCall;
    > this.onEnterFrame = null;
    > }
    > };
    > };
    >
    > moveToX = function () {
    > trace("called");
    > }
    >
    >
    > Thank in advance
    >
    > Shaun
    >

  • Passing multiple values to another page via a sql report

    Having trouble passing multiple values to another page via a popup SQL report
    I have two fields one called "descr" and another called "Met"
    when I use the code below all works fine and the value of "descr" is passed
    Select '&lt;a href="javascript:popUp2('''
    || 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
    || 'P950_TYPE:'
    || descr
    || ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%"&gt;'
    || descr
    || '&lt;/a&gt;' "Note"
    But when I want to pass another value, all goes bonkers and instead of the value of the field being passed the literal text is passed.
    can someone look at my code below and see what may be wrong
    Select '&lt;a href="javascript:popUp2('''
    || 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
    || 'P950_TYPE,P950_CODE:'
    || descr, Met
    || ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%"&gt;'
    || descr
    || '&lt;/a&gt;' "Note"
    I appeciate your help looking into this
    FYI (Here is the entire SQL for reference)
    With t
    as
    (SELECT
    CASE WHEN KEY = 2 then
    CASE WHEN WCS_CPT &gt; :P940_METRIC_1_WCS_CPT1 then
    '&lt;span style="color:Red; "&gt;'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'&lt;/span&gt;' else
    '&lt;span style="color:#399304; "&gt;'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'&lt;/span&gt;' end
    else '&lt;span style="color:#180c8b;"&gt;'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'&lt;/span&gt;' end "WCSCPT",
    CASE WHEN KEY = 2 then
    CASE WHEN WCS_TOI_PER_FTE &lt; :P940_METRIC_2_WCS_TOI_PER_FTE then
    '&lt;span style="color:Red; "&gt;'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' else
    '&lt;span style="color:#399304; "&gt;'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end
    else '&lt;span style="color:#180c8b;"&gt;'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end "WCSTOIPERFTE",
    CASE WHEN KEY = 2 then
    CASE WHEN WCS_SIO_PER_FTE &lt; :P940_METRIC_3_WCS_SIO_PER_FTE then
    '&lt;span style="color:Red; "&gt;'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' else
    '&lt;span style="color:#399304; "&gt;'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end
    else '&lt;span style="color:#180c8b;"&gt;'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end "WCSSIOPERFTE",
    CASE WHEN KEY = 2 then
    CASE WHEN WCS_TC_PER_FTE &lt; :P940_METRIC_4_WCS_TC_PER_FTE then
    '&lt;span style="color:Red; "&gt;'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' else
    '&lt;span style="color:#399304; "&gt;'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end
    else '&lt;span style="color:#180c8b;"&gt;'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end "WCSTCPERFTE",
    CASE WHEN KEY = 2 then
    CASE WHEN WCS_ADSL_PER_FTE &lt; :P940_METRIC_5_WCS_DSL_PER_FTE then
    '&lt;span style="color:Red; "&gt;'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' else
    '&lt;span style="color:#399304; "&gt;'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end
    else '&lt;span style="color:#180c8b;"&gt;'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'&lt;/span&gt;' end "WCSADSLPERFTE",
    CASE WHEN KEY = 2 THEN
    TO_CHAR(MONTH,'MON-YY')
    else
    'METRICS'
    end "MONTH"
    FROM (
    SELECT DISTINCT
    ROW_NUMBER() OVER (ORDER BY KEY DESC) AS ROW_NUM, KEY, WCS_CPT, WCS_TOI_PER_FTE, WCS_SIO_PER_FTE, WCS_TC_PER_FTE, WCS_ADSL_PER_FTE, MONTH
    from TW_M_KEYMETRICS
    WHERE TO_DATE(UPPER(MONTH),'DD/MON/YY') &gt;= TO_DATE(UPPER(:P940_START_OF_THIS_FIN_YEAR),'DD/MON/YY')
    ORDER BY KEY ASC, ROW_NUM, MONTH)
    WHERE ROW_NUM &lt;= :P940_MONTHS_SINCE_FIN_START)
    Select '&lt;a href="javascript:popUp2('''
    || 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
    || 'P950_METRIC_TYPE,P950_METRIC_VALUE:descr,MET'
    || ''
    || ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%"&gt;'
    || descr
    || '&lt;/a&gt;' "Note"
    , max(Met) METRICS, max(Jul) Jul08, max(Aug) Aug08, max(Sep) Sep08, max(Oct) Oct08, max(Nov) Nov08, max(Dec)Dec08, max(Jan) Jan08, max(Feb) Feb08, max(Mar) Mar08, max(Apr) Apr08, max(May) May08, max(Jun) Jun08
    from (
    Select 'Cost Per Transaction' descr,
    decode (MONTH, 'METRICS', WCSCPT) MET,
    decode (MONTH, 'JUL-08', WCSCPT) Jul,
    decode (MONTH, 'AUG-08', WCSCPT) Aug,
    decode (MONTH, 'SEP-08', WCSCPT) Sep,
    decode (MONTH, 'OCT-08', WCSCPT) Oct,
    decode (MONTH, 'NOV-08', WCSCPT) Nov,
    decode (MONTH, 'DEC-08', WCSCPT) Dec,
    decode (MONTH, 'JAN-08', WCSCPT) Jan,
    decode (MONTH, 'FEB-08', WCSCPT) Feb,
    decode (MONTH, 'MAR-08', WCSCPT) Mar,
    decode (MONTH, 'APR-08', WCSCPT) Apr,
    decode (MONTH, 'MAY-08', WCSCPT) May,
    decode (MONTH, 'JUN-08', WCSCPT) Jun
    from t
    union all
    Select 'Total Orders Issued Per FTE' descr,
    decode (MONTH, 'METRICS', WCSTOIPERFTE) MET,
    decode (MONTH, 'JUL-08', WCSTOIPERFTE) Jul,
    decode (MONTH, 'AUG-08', WCSTOIPERFTE) Aug,
    decode (MONTH, 'SEP-08', WCSTOIPERFTE) Sep,
    decode (MONTH, 'OCT-08', WCSTOIPERFTE) Oct,
    decode (MONTH, 'NOV-08', WCSTOIPERFTE) Nov,
    decode (MONTH, 'DEC-08', WCSTOIPERFTE) Dec,
    decode (MONTH, 'JAN-08', WCSTOIPERFTE) Jan,
    decode (MONTH, 'FEB-08', WCSTOIPERFTE) Feb,
    decode (MONTH, 'MAR-08', WCSTOIPERFTE) Mar,
    decode (MONTH, 'APR-08', WCSTOIPERFTE) Apr,
    decode (MONTH, 'MAY-08', WCSTOIPERFTE) May,
    decode (MONTH, 'JUN-08', WCSTOIPERFTE) Jun
    from t
    union all
    Select 'SIOs Per Billing FTE' descr,
    decode (MONTH, 'METRICS', WCSSIOPERFTE) MET,
    decode (MONTH, 'JUL-08', WCSSIOPERFTE) Jul,
    decode (MONTH, 'AUG-08', WCSSIOPERFTE) Aug,
    decode (MONTH, 'SEP-08', WCSSIOPERFTE) Sep,
    decode (MONTH, 'OCT-08', WCSSIOPERFTE) Oct,
    decode (MONTH, 'NOV-08', WCSSIOPERFTE) Nov,
    decode (MONTH, 'DEC-08', WCSSIOPERFTE) Dec,
    decode (MONTH, 'JAN-08', WCSSIOPERFTE) Jan,
    decode (MONTH, 'FEB-08', WCSSIOPERFTE) Feb,
    decode (MONTH, 'MAR-08', WCSSIOPERFTE) Mar,
    decode (MONTH, 'APR-08', WCSSIOPERFTE) Apr,
    decode (MONTH, 'MAY-08', WCSSIOPERFTE) May,
    decode (MONTH, 'JUN-08', WCSSIOPERFTE) Jun
    from t
    union all
    Select 'Total Calls Answered per FTE' descr,
    decode (MONTH, 'METRICS', WCSTCPERFTE) MET,
    decode (MONTH, 'JUL-08', WCSTCPERFTE) Jul,
    decode (MONTH, 'AUG-08', WCSTCPERFTE) Aug,
    decode (MONTH, 'SEP-08', WCSTCPERFTE) Sep,
    decode (MONTH, 'OCT-08', WCSTCPERFTE) Oct,
    decode (MONTH, 'NOV-08', WCSTCPERFTE) Nov,
    decode (MONTH, 'DEC-08', WCSTCPERFTE) Dec,
    decode (MONTH, 'JAN-08', WCSTCPERFTE) Jan,
    decode (MONTH, 'FEB-08', WCSTCPERFTE) Feb,
    decode (MONTH, 'MAR-08', WCSTCPERFTE) Mar,
    decode (MONTH, 'APR-08', WCSTCPERFTE) Apr,
    decode (MONTH, 'MAY-08', WCSTCPERFTE) May,
    decode (MONTH, 'JUN-08', WCSTCPERFTE) Jun
    from t
    union all
    Select 'ADSL Orders per FTE' descr,
    decode (MONTH, 'METRICS', WCSADSLPERFTE) MET,
    decode (MONTH, 'JUL-08', WCSADSLPERFTE) Jul,
    decode (MONTH, 'AUG-08', WCSADSLPERFTE) Aug,
    decode (MONTH, 'SEP-08', WCSADSLPERFTE) Sep,
    decode (MONTH, 'OCT-08', WCSADSLPERFTE) Oct,
    decode (MONTH, 'NOV-08', WCSADSLPERFTE) Nov,
    decode (MONTH, 'DEC-08', WCSADSLPERFTE) Dec,
    decode (MONTH, 'JAN-08', WCSADSLPERFTE) Jan,
    decode (MONTH, 'FEB-08', WCSADSLPERFTE) Feb,
    decode (MONTH, 'MAR-08', WCSADSLPERFTE) Mar,
    decode (MONTH, 'APR-08', WCSADSLPERFTE) Apr,
    decode (MONTH, 'MAY-08', WCSADSLPERFTE) May,
    decode (MONTH, 'JUN-08', WCSADSLPERFTE) Jun
    from t
    GROUP by descr
    Frank

    Borg Species 5618 wrote:
    Having trouble passing multiple values to another page via a popup SQL report
    But when I want to pass another value, all goes bonkers and instead of the value of the field being passed the literal text is passed.
    can someone look at my code below and see what may be wrong
    Select '&lt;a href="javascript:popUp2('''
    || 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
    || 'P950_TYPE,P950_CODE:'
    || descr, Met
    || ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%"&gt;'
    || descr
    || '&lt;/a&gt;' "Note"
    Hi Frank,
    You should close this parameters with single quotation. Try this -
    Select '&lt;a href="javascript:popUp2('''
    || 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
    || 'P950_TYPE,P950_CODE:'
    *|| 'descr, Met'*
    || ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%"&gt;'
    || descr
    || '&lt;/a&gt;' "Note"
    Hope this helps.
    Regards,
    M Tajuddin
    http://tajuddin.whitepagesbd.com

  • How i can pass the value into 1 line

    Hi expert,
    how do i pass all the value for sales document flow item in one line?
    i'm using this function
    CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
        EXPORTING
          aufbereitung  = '2'
          belegtyp      = i_del-vbtyp
          comwa         = l_comwa
          nachfolger    = ' '
          vorgaenger    = 'X'
          v_stufen      = '50'
        TABLES
          vbfa_tab      = lt_vbfa
        EXCEPTIONS
          no_vbfa       = 1
          no_vbuk_found = 2
          OTHERS        = 3.
    so now lt_vbfa already got data line by line....
    line 1 : contract : 00010 : 1000000 : 19,000.00
    line 2 : order     : 00010 : 2000000 : 10000.00
    line 3 : delivery : 00010 : 3000000 : 10000.00
    how i can pass the value into 1 line?
    for example :
    contract  | line     | amount     | Order     | line     | amount    | delivery   | line     | amount     |
    1000000 | 00010| 19,000.00 | 2000000 |00010 | 10000.00 | 3000000 | 00010 | 10000.00 |
    Edited by: anuar jusoh on Aug 17, 2009 4:02 AM

    Hi,
    What is requirement for passing the data in a single line ? Do you finally need to append the same in the internal table and pass it in the module ?
    You can create an internal table of type 1000 character and can loop the existing internal table. Then you can append the Work area in a single line and can finally append it to the table.
    DATA : ITAB type standard table of char1000.
    Loop at <existing table>.
    concatenate table work area wa_char100 into Itab_char_1000.
    endloop.
    APPEND itab_char_1000 into itab.
    Hope this helps.
    Thanks,
    Samantak.

  • How can I pass a value into a page fragment?

    How can I pass a value into a page fragment?
    I am implementing four search screens. And the only thing different about them will be their backing bean.
    So I’d like to do something like have four pages, each which retrieves its appropriate backing bean, sets that bean to a variable, and then includes a page fragment which contains the generic search page code (which will make use of that variable).
    The code in the four pages would be something like this:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:c="http://java.sun.com/jsp/jstl/core">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <c:set var="searchPageBackingBean"
    value="#{pageFlowScope.employeeSearchPageBean}"
    scope="page"/>
    <jsp:include page="./SearchPageBody.jsff"/>
    </jsp:root>
    At this point, what I’m seeing is that the fragment page, SearchPageBody.jsff, has no visibility of the searchPageBackingBean variable, either referencing it as #{pageFlowScope.searchPageBackingBean} or just #{searchPageBackingBean}

    The following will work, assuming you are needing to access a managed bean:
    Put this in the parent page:
    <c:set var="nameOfSearchPageBackingBean"
    value="employeeSearchPageBean"
    scope="request"/>
    Put this in the child, SearchPageBody.jsff:
    <c:set var="searchPageBean"
    value="#{pageFlowScope[nameOfSearchPageBackingBean]}"
    scope="page"/>

  • How to copy one column BLOB value into another column of another database.

    How to copy one column BLOB value into another column of another database.
    BLOB value contains word document.
    I thought of copy the BLOB value into a text file and then update the new column value by the same text in textfile. Will this work?
    Is there any other better way to do this?

    You're welcome
    BLOB fields contains binary data. I don't think you can do this
    Also if I view the BLOB as text. Can I copy it and insert into the new database.
    I think your options are as I said. Datapump or CTAS
    Best Regards

  • How to pass src value into img tag in ADF

    Hi,
    My Dev : 11.1.2.3.0
    How to pass row values into <img> tag.,I used the below code but it's taking empty.,
    I tried both ways like #{row.CdFilePath}   and   ${row.CdFilePath}
    <af:iterator var="row"
                      value="#{bindings.xxx.collectionModel}"
                     id="i2">
         <img src='/ShowImage?src=#{row.CdFilePath}' border='0' style="width:100px; height:100px; margin:5px;"/>
    </af:iterator>
    Please tell me any other option is there..
    Thanks

    This works if you use a normal table so I guess it should work here too.
    Are you sure the el #{row.CdFilePath} return something?
    Why don't you use the adf image tag <af:image source="/ShowImage?src=#{row.CdFilePath}".../> instead of the html img tag?
    Should the src property not be enclosed with " instead of your '?
    Timo

  • Pasteing a value into another cell

    I have a formula from another cell in another page. I want to insert only the value into another cell. Paste Special / Value is what I used to choose from Excel?

    In Numbers,
    Menu > Edit > Paste Values.
    Regards,
    Ian.

  • Putting calculated value into another application

    Hi,
    I have an HCM application with the following simple HRAccount dimension.
    ALL_HR_ACC
         |___SALARY
         |___BONUS
         |___OT
    I want to put the value of ALL_HR_ACC into TstAccount.HRExp, which is in another application called TstFinance. This can be perfectly done by the following code.
    *DESTINATION_APP=TstFinance
    *SKIPDIM=Employee
    *RENAME_DIM HRAccount=TstAccount
    *WHEN HRAccount
       *IS SALARY,BONUS,OT
           *REC(FACTOR=1,HRAccount="HRExp")
    *ENDWHEN
    However, if I change the IS statement to the following, nothing will happen.
       *IS ALL_HR_ACC
    In this simple example, I don't mind putting all 3 HR accounts SALARY,BONUS,OT. However, in many situations, SALARY and other HR accounts are derived from other accounts as well. It could be very cumbersome to put the whole bunch of calculation into the script for just transferring the single value of ALL_HR_ACC into another application.
    Anyone could give me any advice on this? Somebody told me using EVGTS could easily do the trick. However, such functions or formulas will disappear when I expand the worksheet.
    Thank you!
    Sunny

    Sunny,
    The script behavior is correct.  Script logic basically only works with the base memebrs, unless you utilize the statement called Calc Dummy Org.  This statement acts like a variable and aggregates the values into a "parent" type value to be passed on or used in a REC statement.  But, the process you used for the purpose you have is the best, fastest method, even if it is a scope of 50 base accounts from a select statement.
    As for using an input template or excel; if you have an evdre expansion input template, and wish to send the values to a different cube, just add another EVDRE, but remove all the expansions.  Make the page key range fixed or based on the other EVDRE statement.  Use excel to relate to the account to be sent  to the parent account. It should be quite simple to send the total values to a summary cube from the same template that is used for the input process.  However, the logic you wrote accomplished the same effect.
    Hope this helps.

  • Passing a table into a procedure to be used in a curor

    Hi,
    I'm using Oracle 9.2.0.6
    I have a procedure that searches all objects for a passed in string value. The procedure is below.
    CREATE OR REPLACE PROCEDURE Find_String (
    pin_referenced_name IN dba_dependencies.referenced_name%TYPE)
    IS
    cursor cur_get_dependancy
    is
    SELECT distinct owner, name, type
      FROM [email protected]
    WHERE lower(referenced_name) = lower(pin_referenced_name) --'ftbv_salesrep_all_1d'
       AND referenced_type != 'SYNONYM'
    order by name;
    v_owner  varchar2(40);
    v_name   varchar2(50);
    v_type   varchar2(40);
        BEGIN
           dbms_output.put_line(upper(pin_referenced_name)||' is found in the following objects.');
           dbms_output.put_line(' ');
           dbms_output.put_line(RPAD('OWNER', 30, ' ')||RPAD('NAME', 60, ' ')||RPAD('OBJECT TYPE', 30, ' '));
           dbms_output.put_line('-------------------------------------------------------------------------------------------------------------------');
            FOR i IN cur_get_dependancy
            LOOP
                v_owner := RPAD(i.owner, 30, ' ');
                v_name  := RPAD(i.name, 45, ' ');
                v_type  := RPAD(i.type, 30, ' ');
                dbms_output.put_line(v_owner ||v_name|| v_type);
            END LOOP;
    END find_string;I was wondering if there's any way I could pass in the table name, and the name of the DB link to be used in the cursor, into the procedure and rig the cursor to be able to accept that as a parameter. I want our users to be able to search different databases using this utility code.
    I thought of NDS, and that would be a way to do it, however I'm not sure if I could use an NDS statement in conjunction with a cursor.
    Does anybody have any suggestions?
    Thanks

    One approach (there are obviously many ways to skin this particular cat)
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    c1           sys_refcursor;
      3    l_val        number;
      4    l_table_name varchar2(30) := 'dual';
      5  begin
      6    open c1 for 'select 1 from ' || l_table_name;
      7    loop
      8      fetch c1 into l_val;
      9      exit when c1%notfound;
    10      dbms_output.put_line( l_val );
    11    end loop;
    12    close c1;
    13* end;
    SQL> /
    1
    PL/SQL procedure successfully completed.Justin

  • Passing request value into a query

    Hi,
    I was wondering whether it was possible to pass a request value into a report query in apex 3.2.
    I have a button with a submit value of "ALL" which when pressed i need to open up all the contents of a query as opposed to on those that have been completed.
    SELECT *
    FROM TABLE
    WHERE (STATUS = 'COMPLETE' OR :REQUEST = 'ALL')
    I was expecting this to return only completed records, unless the Button is pressed and then I want to return all records regardless of status.
    Can someone please advise whether this will work? At present it does not seem to recognise the request.
    Cheers,
    ca84

    query could not be parsed: select "ASCIDD" "ASCIDD", "TEMIDD1" "TEMIDD1", "NAME" "NAME", "LSTIDD1" "LSTIDD1", "ASCORDOPT"
    "ASCORDOPT", "ASCORD" "ASCORD", "TEMIDD2" "TEMIDD2", "TEMDES_COUNT" "TEMDES_COUNT" from ( /* Formatted on 2010/12/06
    15:23 (Formatter Plus v4.8.8) */ SELECT ascidd, temidd1, (SELECT temdes FROM lsttem WHERE temtyp = 'D' AND lsttem.temidd =
    temidd1) NAME, lstidd1, ascordopt,ascord,TEMIDD1 TEMIDD2, CASE (:REQUEST) WHEN 'COUNT' THEN
    LSTTEM_PKG_1.CountRecords(TEMIDD1) ELSE 0 END "TEMDES_COUNT" FROM lsttemasc WHERE lstidd1 = :p355_lstidd and exists
    (select 'y' from lsttem where bizidd1 = :P355_BIZIDD1 and lsttem.TEMIDD = lsttemasc.TEMIDD1) order by ascord;) apex$_rpt_src
    failed to parse SQL query: ORA-00911: invalid characterThe ";" looks very suspicious...
    And please:
    <li>Update your forum profile with a better handle than "user13453962"
    <li> DON'T post unrelated questions as follow-ups to existing threads. This issue is not connected to the OP.

  • How can I pass the value to another frame?

    Hi all,
    The following is part of my coding of a frame. Once i click on the jButton2, the selected value will be stored into a variable named NAME and the value will be displayed by a label in same frame. At the same time, a new frame named TESTING3 will be set to visible.
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
    // TODO add your handling code here:
        String name = (String)jList1.getSelectedValue();
        jLabel1.setText(name);       //display the value in a label in same frame
        new testing3().setVisible(true);     //a new frame set to visible
    }      Question: How can I pass the value to TESTING3 frame and display it on that frame?
    Thanks,
    ning.

    just make an archive that save that variable and them get them from de clase were you save it
    public class sav {
    String n;
    public sav {
    n="";
    public void addn(String x){
    n=x;
    public String shown(){
    return n;
    and them save it from the frame
    sav sun = new sav();
    sav.addn(f);
    them call it from the other frame
    sav sin = new sav();
    String s = sin.shown();
    label.setText(s);
    and i think thats you want to do if its not please explain me better
    bye

  • Passing JSP value into an SQL Query

    Hi,
    I am developing a site for a cruise ship company as part of a project. My problem is as follows . . .
    I have a page called cruiseReservation.jsp which passes the value of the selected cabin to the cruiseDetails.jsp page:
    href="CruiseDetails.jsp?cabin_id=cabinE105 " so . .
    cabinE105 was selected.
    my database table for the cabin is as follows:
    create table cabin (
    cruise_id number primary key,
    cabinE105 number,
    cabinD113 number,
    cabinC131 number,
    cabinB127 number,
    cabinA101 number,
    FOREIGN KEY(cruise_id)
    REFERENCES cruisedetails(cruise_id)
    In the cruise details page im running the following code to update the cabin tables cabinE105 value to 0:
    String cabin = request.getParameter("cabin_id");
    String setCabin = "update cabin set '"+cabin+'" = 0 where cruise_id = 1";
    What im trying to do is pass the value of the cabin into the update statement so it updates cabinE105 = 0 where cruise_id = 1.
    How do I dfo this as the above method is not working ??
    I would like any help on this PLEASE !!! THANKS !

    String cabinID = request.getParameter("cabin_id");
    PreparedStatement ps=connection.prepareStatement("update cabin set "+cabinID+"=? where cruise_id=?");
    ps.setInt(1,0);
    ps.setInt(2,0);
    ps.executeUpdate();
    .Regards
    -John-

  • Passing column values to another tab if check box selected in that row

    Hi
    I have the following requirement.
    I have a table that gets populated by a web service. Have added one more field to it which is a check box. Th requirement is that I need to pass the values of column (say id) from each row which has it's check box selected, as input parameters to a web service in another tab.
    example: table has fileds id, name, address,checkbox. If there are 5 rows and the user select 1 and 2 then I need the ids of 1 and 2 to be passed to another tab.
    Is this possible  ........
    Thanks

    Hi
    I just don't want to make multiple selection but pass the values of a column from the selected rows to another tab to be used as input parameters to a web service.
    I want to know how to pass the values(of one filed) of the selected rows across tabs/switches.
    Thanks

  • Pass parameter values for stored procedure in URL, possible?

    Hi, everyone, Our system is Apex4.0.2 in Linux CentOS 5 on Oracle 11GR2, here is the procedure:
    create or replace  procedure  test_public(Cust_id integer)
    is
    begin
    owa_util.mime_header( 'text/xml', FALSE );
    owa_util.mime_header( 'application/octet', FALSE );
    -- Close the HTTP Header
    owa_util.http_header_close;
    htp.p(DBMS_XMLGEN.getXML('SELECT * FROM demo_orders where customer_id='|| cust_ID));
    end;
    +/+
    the call to the stored procedure is SUCCESSFUL when Test_public has no parameters, like:
    http://myserver/apex/myschema.test_public (OK)
    the question is : I want to pass 3 parameters into my stored procedure(on production procedure), just don't know How?
    Any suggestions are greatly appreciated

    Thanks, Vee, definitely working, I do appreciate your help.
    I have to use Stored Procedure in Apex: my goal is to setup RESTful web service for IOS and Andriod alike, but APEX RESTful only supports SQL Report ( the RESTFUL check Box goes away with PL/SQL returning Query report, much to my surprise), I need expose some data and the same time I need insert/update some data when the client consumes our data, a PL/SQL based Report will do, but as I found out only simple SQL report has RESTful service, a Before REGION Process will do too, but web service connection WON'T fire that process (normal page display will fire the process) so I'm out of option.... Man I wish APEX REST is not so so basic....

Maybe you are looking for