APEX shortcuts using the source of the body of the PL/SQL function

Hi all

Recently, I came across the feature of "Shortcuts" in the "Shared components" section of the APEX and thought great, somewhere to set the common/standard items once, then use these several times in different pages of my application.

This seemed to work correctly when you use the 'Source' of "HTML Text" or "HTML text with special characters escaped", but then I wanted to explore the use of the "Body of the PL/SQL function" option to create a more dynamic shortcut/variable on the base.

This is where I came across a particular problem in the APEX (Version 3.2.1.00.10 on GR 11, 2 on Oracle Enterprise Linux). When I set my shortcut, and then perform a reference to my shortcut (using "MY_SHORTCUT") in an area of a page, the value of shortcut is back, but is added with the reference variable (ie. the 'MY_SHORTCUT' chain).

For simplicity, my example looks like this (of course, my real world example is a bit more complicated, but this example produces the same error):
(a) I define my shortcut called "MY_SHORTCUT" and using the body of the PL/SQL function under "Source Type", define my procedure as "htp.p(:USER)."
(b) I then create a new page (basic HTML page), and a new region of the 'type'-> 'HTML Text (with shortcuts).
(c) in the "Source region", I define my shortcut like - "MY_SHORTCUT".
(d) I apply changes and then run the page.

I'll be back will be name of the current user with "MY_SHORTCUT" appended/added immediately after the user name - for example. the string:-' BRAD «MY_SHORTCUT»»

Question is - how to stop the shortcut/reference text "MY_SHORTCUT" to be added to the variable you want to see the and thereafter on your page? I am just wanting the variable, NOT the reference for the shortcut.  I do something wrong using the HTP package, and if yes, what should I use?

If "MY_SHORTCUT" is defined as "HTML text with special characters escaped" (where I can refer to elements of application using the syntax '& USER.') so that everything works correctly. My reason for using the PL/SQL is to generate a more dynamic output variable, based on elements of application throughout the entire application - and of course the use of shortcuts to minimize coding and duplication.


Thanks in advance,
Brad

Hello

The body of the PL/SQL function must RETURN a value.

Try:

RETURN :APP_USER;

Andy

Tags: Database

