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

Tags: Database

Similar Questions

  • 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

  • How can we make invisible static value in a text field to the OPA

    Hi all

    I have invisible static value in a text field in the OPA.

    For ex: field contains the value 100 while we manage the maintenance should not display the value 100 or make us the text as invisible field. whenever we submit the interview the value should be passed.

    I made the background color of the text in white field, but it reflects all the text fields. I need to make the text of the particular text as invisible field. Can someone give me a solution for it.

    Use two different attributes (the one that is indicated in the interview to the need - for example, as "the id selected user" or whatever the phrase is appropriate) and a different attribute, which is the mapped attribute.  The second attribute must not be on any screen of the interview (by thus "invisible" for the user).  Write a table of rules that concludes that the value of the attribute mapped on is EITHER static value or the selected/expected value according to some logic is appropriate to make a decision in your model of strategy.

  • Photoshop 2015: BUG? Layers panel auto-fait scroll to top when you select the text element with the text, creation/copy of layer tool and other actions

    This is a bug or a really bad and frustrating idea for a story.

    (1) in the layers panel, select a text layer, it highlights

    2) change to the text tool

    3) click on the text element in the workspace

    OR

    (1) select a layer in the layers panel

    (2) Ctrl-J, new layer by copying

    EXPECTED: Panel layers rest in the same position

    REAL: Panel layers scrolls the element selected or new layer to the top of the Panel. BORING.

    I do not need or want Photoshop to make decisions for me, space to work around to move without asking, or generally to spoil my flow!

    Please fix this or give me an option to turn it off as soon as POSSIBLE.

    autoscroll-problem.png

    You have successfully updated to 2015.0.1?

    The bug known as in the original message has been fixed in this version.

  • Functions the discoverer of the elements using the full name?

    Hello everyone,

    I had a problem today using the discoverer administrator, while creating an element using a Trim function on the element used in the condition of the reports, when I check the SQL code, it uses the fully qualified name that is SYS. STANDARD. Trim (Item) instead of just the TRIM (ITEM) which makes a huge difference in the duration of the query.

    For example:

    Items in the folder:
    CHECK_CODE1, CHECK_CODE2, CHECK_CODE3

    New item you want:
    ALLCHECKCODES = TRIM (CHECK_CODE1) | » _'|| TRIM (CHECK_CODE2) | » _'|| TRIM (CHECK_CODE3)

    Condition:
    ALLCHECKCODES LIKE '% 1234% '

    This is the Sql that is generated:

    Select...
    Of
    < table_name >
    where
    SYS. STANDARD. TRIM (CHECK_CODE1) | » _'|| SYS. STANDARD. TRIM (CHECK_CODE2) | » _'|| SYS. STANDARD. TRIM (CHECK_CODE3) LIKE '% 1234% ';

    With the creation of element when I create a condition using the Trim function it is displayed correctly:

    ... where
    TRIM (CHECK_CODE1) | » _'|| TRIM (CHECK_CODE2) | » _'|| TRIM (CHECK_CODE3) LIKE '% 1234% ';

    Is it possible that we delimit the Discoverer administrator to build the regular element using Trim instead of the fully qualified name for the function?

    Enjoy your entries and your advice.

    Thank you.

    Vlaminck

    Hello

    The problem is that the TRIM does not use the syntax of the standard setting and therefore normally does not appear in the EUL. If the PAD has been imported into the EUL then you might find the TRIM function in Disco administrator under Save the PL/SQL functions and then remove the SYS and the STANDARD of the owner and package.

    Otherwise, I should just use LTRIM (RTRIM (.)) like LTRIM and RTRIM use the normal parameter syntax.

    Rod West

  • 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

  • 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]
    ...
    
  • Retrieve and display a result set using the dynamic sql?

    Hi all

    How would display a result set in Oracle using the dynamic SQL? Reason being, the table where I'd retrieve and display the result set is a GLOBAL TEMP TABLE created in a stored procedure. If I try to use the loop as usual, the compiler complains that the table does not exist. This makes sense because the compiler does not recognize the table because it is created dynamically. Here is an example:

    create or replace PROCEDURE maketemptab IS
    sql_stmt VARCHAR2 (500);
    OutputString VARCHAR2 (50);

    BEGIN
    -create temporary table
    sql_stmt: = ' CREATE of TABLE TEMPORARY GLOBAL globtemptab (id NUMBER, col1 VARCHAR2 (50))';
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... created table ');

    -Insert a row into the temporary table
    sql_stmt: = "INSERT INTO globtemptab values (1, 'some data of a test')';"
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... inserted row ');

    -Insert a row into the temporary table
    sql_stmt: = ' INSERT INTO globtemptab values (2, "some more test data");
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... inserted row ');

    -Select the row on temporary table
    sql_stmt: = 'SELECT col1 FROM globtemptab WHERE id = 1';
    EXECUTE IMMEDIATE sql_stmt INTO outputstring;
    dbms_output.put_line ('... selected line: ' | outputstring);

    -drop temporary table
    sql_stmt: = 'DROP TABLE globtemptab;
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... moved table ');

    -display the result set
    for tabdata loop (select col1 from globtemptab)
    dbms_output.put_line ('... test of recovered data are' | tabdata.col1)
    end loop;
    end;


    In short, how to rewrite the SQL below the comment "to display the result set" using the dynamic sql?

    Thank you
    Amedeo.

    Hello

    Try this:

    CREATE OR REPLACE PROCEDURE maketemptab IS
       sql_stmt     VARCHAR2(500);
       outputstring VARCHAR2(50);
       v_cursor     SYS_REFCURSOR;
       v_col1       VARCHAR2(30);
    BEGIN
       -- create temp table
       sql_stmt := 'CREATE GLOBAL TEMPORARY TABLE globtemptab(id NUMBER, col1 VARCHAR2(50))';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...table created');
    
       -- insert row into temp table
       sql_stmt := 'INSERT INTO globtemptab values (1, ''some test data'')';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...row inserted');
    
       -- insert row into temp table
       sql_stmt := 'INSERT INTO globtemptab values (2, ''some more test data'')';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...row inserted');
    
       -- select row from temp table
       sql_stmt := 'SELECT col1 FROM globtemptab WHERE id=1';
       EXECUTE IMMEDIATE sql_stmt
          INTO outputstring;
       dbms_output.put_line('...row selected: ' || outputstring);
    
       OPEN v_cursor FOR 'SELECT col1 FROM globtemptab';
    
       LOOP
          FETCH v_cursor
             INTO v_col1;
          EXIT WHEN v_cursor%NOTFOUND;
          dbms_output.put_line('...test data retrieved is' || v_col1);
       END LOOP;
       CLOSE v_cursor;
    
       -- drop temp table
       sql_stmt := 'DROP TABLE globtemptab';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...table dropped');
    END;
    /
    

    Kind regards

  • 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'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.

Maybe you are looking for

  • Satellite P30 - blue screen after reinstalling OS

    I reinstall OS (Windows XP) on my old laptop Toshiba Satellite P30, but after the first (required to continue XP Setup) restart the BLUEBACK screen appear (System has recovered from a serious error). The laptop can not load Windows XP at all. Do you

  • missing os framedyn.dll file

    trying to download the trusteer report I had to contact the & it seems, I'm missing the OS FRAMEDYN file. DLL, I tried cmd but it tells me that I must be the administrator

  • HP officejet j4680

    J4680 AIO will not scan.  It prints and copies fine. using the error message from Windows Vsta - inaccessible Scanner

  • Stuck in its priority mode only, yes it's Marshmallow

    So, last night I updated my compact Z3 priority only and this morning I can't turn off. I tried safe mode and have to reboot, nothing helps. It's a 6.0.1This is the second problem, after problems with Internet on my WiFi at home, but somehow, that on

  • Cant of Smartphones blackBerry zoom on the camera?

    This morning I tried to take a picture and for some reason, I couldn't zoom in no more, I tried to delete some pictures and turning off my phone, but still could not zoom. Any help please I would really appreciate it. Thank you