How to perform this procedure. .pls help with example

/ * It displays a warning * /.
-How to remove this warning


CREATE PROCEDURE EMP_TITLE_GENERATOR (EMP_GENDER IN (1) TANK, EMP_TITLE OUT VARCHAR2)
IS
BEGIN
EMP_TITLE: = Decode(EMP_GENDER,'M','Mr','F','Ms','INVALID');
EXCEPTION
WHILE OTHERS THEN
DBMS_OUTPUT. PUT_LINE (SQLERRM);
END;

Published by: 923746 on April 18, 2012 19:58

Published by: 923746 on April 18, 2012 19:59
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> CREATE PROCEDURE EMP_TITLE_GENERATOR (EMP_GENDER IN VARCHAR2,EMP_TITLE OUT VARCHAR2)
  2  IS
  3  begin
  4  select DECODE(EMP_GENDER,'M','Mr','F','Ms','INVALID') into emp_title from dual;
  5  EXCEPTION
  6  WHEN OTHERS THEN
  7  dbms_output.put_line(sqlerrm);
  8  END;
  9  /

Procedure created.

SQL> set serveroutput on
SQL> DECLARE
  2    EMP_GENDER VARCHAR2(200);
  3    EMP_TITLE VARCHAR2(200);
  4  BEGIN
  5    EMP_GENDER := 'F';
  6
  7    EMP_TITLE_GENERATOR(
  8      EMP_GENDER => EMP_GENDER,
  9      EMP_TITLE => EMP_TITLE
 10    );
 11    DBMS_OUTPUT.PUT_LINE('EMP_TITLE = ' || EMP_GENDER);
 12    DBMS_OUTPUT.PUT_LINE('EMP_TITLE = ' || EMP_TITLE);
 13  END;
 14  /
EMP_TITLE = F
EMP_TITLE = Ms

PL/SQL procedure successfully completed.

SQL> 

Tags: Database

