Calling a function in apex region

Hi
I want to call a function from a package into Apex report region , but it wont the parse
i tested in sql dev successfully
sample code goes like this ..
SELECT DISTINCT SOR_OFFENDER.FIRST_NAME ||' ' ||
SOR_OFFENDER.MIDDLE_NAME || ' ' ||
SOR_OFFENDER.LAST_NAME as "Name",
SOR_OFFENDER_DETAILS.get_offlu_url(:p216_detail) ---package where function is define
FROM SOR_OFFENDER,
SOR_LOCATION
WHERE SOR_OFFENDER.OFFENDER_ID = SOR_LOCATION.OFFENDER_ID
AND :p216_detail = SOR_LOCATION.OFFENDER_ID
any idea /help
Edited by: Red_Bull on Aug 8, 2012 3:02 PM

Tony
I have to use this function to link other page or portal , using different parameter on different reports.
CREATE OR REPLACE FUNCTION
get_offlu_url (p_offender_id IN NUMBER) return VARCHAR2
     as
    temp_url_string varchar2(300);
    final_url_string varchar2(300);
    v_doc_num off_profile.doc_num%type;
    v_booking_id off_profile.offender_book_id%type;
    begin
       select http||server||port||dad||start_page into temp_url_string
        from offlu_url;
       select doc_num, offender_book_id into v_doc_num, v_booking_id
         from off_profile
         where offender_id = p_offender_id;
       final_url_string := temp_url_string||'doc_num='||v_doc_num||'&abc='||v_booking_id;
       return final_url_string;
    exception
       when too_many_rows then
           v_doc_num := 0;
           v_booking_id := 0;
    END get_offlu_url;