Similar Questions

  • assign a value to a text element using the PL/SQL function body

    Hello

    I want to assign a value to a text element using PL/SQL function body option in the Source elements. But the below error when I try to apply it.

    Source code:

    declare
    name varchar2 (100);
    Start
    If v ("P3_CREHIDD") = 'Edit' then
    Select ename in the name of cpy_emp where empno = v('P3_EMPNO2');

    end if;
    end;


    ERR-1904 unable to calculate the default item: type = computation_type = function body declare name varchar2 (100); so start v ('P3_CREHIDD') = 'Edit' and then select ename in the name of cpy_emp where empno = v('P3_EMPNO2'); end if; end;.

    Thank you
    David.

    Hello

    Your body of the function doesn't return anything.
    Maybe it works

    declare
      l_name varchar2(100);
    begin
      if v('P3_CREHIDD') = 'Edit' then
        select ename
        into l_name
        from cpy_emp
        where empno = v('P3_EMPNO2');
      end if;
      RETURN l_name;
    end;
    

    BR, Jari

  • How to get GMT or IST using the PL/SQL FUNCTION

    Hello, I use Oracle 10 G database (operating system: Windows-32 or 64 Windows).
    How can I get the date and time GMT or International without mentioning SYSDATE / DBDATE.
    Real problem the DB Sever time is frequently manipulated by the end user and I would like to connect the actual date and time of the transaction in other audit tables.

    Kind regards

    Tarun

    It won't increase your load on the server, you would simply have many waiting http events and the performance of your application depends on your internet connection to customers. Something not very desirable if you ask me and certainly will cause you headaches. Really bad headaches, and one day someone will ask who came up with the brilliant idea to get the timestamp system via http instead of... + sysdate + (I smell a future article http://thedailywtf.com/).

    In any case; That is: the http based sysdate function. I use mod_plsql to my 'webservice' running on a server where I'm sure the date is correct. You can use what you want, for a 'real' webservice implementation will be a little different. Google should know the answer about calling Web services from the data base.

    $[CHE_TEST@asterix1_impl] create or replace procedure server_time as
      2  begin
      3  htp.print(to_char(sysdate, 'dd.mm.yyyy hh24:mi:ss'));
      4  end;
      5  /
    
    Procedure created.
    

    As you can see the procedure does nothing else then exit the sysdate from my database server in a specified date format. I then call the procedure mod_plsql via utl_http on another server:

    $[CHE_TEST@asterix2_al32utf8] create or replace function get_server_time return date is
      2  begin
      3    --default would be 60, this is clearly too much
      4    utl_http.set_transfer_timeout(1);
      5    return to_date(utl_http.request('http://ias4/asterix1_impl_cronet/server_time'), 'dd.mm.yyyy hh24:mi:ss');
      6  exception
      7    when utl_http.REQUEST_FAILED then
      8      return sysdate;
      9  end;
     10
     11  /
    
    Function created.
    

    Now get_server_time will give me the time of my first database server (unless the requested HTTP fails for any reason, then it'll be sysdate)

    $[CHE_TEST@asterix2_al32utf8] select get_server_time from dual;
    
    GET_SERVER_TIME
    -------------------
    24.07.2012 13:35:00
    

    Again, if you go in this way use the feature carefully and not at each end of your application as it will give you performance problems .

    see you soon

  • ToolTip for the report header classic of report column using the PL/SQL function

    Good afternoon

    I need to add tooltips to my report header, when a user points to the topic title column I need to display the full title.

    Theme 101, Apex 4.2, Oracle 11g

    code below:

    {code}

    DECLARE

    CLOBL V_HEADINGS

    vusr VARCHAR2 (5);

    V_ERR_MSG VARCHAR2 (15);

    BEGIN

    SELECT SME_C

    IN vusr

    OF SME_LU

    WHERE SUPERIOR (SME_LU. SME_USERID) = v ('APP_USER');

    V_HEADINGS: = ' ';

    SELECT 'UTC' |': ' |' UIC' | ' :'|| SUBSTR (HEADING1, 1, INSTR(HEADING1,'-',1)-1) |': ' | TITLE2 |': ' |' TITRE3 |': ' | CHAPTER 4: ': ' | ... AT HEADING25

    IN V_HEADING

    OF FORCE_GEN_UNIT_REPORT_HEADINGS

    WHERE FORCE_GEN_SME_CREATOR_C = vusr;

    RETURN V_HEADINGS;

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    V_ERR_MSG: = ' ';

    END;

    {code}

    The header will display like this 4.1 4.0 MCT MCT...

    The substr () /instr () in the first section, that's what I want to display.  I looked at other messages and I am confused on how to do it.  Any help is greatly appreciated.

    Thank you

    Mary

    It's the great Mary.

    Please report the thread as "Correctly answered" so that others can benefit from this information.

    Thank you

    -Jorge

  • URG: How can I force APEX to use the specific schema: spaces of work APEX_040100 or entitled to another schema?

    Hi all

    Here's the scenario:

    1. My computer crashed. were to return to complete export (expdp 11.2.x to impdp 12 c). successfully done.
    2. Configured ADR blah blah... can access the admin of the apex.
    3. Problem is: administration interface does not SEE my workspaces apex Apex (only the workspace IN-HOUSE).
    4. After investigation it seems that APEX (after the upgrade) is somehow configured / run with: schema APEX_040200 and not

    APEX_040100 (as I have improved Apex in the old database versions).


    5. If I'm running the following:

    ALTER session set current_schema = APEX_040100;

    Select short_name, display_name

    of wwv_flow_companies

    where source_identifier is not null;


    I SEE all my beloved workspaces.

    6 my questions:

    a. How can I force APEX to use the specific schema: APEX_040100 instead of APEX_040200?

    b. or are there other alternatives to assign these workspaces in the current environment?


    Concerning

    Etay G

    Hello Brad,

    Thank you for your response. Appreciated.

    • Yet, as I had a little corrupted environment Apex after import (impdp), COMPREHENSIVE database this method of revocation (above) has failed several times to me.
    • Here's what I have (solves the problem):
    • Deleted APEX_040200 Apex 4.2 installation().
    • Text left in DB is the only APEX_040100
    • Then, the version 5.0.3 and it worked!

    More importantly, after the installation of APEX, all workspaces, users, etc. are automatically correctly resided in APEX.
    • I think that if you have only 1 version of apex corrupted in DB. It should work as well. Remove again, schema using the above script (check version) with caution (after backup, etc.).

    Kind regards

    Etay G

  • XMLFile parameter is not supported by Oracle APEX, please use the setXMLFile() method

    "XMLFile parameter is not supported by Oracle APEX, please use the setXMLFile() method.

    I created a test web app in apex.oracle.com to try a few things. I created a Flash 2D pie chart in a Web page, and it seems to make very well. But before rendering, I get the error message above, on the region of graph for 1-2 seconds.

    Can anynone tell me what means the error message above and why I'm getting this. I do not use a custom XML part. Has not changed the default settings of the chart area.

    I could see above the error appearing clearly since the apex.oralce.com is so slow... and graphics region takes awhile to load. Otherwise I could not have noticed. It happens in the IE8 and Google chrome.

    Oralce Apex 4.2.5.00.006 (https://apex.oracle.com)

    Google Chrome 34.0.01847.116

    Internet Explorer 8.0.6001.19518

    Can anyone help please. I'll try to become a test application setup dispalying this awhile earlier error message.

    I used HTML5 graphics in apex 4.2.0.00.27 in my office in my real application workspace. Most of my users still use IE8. HTML5 graphics all appeared well in their IE8 browser. One fine day, some parameters must be changed by my network administrator or soemthing else could have happened. I have no idea. My webapplication HTML5 graphics disappear IE8 users. IE9 users had no problem. I contacted our IT support staff of any changes to security settings that day, or earlier. Absolutely no help from my frustration. I have to change maps of my application (only about 6 of them) to the Flash graphics to overcome this obstacle. This is the story behind why I use Flash cards. If anyone has experienced a similar problem in IE8 HTML5 graphics please shed any light for me... This problem may be nothing to do with the "XMLFile parameter error message', but I'm not sure.

    You strike again BUG introduced with Oracle Application Express 4.2.5

    http://www.Oracle.com/technetwork/developer-tools/Apex/application-express/Apex-425-known-issues-2186292.html

    18601802 - ANYCHART XMLFILE WARNING DISPLAYED BEFORE FLASH GRAPHICS RENDERING when Flash graphics that take a long time to make, the user can see the following warning message appears briefly "XMLFile parameter only is not supported by Oracle APEX, please use setXMLFile() method.» The table will be always delivered. Solution: Please advise end-users to ignore the message.

  • Possible bug - PLS-00372 creating BODY calculation of the PL/SQL FUNCTION

    3.2 on Oracle APEX: 10 x e

    I was creating a calculation for a page element by using the type 'BODY of the PL/SQL FUNCTION '. Step by step in the wizard when I entered my code block, I received the error PLS-00372. Here is the code:

    DECLARE
    l_return person_v.full_name%TYPE: = 'UNKNOWN ';
    BEGIN

    SELECT full_name
    IN l_return
    OF person_v
    WHERE party_id =: P230_CONTACTED_PARTY_ID;

    RETURN l_return;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    RETURN l_return;
    END;

    If I change my name of the variable to another thing that l_return the error disappears. Later, I can't change the name of the variable in l_return and I do not get the error if it seems to be the validation happening on just this page of the wizard.

    Greg - it's because of a quirk in the validation, like imagine you. Workaround is to put a space between return characters and the terminal semi-colon, for example:

    RETURN l_return;

    Scott

  • How not to use the squint no functionality?

    I forgot how not to use the squint no functionality. Can anyone help?

    18.0 Firefox was released last Tuesday, you need to update.

    See if this FAQ for NoSquint answers your questions.

    https://urandom.ca/NoSquint/#FAQ

  • How to use the Print Screen function?

    I've seen various descriptions of how to use the print screen function.

    It would be nice to actually tell one that works.  None have worked for me.

    [Fn] and Prt SCr does not work.

    CTRL and Prt SCr does not work.

    CTRL, Alt, and Prt SCr does not work.

    [Fn], Ctrl and Prt SCr does not work.

    If anyone knows the correct method to activate the screen capture function which would be a good thing.

    From the looks of things, HP has a big problem with this function.

    Here's a microsoft articleon the use of the screenshot function.

    This should answer your questions.

    Thanks for taking a peek.

  • IM 10 atm installation initiated Preview and I want to know: is it easy to use the dual-boot functionality, if I have 2 hard drives

    Hello!

    IM 10 atm installation initiated Preview and I want to know: is it easy to use the dual-boot functionality, if I have 2 hard drives? I have win7 on my main drive (SSD) and I want to install 10 preview initiated a new partition on my 500 GB hard drive, I created. I'll have to change smth in the bios menu, or I will be asked to choose between win7 and win10 in a menu after boot?

    Yes, it's, it's just like installing Windows on another partition.

    To learn more:

    http://answers.Microsoft.com/en-us/Insider/wiki/insider_wintp-insider_install/how-to-dual-boot-the-latest-Windows-build-with/9695dfc7-1C13-4D8D-B10B-587e78c6ac36

  • Why I can't use the nested aggregate function?

    Hello Experts,

    Why I can't use the nested aggregate function? There is not an ora-00979 group by error of expression.

    Oracle Database 11 g Release 11.2.0.4.0 - 64 bit Production

    Select

       SUM (BOX WHEN (KSD_CREATEDATE BETWEEN TRUNC((KSD_CREATEDATE)) AND TRUNC(MIN(KSD_CREATEDATE)) +60) THEN 1  ELSE 0 END) AS col

    DE TABLE_3_4

    GROUP BY STC_FIRMANO

    Thank you

    GROUP BY will manage the SUM function, but the MIN is used incorrectly - use another SELECTION to get it, or work with only with a single line. Otherwise, you could do WITH... get the SUM of SELECT MIN...

  • Problem opening pdf files.  I have Acrobat Reader DC/Windows by default, but when I click on the file, a file conversion screen with all these codes. Must use the "open with" function which is a nuisance.  Why it will not default?

    Problem opening pdf files.  I have Acrobat DC/Windows by default, but when I click on the file, a file conversion screen now with all these language codes. Must use the "open with" function which is a nuisance.

    Why it will not open by default when I click on the file?

    Hello

    I guess that you are looking for this:

    Open drive

    Go in Edition > Preferences > General

    Uncheck the option, the online storage see the opening of the files

    Click OK and restart

    Thank you

    Abhishek

  • I used the text tool function more than the reminder function, how do I get it back?

    I used the text tool function more than the reminder function, how do I get it back?

    Hi Slate7Berta,

    Please use Adobe acrobat reader DC Acrobat Reader DC Learn & support instead of touch Adobe, there seems to be a compatibility issue.

    Kind regards

    Nicos

  • I'm unable to use the Live View function when working with JavaScript in Dreamweaver.

    I'm currently trying to set up my own Web site with dreamweaver and am very familiar with the languages Java and JavaScript. However, whenever I try to use the Live View function it never let me. In addition, I can't get a preview of my work in a browser, as to do so is greyed out.

    However, I noticed that when using html in a project, all these functions are available. Any ideas how I can be able to use these features?

    Or perhaps you mean a .jsp file that is a Java Server Page.

    Modern web pages are almost entirely HTML code with CSS for styles and JavaScript for functionality added as games & slideshows or interactive menus.  It does not seem possible for me that you have been creating web pages entirely with JavaScript.

    Nancy O.

  • How to use the xp20 extension functions?

    Hello everyone,

    I want to use Java (JAXP) to perform XSL transformations using the xp20 extension functions (http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20).

    Transformation of"basic" is at work,
    Seller: < xsl: value - of select = "system-property('xsl:vendor')" / >
    Version: < xsl: value - of select = "system-property('xsl:version')" / >

    results in:
    Vendor: Oracle Corporation.
    Version: 2

    However, when I try < xsl: value - of select = "xp20:current - dateTime ()" / > (Yes, the namespace is declared), I get the following error:
    XML-22043: Fehler (error) bei Erweiterungsfunktion: method 'current-dateTime"non found
    (roughly: Error (error) according to the extension: "current-dateTime" method not found)

    This is after you have added the bpm - services.jar to my classpath. Before, I had a "class not found" (or something like that...).

    Assume that something is missing in my classpath - can I anyone tell me who I need to add the jar files and where to find them? This should be compatible with the suite and JDeveloper 10.1.3.4 SOA 10.1.3.4

    Thank you very much

    Finch

    4526876 October 9, 2006 bpm - services.jar (of soa_windows_x86_bpel_101310.zip)

    1211311 xmlparserv2.jar (from oracle xdk - 10.2.0.2.0)

    Don't run with all the exits, no variable set CLASSPATH, no ORACLE_ * defined variables:

    % java -cp "xmlparserv2.jar;bpm-services.jar" oracle.xml.parser.v2.oraxsl -w -v -debug -l input.xml -s date.xsl -r out
    Release version: Oracle XML Developers Kit 10.2.0.2.0 - Production
    1 XML document will be transformed using XSLT stylesheet specified in date.xsl with 1 thread
    Parsing file date.xsl
    Parsing file input.xml
    Transforming XML document specified in input.xml
    

    It seems to be a classpath issue. Try with java-verbose and you should see a line like

    ...
    [Loaded oracle.tip.pc.services.functions.Xpath20 from file://path/to/bpm-services.jar]
    ...
    

Maybe you are looking for