Similar Questions

  • How to perform this procedure and get the result?

    I created a procedure, the source code for the same thing is provided below.

    create or replace procedure vin_test (p_deptno in number
    p_cursor ON SYS_REFCURSOR)
    as
    v_res Emp % rowtype;
    Start
    Open the p_cursor FOR
    Select *.
    WCP
    where deptno = p_deptno;

    end vin_test;

    Now, if I want to see that the out put of this Proc
    I first put the Serveroutput on and then...
    Exec vin_test (10);
    I get an error message indicating an incorrect number of arguments, then someone can tell me what is the value of the parameter I should move on so that I can get the desired output.


    Thanks in advance
    OraCrazy

    In sqlplus you can do like this.

    SQL> create or replace procedure vin_test( p_deptno IN number, p_cursor OUT SYS_REFCURSOR)
      2  as
      3     v_res Emp%rowtype;
      4  begin
      5     open p_cursor for
      6     select *
      7       from emp
      8      where deptno = p_deptno;
      9  end;
     10  /
    
    Procedure created.
    
    SQL> var lcur refcursor
    SQL> exec vin_test(30,:lcur)
    
    PL/SQL procedure successfully completed.
    
    SQL> print lcur
    
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO        DIV
    ---------- ---------- --------- ---------- --------- ---------- ---------- ---------- ----------
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30         10
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30         10
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30         10
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30         10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30         10
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30         10
    
    6 rows selected.
    

    Thank you
    Knani.

  • How to perform the procedure of the schema A b schema?

    Hello...

    I have a doubt... Please specify it.

    There are 2 tables and procedure on the tables in A schema.
    How to perform this procedure in the diagram B?

    I have to give privileges?

    Thank you
    SAI

    Hello

    You must grant execute on the package in plan a plan b. You then Norman to either create a synonym in plan B or the fully qualified name of the call, for example

    exec schemea.my_package;

  • whenever I select any folder or any icon in my computer win 7 I get a popup to remove this icon why this error comes how can I solve this problem pls help me

    whenever I select any folder or any icon in my computer win 7 I get a popup to remove this icon why this error comes how can I solve this problem pls help me

    Hello

    1. don't you make changes to the computer until the problem occurred?

    2. What is the exact error message do you get?

    I suggest you try the steps mentioned below and check if it helps.

    Method 1: Start your system in safe mode and check if the same problem occurs.

    http://Windows.Microsoft.com/en-us/Windows-Vista/start-your-computer-in-safe-mode

     

    Method 2 If the issue does not exist in Mode safe mode then try to put your computer in a clean boot state.

    By setting your boot system minimum state helps determine if third-party applications or startup items are causing the problem.

     

    How to troubleshoot a problem by performing a clean boot in Windows Vista or Windows 7:
    http://support.Microsoft.com/kb/929135

    Note: After the boot minimum troubleshooting step, follow step 7 in the link provided to return the computer to a Normal startup mode.

    Follow these steps to reset the computer to start as usual:

    (a) click on start toreduce this top that i, type msconfig.exe in the Start Search box and press ENTER.

    If you are prompted for an administrator password or for confirmation, type your password, or click continue.

    (b) under the general tab, click the Normal startup option, and then click OK.

    (c) when you are prompted to restart the computer, click restart.

    Method 3:

    Also scan your computer from the Microsoft Security Scanner, which would help us to get rid of viruses, spyware and other malicious software.

    The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.

    Hope this information is useful.

  • You need permission to perform this action - field user with file rights. Please advice

    You need permission to perform this action - field user with file rights.

    I can't access folder on drive network even with domain administrator of error do 'you need permission to perform this action. "
    I would be very grateful if you could please advice, I can't change folder\files in this folder, even with admin rights.
    Thanks in advance
    Saad Ali

    Hello

    I suggest you post the same question in the Microsoft Technet forum for assistance. We have a team to help you with this guy's questions.

  • in the past I have installed the cd into my itunes to mp3, then I transferred to my sandisk mp3 player, now I don't remember how to do this again, please help, what do I forget?

    in the past I have installed the cd into my itunes to mp3, then I transferred to my sandisk mp3 player and now I don't remember how to do this again, please help, what I forget

    Select Edit > Preferences > General (if necessary, press ctrl-B to activate the iTunes menu bar), click import settings..., then select MP3 encoder from the first drop-down and choose the setting of the quality required in the second dropdown.  This then becomes the default format for imported CD media.

  • My 4 GB USB shows this error "Windows has stopped this device because it has reported problems. (Code 43) ». How do slove this problem pls tell me

    My 4 GB USB shows this error "Windows has stopped this device because it has reported problems. (Code 43) ». How do slove this problem pls tell me

    Try the USB device on another computer.  If you get the same error in another computer, then the unit has probably missed and the files that it contains are lost.

  • MAC and Epson R3000 - have a photo 6 x 7 which I want main 81/2 x 11 paper glossy kodak premium photo.  Cannot know how to photo FIR. Pls HELP

    MAC and Epson R3000 - have a photo 6 x 7 which I want main 81/2 x 11 paper glossy kodak premium photo. Cannot know how to photo FIR. Pls HELP

    How to mark it as an issue?

    lisetteh82030331 wrote:

    I said PS my canvas was 8 1/2 x 11 and the image size is 800 x 680 pixels.  Photo is located in the upper left corner, how can I make more at least touch the bottom.  I can move it to the left.  Many thanks

    You need a better image, so as to print well.  If you print the 680 x 800 pixels that you they would print 8 1/2 "x 10" at 80 dpi a very soft image of low resolution.

  • HP pavilion h8-1230: how to access the bios pls help

    How to access the bios and I got windows 7 but to give birth to windos 10 with the thing free upgrade I got Pls Help

    Immediately after pressing the power button to turn on to start by pressing the F10 key.

  • How to run a procedure created dynamically with out parameter

    Hi guys,.

    a friend I need to run a procedure whose name will change dynamically and this procedure is with 2 out parameter. I need to capture the value of these 2 output settings, here I m giving my code too...

    declare
    int v_emp_id: = 100013;
    p_reg_off varchar (5): = "R";
    int p_user_id: = 6;
    v_status varchar (200);
    v_message varchar (200);
    v_Formula varchar (100);
    int v_number: = 1;

    Start
    v_Formula: = 'call testsp_ | v_number | ' ('| v_emp_id |', "'| p_reg_off |") «, » || p_user_id | v_status, v_message)';
    DBMS_OUTPUT. Put_line (v_Formula);
    immediately run v_Formula;
    end;


    and my procedure structure is like this


    CREATE OR REPLACE PROCEDURE testsp_1
    (
    p_emp_id INT,
    p_reg_off TANK,
    p_user_id INT,
    p_status OUT NOCOPY INT,
    p_message OUT NOCOPY VARCHAR2
    )
    AS
    Start
    end;

    Please help me...

    Hello

    You must use the "USING" clause to execute dynamic sql with parameter out.

    Example: http://download-west.oracle.com/docs/cd/B28359_01/appdev.111/b28370/dynamic.htm

    Arun-

  • "no memory to perform this operation? Help.

    Hello

    While I was running an explicit signal project, a window pops up that says "no memory to perform this operation" and "memory is full" in the power spectrum. Then he paused data collection. I wonder where I can set up the maximum memory and let express signal capture much data that I need. Thank you.

    Ningyu

    You push the limits of what can do SignalExpress.  You acquire data points about 8 million (internally, it is integrated 64MBytes, since they are arrays of doubles).  Analysis carried out additional copies of data (the originals must be kept for future use).  To do this, we need to minimize copies of data.  You have several options, in order of complexity:

    1. Take your data and store it in a file for later analysis.  Thanks to the acquisition of the data streaming into smaller pieces (10kS in the 100kS buffer) it would be easier to do using the SignalExpress integrated logging mechanism.  When you have finished to acquire data, analyze point by point in a different project, using the log for the entry.  This allows you to cut your use of memory by a factor of eight or more.  Note that the newspapers (which is a binary format - TDMS) can be converted to ASCII, if you wish.
    2. Your input file have specific areas of interest?  You can generate and analyze in pieces.  This isn't my first suggestion, as a power spectrum can be easily generated with segmented data (it is possible and National Instruments sells software for it, but it is not included in SignalExpress).  However, if you can live with ghosts of different power of different regions, this may be an option.  You have not included your file to generate, so I can't speculate further.  If you do so, back up your data to each piece.
    3. If you have LabVIEW, you can rewrite the project relatively easily here (the entire analysis is available as screw).  LabVIEW allows to optimize the memory at a much lower level that the Signal Express (see the tutorial Managing large data sets in LabVIEW, for example).
    The R & D department is aware of this problem of memory and strives to do better.  It is a question with many facets, so generally gets progressively improved with each release of SignalExpress.  If you would like more information, please let us know.

  • How to perform the procedure in the SQL worksheet?

    Hi, anyone knows, how I can execute procedure here?

    I try to EXEC sec_roles, EXEC security_admin.sec_roles, EXECUTE - there's a SQL statement error. When I use the CALL - there is no such procedure (I have execute privileges).

    Although in SQLPlus EXEC works, but there are problems with the standard SQL commands (each of them '2' returns any content is).

    Any ideas?

    Concerning
    Krzysztof

    EXEC procedure (parameters) is a plu sql (and some others) shortcut for

    BEGIN
       procedure(parameters);
    END;
    

    So try that and then pressing / on anything in the sql worksheet that makes a statement in execution.

    Note that if your procedure has defined parameters as OUT or IN OUT, you need to provide a variable to accept the returned values.

    John

  • How to perform a manual backup full with airport Time Capsule

    I want to switch to OS X Yosemite.  Before I do that, I want to perform a full manual backup of my system at the airport Time Capsule.  I was not able to find instructions on how to perform a manual backup by using the existing time Capsule.  Thank you.

    Dick C.

    Go to the Time Machine icon in the menu bar and click on NTI Backup Now

  • FDS Test Drive - help with examples of applications

    I try to use the FDS 30 minute TestDrive sample applications inside
    Flex Builder. I downloaded the test drive and all the samples of work
    fine just dandy, and I can view source etc. Then I wanted to load
    some of the apps sample in Flex Builder so that I could edit and
    play with them with the debugger to learn more.

    I tried the following:
    create the new project - use Flex Data Services/compilation app locally
    Root folder: C:\fds-tomcat\webapps\ROOT
    Root URL: http://localhost:8600 / ROOT. When I cliquerai to finish, I get the
    After 3 errors in the output panel:

    Unable to load SWC fds.swc: multiple points
    Unable to load SWC fds.swc: multiple points
    The definition of local base class was not found.
    Could not resolve < mx:Application > for implementation of component

    I'm on Flex 2.0.143459.

    I checked that fds.swc is indeed in the
    C:\fds-tomcat\webapps\ROOT\WEB-INF\flex\libs folder.
    I don't know what mean other messages or what to do.

    I then unzipped stubbornly examples of applications in the
    Project file FlexBuilder (I called FDS TestDrive samples) and
    tried to run anyway to see if I could get more information. I then get
    a browser with the following additional errors window:
    type of status report
    message /ROOT/FDS%20TestDrive%20Samples/Chat.html
    Description the requested resource (/ROOT/FDS%20TestDrive%
    20Samples/chat.html) is not available.

    So I guess that one of the problems is that it does not have an html document.
    But I don't know how to fix this.

    I don't know what to do. Any help would be GREATLY appreciated.

    Someone helped me offlist that once I'm frustrated that this forum is basically dead. But in case anyone else needs this info, I thought I would post. First of all, be on Flex version 2.0.155577. I have therefore had to redownload all of Flex, uninstall my old version, install the new version. Then I did the following
    to create the Flex Builder project for the dashboard sample application:

    File - > new-> Flex project
    Select Flex Data Services
    Select the application compiles locally
    Click next
    Uncheck the "default local Flex Data Services location"
    Click Browse... and open c:\fds-tomcat\webapps\ROOT
    Root URL: http://localhost:8600 /
    Context root: /.
    Click next
    Project name: ;
    Uncheck the "Use default location" checkbox
    Folder: c:\fds-tomcat\webapps\ROOT\dashboard
    Click next
    The main application file: dashboard.mxml
    Click on finish

    The context root is really essential. Also, to find my old Flex projects, I used file:import and then had to do a little more fiddling with some of the properties of the project.

    Too bad, this Forum is dead. I tried to get feedback to Adobe on this concern, but so far it has not helped. sigh

  • How to do this, as shown in the example.

    Hi.Im interested in doing something similar, as in this case http://www.wellnesswater.ca/index.HTML#3

    As you can see if the button has been activated in your browser window was scrolled down to the selected word. How to do this? How this script should look like?

    What use of action script, examples of projects or tutorials?

    Thank you.

    This is a feature of html navigation, known as a named anchor or bookmark, nothing to do with the Flash.  You can read about the anchors html here...

    http://www.w3schools.com/HTML/html_links.asp