Similar Messages

  • Call Javascript function to pass a id  from APEX report column link

    Hi,
    Can anyone help me, in a report column link i'm calling a function to pass an id and i want to onclick change a icon on that column based on the value on the column status of this table.
    Is this possible?

    Hi Ron,
    I am doing exaclty what you have suggested me but no luck. I started changing the DEMO_CUSTOMERS application to my requirements.The report is working fine and on the report I have created a page attribute to the Hyper linked column and linked that to the page 2 and assign that attribute with #JOBNUM#.
    I am able to pass that value on to form when I click on the JOBNUM. But the problem is I am not able to pass that value into the SQL query so that my query pulls 20+ columns on to the Form ( which is second page ).
    Small clarification... On the form region it is said FORM NAME and type is HTML is that is the way the APEX was designed or does it need to say region type as FORM.
    Thanks for your help in advance.
    Cheers,
    Krishna.

  • Using htp.p for print dynamic data in apex region make my page slow?

    Hi, everyone!!! My name is Rafael, and...
    I search in the web and in this forum but i can´t find a answer for my doubt.
    Using the procedure htp.p for print dynamic data in apex region through on demand process , this will leave my webpage slow to load when the user access?
    Example:
    For build a menu in my webpage, it´s read a function in the database that returns variable string, so by a demand process this string is obtain and print in a web page using htp.p.
    I notice that this practice causes slow to load the data on the page.
    This is it...
    If someone help me, thanks...
    bye and Happy new Year!!!
    Edited by: user9518141 on 26/12/2009 17:19

    Hi,
    Try commenting out the function call and print some sample text in the htp.p like htp.p('Hello world..');
    I think the function call is probably taking a lot of time .. not htp.p.
    I have used htp.p to print out values dynamically in a lot of situations and have not ever come across any performance issues.It could be a problem with the function you are calling.
    Thanks,
    Rajesh.

  • Error while calling the function which returns SQL Query!!!

    Hi,
    I have a Function which returns SQL query. I am calling this function in my APEX report region source.
    The query is dynamic SQL and its size varies based on the dynamic "where clause" condition.
    But I am not able to execute this function.It gives me the following error in APEX region source.
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Even in SQL* Plus or SQL developer also same error .
    The length of my query is more than 4000. I tried changing the variable size which holds my query in the function.
    Earlier it was
    l_query varchar2(4000)
    Now I changed to
    l_query varchar2(32767).
    Still it is throwing the same error.
    Can anybody help me to resolve this.???
    Thanks
    Alaka

    Hi Varad,
    I am already using 32k of varchar2. Then also it is not working.
    It is giving the same error. I think there is something to do with buffer size.
    My query size is not more than 4200. Even if i give 32k of varchar2 also buffer is able to hold only 3997 size of the query only.
    Error is
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Tried CLOB also. It is not working.
    Any other solution for this.
    Thanks
    Alaka

  • Call javascript function after submit process

    Hi,
    How can I call javascript function after my submit process ?
    Thanks.

    Hi Carl,
    You say that I must have an Item or region that contains my js with conditionnal display. With this method I can execute my js with specific request value.
    My problem is that I tried to integrate the "save large value workaround" in my application with the APEX wysiwyg (fckeditor). To do that I have to call the javascript function clob_submit on the save button. This function save the value of my field but if I want to save other item value, how can I do that ?
    If I use your method, I will submit the page, save the other field and after that, I will branch on the same page. At this moment, I will execute my javascript file.
    Is it what did you said ?
    Sylvain Michaud
    Homepage : http://www.insum.ca
    InSum Solutions' blog : http://insum-apex.blogspot.com

  • Calling a function in the select part of a query

    I am integrating Apex with E-Bus Suite 11.5.10.2.
    I have a function in a sql query. The function calls an apps view. When i run the sql query in TOAD, I get the correct data. When I run it in Apex, i get an error - it says "Invalid number"
    My apex report is registered in my 11i menu. Who is the user that is running this report? Is it apps?
    thanks

    When you run it in TOAD, you are passing through a value, correct? Maybe when your EBS call to your APEX report is done, it is passing through a character value as apposed to a number. You might want to convert your passed in value in your function to a number to be sure..
    Also, it is not always the best idea to call a function in a select statement.. Is there a reason you can't do in sql what your function is doing?
    Thank you,
    Tony Miller
    Webster, TX

  • Calling JS function in pl/sql process

    Hello!
    I have a js function defined in 'HTML Header' :
    <script language="JavaScript" type="text/javascript">
    function disp_alert()
    alert("Data is invalid! Correct the data and click CONFIRM again.")
    </script>
    I also have a pl/sql process on this page. I want to call disp_alert function in a following way:
    if ... then call function
    else dbms_output.put_line('...');
    end if;
    How can I call this js function in 'if'??
    Tom

    There ARE ways to accomplish something like this, but they're much more complex.
    You must create a JavaScript that uses APEX's built in AJAX components; a form button will call the JavaScript, which will in turn call a PL/SQL procedure saved as an "On Demance Shared Application Process." This procedure can run any checks you like against the DB, and return data to the Javascript to display in an alert.
    You can see an example of this in use at an APEX page I created: http://htmldb.oracle.com/pls/otn/f?p=19864:5
    This isn't the same thing, but is accomplishing what it does through an APEX form, a javascript call on the text field to a PL/SQL Process that returns rows from the database dynamically...thus allowing the client side JavaScript to call server side PL/SQL.

  • How to call javascript function from PL/SQL procedure

    Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?

    Hi,
    I have a requirement to call Javascript function inside a After Submit Process.
    clear requirement below:
    1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
    2. user clicks on "save files" button
    3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
    Hope this clarify U.
    Krishna.

  • Calling javascript function

    Hi,
    I have a javascript function which i want to call when item P6_PID is null.
    When i try calling it using the below code its not running
    I have added alert box to check the code... When P6_PID is null i'm not getting the alert box but when it is not null i'm getting the alert message..
    The below code is written in REGION FOOTER which is calling hideButton() function.
    The Function HideButton is in PAGE HEADER.
    <script>
    alert(&P6_PID.).length)
    if( (('' + &P6_PID.).length) == 0)
    hideButton('addNotes' , 'editNotes' , 'addNextStep' , 'editNextStep', 'addChallenges' , 'editChallenges' , 'addPersonalNotes' ,'editPersonalNotes') ;
    </script>
    I don't understand why the above code is not running when P6_PID is null.
    Please help...

    I have added alert box to check the code... When P6_PID is null i'm not getting the alert box but when it is not null i'm getting the alert message..
    The below code is written in REGION FOOTER which is calling hideButton() function.
    The Function HideButton is in PAGE HEADER.
    <script>
    alert(&P6_PID.).length)<b>Try this to check if length is zero: </b>
    <script language = "javascript">
    var mylength =  ($x('P6_ID').toString()).length;
    alert(mylength);
    </script>But, why do u need to check the length = 0? You can simply check if value is null by using:
    <script language = "javascript">
    if(($x('P6_ID').value=="")
    alert('Value is null');
    </script>

  • Call Java program in APEX

    Hi, I am an APEX newbie... I need to call a Java program (.JAR file) from a PL/SQL script inside an APEX application. My question is, does the JAR file need to be in a particular place (and if so, what's the best way to get it there)?
    - somewhere in the APEX database?
    - somewhere in the production database (9i)?
    - could it be called if it resides on a shared network drive?
    Any help would be appreciated... everything I've found thus far tells me to use the loadjava tool to get it onto the prod. database, but I want to make sure that there isn't an easier option as I've had some trouble with that.
    Thanks in advance...
    Kenny

    Hi,
    If you want to call the method of the java class that is stored in the jar you have to make this jar file accessible to the client.
    1/ The jar file can be stored in the database by using loadjava utility
    E.g. loadjava -u scott/tiger -resolve yourjavapackage.jar
    More details on http://www.oracleutilities.com/OSUtil/loadjava.html
    and http://www.csee.umbc.edu/help/oracle8/java.815/a64683/tools1.htm
    1.1/ Once the jar file is in the database you can access it's object methods by defining the pl/sql function that is able to call particular java method
    E.g.
    FUNCTION jCreateDir (dir varchar2, checkExistsOnly number, grantRootDir varchar2)
    RETURN NUMBER as LANGUAGE java
    NAME 'mypkg.Utils.createDirectory(java.lang.String, int, java.lang.String) return int';
    Above function then calls the java method defined in the class included in the jar file (jar file is just an archive of the java classes - to bundle several classes, images... in one file)
    The example contents of the java class
    package mypkg;
    import java.io.File;
    public class Utils {
    public static int createDirectory(String dir, int checkExistsOnly, String grantScriptDir)
    ///some code here
    1.3/ So if you know what method to call, what are the input parameters and return value you can create your calling procedure/function in pl/sql
    I am not very sure if you can load jar files containing the classes that render some user interface items(buttons,panels etc - items from awt or swing package) so basicaly load just the code that performs actions like computation/ xml transformation/ file I/O so anything that does not require GUI items.
    2/ If your jar file contains the objects that display some user interface control or you need to call the java from the javascript then you need to embed your jar file in the html code by using <OBJECT > or <APPLET> tag
    Re: Open program in FF
    Rado

  • ODI Error - Calling a function in the source database

    I am using this directly in the Interface mapping and getting the following error
    This is the syntax I am using SUM(CASE WHEN ((main.getCertDate(person_id,getdate()) >= current_timestamp) THEN 1 ELSE 0 END)
    ODI-1228: Task Load_Fact_Table1 (Integration) fails on the target MICROSOFT_SQL_SERVER connection SQLSERVER_USA.
    Caused By: java.sql.SQLException: [FMWGEN][SQLServer JDBC Driver][SQLServer]Cannot find either column "main" or the user-defined function or aggregate "main.dbo.getCertDate", or the name is ambiguous.
    Am I missing any additional steps, before calling a function in the mapping. Do I have to do something in the model to include teh function etc., Please help in fixing this issue.
    Thanks for your time and help.

    Hi Michael, Please see below.
    IKM - MSSQL Incremental Update
    Failing on Step 3 - Integration - Insert flow into I$ table
    insert into db11.dbo.##I$_FCT_TABLE
    COMP_ID,
    CNT_CLP_TARGET_MET,
    CNT_CERTIFIED,
    CNT_NOTCERT_WITHIN_GRACE_PRD,
    CNT_CERT_OR_WITHIN_GRACE_PRD,
    CNT_CERT_DELINQUENT,
    SUM_OF_AGE,
    SUM_OF_YEARS_EXPERIENCE,
    LOAD_DATE,
    IND_UPDATE
    select
    CASE WHEN DIM_COMP.COMP_ID IS null then -9999
    ELSE DIM_COMP.COMP_ID
    END,
    SUM(CASE WHEN ((main.dbo.getCertDate ([DISTINCT_RWF.MASTERKEY],GETDATE()) >= CURRENT_TIMESTAMP) OR DISTINCT_RWF = 'NO') THEN 1 ELSE 0 END),
    CURRENT_TIMESTAMP,
    'I' IND_UPDATE
    from ((
    select DISTINCT
    REPORT_WORKFORCE_REVIEW.REGION as REGION, REPORT_WORKFORCE_REVIEW.COMPO as COMPO, REPORT_WORKFORCE_REVIEW.PERSON_ID as PERSON_ID, REPORT_WORKFORCE_REVIEW.WF_STATUS as WF_STATUS, REPORT_WORKFORCE_REVIEW.PERSON_NAME as PERSON_NAME, REPORT_WORKFORCE_REVIEW.CPCN_NUM as CPCN_NUM, REPORT_WORKFORCE_REVIEW.COMMAND as COMMAND, REPORT_WORKFORCE_REVIEW.UIC as UIC, REPORT_WORKFORCE_REVIEW.UIC_STATE as UIC_STATE, REPORT_WORKFORCE_REVIEW.ORG_STRUCTURE_CODE as ORG_STRUCTURE_CODE, REPORT_WORKFORCE_REVIEW.ORG_DESC as ORG_DESC, REPORT_WORKFORCE_REVIEW.LOCATION as LOCATION, REPORT_WORKFORCE_REVIEW.STATE as STATE, REPORT_WORKFORCE_REVIEW.SVC_COMP_DATE as SVC_COMP_DATE, REPORT_WORKFORCE_REVIEW.YRS_OF_SERVICE as YRS_OF_SERVICE, REPORT_WORKFORCE_REVIEW.POSITION_ENTER_DATE as POSITION_ENTER_DATE, REPORT_WORKFORCE_REVIEW.MTHS_EXP_IN_PRESENT_POS as MTHS_EXP_IN_PRESENT_POS, REPORT_WORKFORCE_REVIEW.MTHS_EXP_IN_CURRENT_APC_ACL as MTHS_EXP_IN_CURRENT_APC_ACL, REPORT_WORKFORCE_REVIEW.AGE as AGE, REPORT_WORKFORCE_REVIEW.SEX as SEX, REPORT_WORKFORCE_REVIEW.SUPV_CODE as SUPV_CODE, REPORT_WORKFORCE_REVIEW.ACF as ACF, REPORT_WORKFORCE_REVIEW.CP as CP, REPORT_WORKFORCE_REVIEW.SERIES as SERIES, REPORT_WORKFORCE_REVIEW.DUTY_TITLE as DUTY_TITLE, REPORT_WORKFORCE_REVIEW.APT as APT, REPORT_WORKFORCE_REVIEW.APT_DESC as APT_DESC, REPORT_WORKFORCE_REVIEW.API as API, REPORT_WORKFORCE_REVIEW.SAA as SAA, REPORT_WORKFORCE_REVIEW.GRADE as GRADE, REPORT_WORKFORCE_REVIEW.HI_DEGREE as HI_DEGREE, REPORT_WORKFORCE_REVIEW.LVL_DESC as LVL_DESC, REPORT_WORKFORCE_REVIEW.APC as APC, REPORT_WORKFORCE_REVIEW.ACL as ACL, REPORT_WORKFORCE_REVIEW.CERT_LVL_ACHIEVED_IN_APC as CERT_LVL_ACHIEVED_IN_APC, REPORT_WORKFORCE_REVIEW.CERT_IN_POSITION as CERT_IN_POSITION, REPORT_WORKFORCE_REVIEW.CERT_BELOW_POSITION as CERT_BELOW_POSITION, REPORT_WORKFORCE_REVIEW.NOT_CERTIFIED as NOT_CERTIFIED, REPORT_WORKFORCE_REVIEW.CLP as CLP, REPORT_WORKFORCE_REVIEW.LAST_IDP_UPDATE as LAST_IDP_UPDATE, REPORT_WORKFORCE_REVIEW.LAST_IDP_UPDATE_MTHS as LAST_IDP_UPDATE_MTHS, REPORT_WORKFORCE_REVIEW.SUPV_REVIEW_DATE as SUPV_REVIEW_DATE, REPORT_WORKFORCE_REVIEW.SUPV_REVIEW_DATE_MTHS as SUPV_REVIEW_DATE_MTHS, REPORT_WORKFORCE_REVIEW.EMAIL as EMAIL, REPORT_WORKFORCE_REVIEW.MASTERKEY as MASTERKEY
    from main.dbo.REPORT_WORKFORCE_REVIEW as REPORT_WORKFORCE_REVIEW
    where (1=1)
    ) as DISTINCT_REPORT_WORKFORCE_REVIEW LEFT JOIN main.dbo.PERSON as PERSON ON DISTINCT_REPORT_WORKFORCE_REVIEW.MASTERKEY=PERSON.MASTERKEY) LEFT JOIN main.dbo.ACQUISITION_CORPS_QUALIFICATION as ACQUISITION_CORPS_QUALIFICATION ON DISTINCT_REPORT_WORKFORCE_REVIEW.MASTERKEY=ACQUISITION_CORPS_QUALIFICATION.MASTERKEY) LEFT JOIN main.dbo.PERSONS_POSITIONS as PERSONS_POSITIONS ON DISTINCT_REPORT_WORKFORCE_REVIEW.PERSON_ID=PERSONS_POSITIONS.MASTERKEY
    AND PERSONS_POSITIONS.POSITION_END_DATE IS NULL) INNER JOIN db11.dbo.DIM_COMP as DIM_COMP ON DISTINCT_REPORT_WORKFORCE_REVIEW.COMPO=DIM_COMP.COMP_CODE AND DIM_COMP.CURRENT_RECORD_IND = 1) LEFT JOIN db11.dbo.DIM_POSITION_TYPE as DIM_POSITION_TYPE ON DISTINCT_REPORT_WORKFORCE_REVIEW.APT=DIM_POSITION_TYPE.POSITION_CODE
    AND DIM_POSITION_TYPE.CURRENT_RECORD_IND=1)

  • Calling a function in Pre-Authentication Process in Authentication Scheme

    Hello all,
    I want to call a function located somewhere inside apex (not in the database) from the Pre-Authentication Process in an Authentication Scheme.
    Is it possible?
    Regards Pedro.

    Pedro
    Possibly if you could unwrap the source of the package but basically you wouldn't want to mess with APEX's API.
    If this is your function then you want it somewhere in one of your own schemas (you won't potentially break APEX and you will retain it when you upgrade).
    If you wish, you could create your own authentication schema and only give yourself access to it (as well as execute to the applications parsing schema user). You could also just create it as in the application parsing schema
    CREATE OR REPLACE PACKAGE BODY xxxxxxx WRAPPED  This makes the source unreadable in the database. (remember to keep the original source yourself though!).
    Hope this helps
    Cheers
    Ben

  • Email function in apex

    Hi I am trying to use email notification built in function of apex(4.1.1) to so that it take the email address from the form entered by user and then send a 4 digit random number as and authentication to login /validate the email entered.
    i tried sending many emails since morning but none of them received as if now..
    any clue ?

    new new wrote:
    not working ,Why did you mark it as correct answer if you cannot get it to work??
    And the fact is that you cannot run the apex_mail API directly outside the APEX session, you need to set the context before calling it.
    APEX documentation
    begin
        l_workspace_id := apex_util.find_security_group_id (p_workspace => 'PROJECTS');
        apex_util.set_security_group_id (p_security_group_id => l_workspace_id);Finally did you ever know that there a thing called APEX documentation, if yes please search the documentation and the forum first

  • Regarding tutorial of how to call Oracle Reports from APEX

    Hi,
    I'm trying to call Oracle Reports from APEX using this tutorial.
    http://www.oracle.com/technology/products/database/application_express/howtos/howto_integrate_oracle_reports.html
    But in the step of 'Create the Oracle HTML DB Application', 'OE' doesn't appear in the LOV of Existing Schema, even though the sample schema exists in the schema and they are unlocked. And when I type 'OE' directly without using LOV, and press Next, the message 'Schema is reserved or restricted' appears.
    How can I create the workspace based on OE schema?

    Hello Shohei,
    I know your following the tutorial, but if you want to call oracle reports from apex it is quite easy though if your working with oracle reports 9i or higher. Just create an html region and put in the source the html code for referencing an url like to_report
    Or reference the same url from a button placed on the HTML region
    (you can create a package that would create the whole URL and returns it as a string, easier for scalability)
    Hope this can help you to (tutorial is good but try and learn from scratch is also good ;-) )
    Erwin

  • CNTL_ERROR while calling a function module from Java webdynpro

    I am calling a RFC function module from javawebdynpro app
    which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java webdynpro app, it raises a CNTL_ERROR exception and creates a short dump.
    Any help on this is highly appreciated

    Good catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
    Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
    DATA:
          SOURCEVAL TYPE  /BIC/OIINVQTY,
          SOURCEUOM TYPE  /BIC/OIUSUOM,
          USITM TYPE  /BIC/OIUSITM,
          TARGETUOM TYPE  /BIC/OIUSUOM,
          CONVERTED_COST TYPE  /BIC/OIINVQTY.
    DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
    " get the Production UOM
        SELECT SINGLE I~/BIC/USPRDUOM
          FROM /BIC/PUSITM AS I
          INTO PRODUCTION_UOM
          WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
        IF ( SY-SUBRC = 4 ). " no records found
          "RAISE PARTNO_NOT_FOUND.
          RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
        ENDIF.
    " load the parameters
        SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
        SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
        USITM = SOURCE_FIELDS-/BIC/USITM.
    " then you can call the FM
        CALL FUNCTION 'Z_CA_CONVERT_US_COST'
          EXPORTING
            PSOURCEVAL                = SOURCEVAL
            PSOURCEUOM                = SOURCEUOM
            PUSITM                    = USITM
            PTARGETUOM                = PRODUCTION_UOM
          IMPORTING
            PTARGETVAL                = CONVERTED_COST
          EXCEPTIONS
            CONVERSION_NOT_MAINTAINED = 1
            PARTNO_NOT_FOUND          = 2
            OTHERS                    = 3.
    " ... [do the rest]
    Thanks for your help,
    Dennis

Maybe you are looking for

  • How can I stop Firefox from crashing when I try to clear history?

    For the last few days I haven't been able to clear history for the day. I tell firefox to Clear for Today. I tell it to clear now but after a while nothing is happening. When I check with the task manager my Firefox windows have stopping responding.

  • Refresh two regions at a time

    Hi, Iam new to ADF Framework. Using JDeveloper 11.1.1.5.0. Following is the high level description of our requirement. I've JSF page with four regions localted at left,Center, Bottom & Right. Left region having three buttons. Based on button click, c

  • Selection with the Chart Legend ?

    Hi experts, I have a problem with a pie chart. This is a linked charts, a click on one of the slice determines the display in a table. The problem is that some slice are really tiny, and it is very difficult to click on it. Is there a way to make the

  • I've suddenly lost multiple apps (including settings, App Store, iTunes, camera, photos etc). How do I get them back?

    I've suddenly lost multiple apps (including settings, App Store, iTunes, camera, photos etc). How do I get them back?

  • Legend datatable error in the chart

    Hi there Currently I am working with WAD BI70 and I have a problem when I try to put the data table as a legend in the chart, It mark an error "No data table information received from the ISM," the fact is that It just happened to 3 views, the same r