Maybe you are looking for

  • Satellite P855 - need recovery partition properties

    Hello as I intend to migrate the HDD to ssd I resized the windows disc 8 and then the toshiba recovery partition after windows system 8, but it seems that this movement has really changed the properties/id of the partition. Could you please tell me t

  • Determination of 4070 self-calibration P/F

    I calibrate by automatic programming 13 PXI-4070 DMM-based daily and must determine whether or not the auto-cal spent on each. I never had a self-cal failure so I don't know really what to expect. An error or a warning will occur? If Yes, what are th

  • F5521gw Driver Update for T420s in accordance with the T430 systems...

    Hi guys,. You have pushed out a 7.1.1.0 update driver for the F5521gw card for the T430 but have not updated the T420 systems for the same card. Pilots of the T430 works on my T420s so out of curiosity, why isn't he there had an update for us guys? B

  • Printer ports does not. Drop-down list is empty

    All my printer ports are gone!  They still exist in the registry - but when I go to try to choose a port for a printer to use the list is empty.  I can add a new TCP/IP port and it shows in the Ontario Regulation, but not in the list.  Help!

  • Not able to hear sound on the Normal mode and safe mode.

    original title: windows-screen is frozen on normal mode had to cut the power to go in safe mode no sound on all channels Windows-screen is frozen on normal mode had to cut the power to go in safe mode no sound on all channels