What i'm doing wrong in this small pl/sql statement ?

Hi All,
I'm happy to write in this forum for the first time. Can anyone help me to show What i'm doing wrong in this small statement :
create or replace procedure augmente_salaire(p1 IN employees.employee_id%type, p2 IN number(3))
is
update employees set salary = salary + salary*p2/100 where employee_id=p1;
end  augmente_salaire;
begin
augmente_salaire(1001,20);
end;
I'm using pl/sql developer.
Any help would be much appreciated.
Best Regards.

Welcome to the forum!!
Point 1:
> create or replace procedure augmente_salaire(p1 IN employees.employee_id%type, p2 IN number(3))
The code in red is the one causing trouble. You cant specify LENGTH for the data type in parameter of a Procedure/Function. Oracle will define it based on the passing value.
So your code must be just.
create or replace procedure augmente_salaire(p1 IN employees.employee_id%type, p2 IN number)
Point 2:
BEGIN is missing after the IS key word.
Following is a corrected code.
create or replace procedure augmente_salaire
    p1 IN employees.employee_id%type
  , p2 IN number
is
begin
   update employees
      set salary = salary + salary*p2/100
    where employee_id=p1;
end  augmente_salaire;
show err

Similar Messages

  • What am i doing wrong with this class please help

    What am i doing wrong with this class? I'm trying to create a JFrame with a JTextArea and a ScrollPane so that text can be inserted into the text area. however evertime i run the program i cannot see the textarea but only the scrollpane. please help.
    import java.io.*;
    import java.util.*;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Instructions extends JFrame{
    public JTextArea textArea;
    private String s;
    private JScrollPane scrollPane;
    public Instructions(){
    super();
    textArea = new JTextArea();
    s = "Select a station and then\nadd\n";
    textArea.append(s);
    textArea.setEditable(true);
    scrollPane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    this.getContentPane().add(textArea);
    this.getContentPane().add(scrollPane);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setTitle("Instructions");
    this.setSize(400,400);
    this.setVisible(true);
    }//end constructor
    public static void main(String args[]){
    new Instructions();
    }//end class

    I'm just winging this so it might be wrong:
    import java.io.*;
    import java.util.*;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Instructions extends JFrame{
    public JTextArea textArea;
    private String s;
    private JScrollPane scrollPane;
    public Instructions(){
    super();
    textArea = new JTextArea();
    s = "Select a station and then\nadd\n";
    textArea.append(s);
    textArea.setEditable(true);
    scrollPane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    // Here you already have textArea in scrollPane so no need to put it in
    // content pane, just put scrollPane in ContentPane.
    // think of it as containers within containers
    // when you try to put them both in at ContentPane level it will use
    // it's layout manager to put them in there side by side or something
    // so just leave this out this.getContentPane().add(textArea);
    this.getContentPane().add(scrollPane);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setTitle("Instructions");
    this.setSize(400,400);
    this.setVisible(true);
    }//end constructor
    public static void main(String args[]){
    new Instructions();
    }//end class

  • What am I doing wrong with this filter (counter/frequency issue), probably another newb question.

    I extracted the part of my VI that applies here.  I have a 6602 DAQ board reading a counter for frequency, using a Cherry Corp proximity sensor.  Getting a lot of noise and errant ridiculously high readings.  Speed of shaft which it's measuring is currently 2400rpm with one pulse per revolution so 40hz. 
    Trying to use the express filter VI to clean up the signal and ignore anything over, say, 45hz and under 35hz.  No matter what setting I choose I continually get the  20020 error, Analysis:  The cut-off frequency, fc, must meet:  0 <= fc <= fs/2.  I know this relates to sample period somehow, but for the life of me I can't understand what I'm doing wrong. 
    I used this VI without filtering on bench tests with a hand-drill and got perfect output every time.  Now it's on the machine and being erratic.  Any help here will ease my stress level significantly, thanks.
    VI attached
    Still confused after 8 years.
    Attachments:
    RPM.vi ‏92 KB

    Hello Ralph,
    I'm not sure about mounting your sensor to your rig, but I can provide a couple ideas about the filtering. Depending on the type of noise, the digital filters on the PCI-6602 could help eliminate the behavior you are seeing. If the noise manifests as a "glitches" or a bouncing signal, you could use another counter with a minimum period to help eliminate the noise. This concept is discussed in greater detail in this KnowledgeBase. I noticed that you are using NI-DAQmx; the practical application of the digital filters on the PCI-6602 in NI-DAQmx is discussed in this KnowledgeBase. A more detailed description of the behavior of these filters is provided in the NI-DAQmx Help (Start>>All Programs>>National Instruments>>NI-DAQ) in the book entitled "Digital Filtering Considerations for TIO-Based Devices".
    I also wanted to comment on your original post and explain why you were receiving error -20020. For convenience, I have copied the text of the error code below.
    Error -20020 occurred at an unidentified location
    Possible reason(s):
    Analysis:  The cut-off frequency, fc, must meet:  0 <= fc <= fs/2.
    I think you may have misunderstood exactly what the Filter express VI does. The Filter express VI takes a series of values in a waveform and performs filtering on those signals. So, it will look at a waveform made up of X and Y values and apply the defined filter to this waveform. Specifically in your application, the cut-off frequency (fc) is the Upper Cut-Off level that you specified in the Filter express VI; any frequency components of the waveform outside of the range you have defined will be filtered. The fs is the sample rate based on the data that you wire to the Signal input of the Filter express VI. In your VI, this data is coming from the DAQ Assistant. So, fs will be the sample rate of the DAQ Assistant and is associated with the rate at which points are acquired. The sample rate does NOT relate to the bandwidth of the signal, except that the Nyquist theorem tells us that the sample rate must be at least twice the signal bandwidth in order to determine periodicity of the signal. So, in this case, the sample rate of the DAQ Assistant would need to be at least double the high cut-off frequency.
    However, you are performing a frequency measurement using a counter. I think this is where the confusion comes in. For the frequency measurement using a counter, the DAQ Assistant returns a decimal value which represents the rate of the pulse train being measured by the counter. It does not return the actual waveform that is being read by the counter. It is this waveform that would be band-pass filtered to eliminate frequency content outside of the filter's bandwidth. Instead of the Filter express VI, I would recommend that you simply discard values that are outside the range you specify. I have modified the code you posted earlier to perform this operation. The image below shows the changes that I made; rather than using the Filter express VI, I simply compare the frequency to the "Low Threshold" and "High Threshold". I use a Case structure to display the value on if it is within the limits. Otherwise, I display a "NaN" value. I have also attached the modified VI to this post.
    Message Edited by Matt A on 09-04-2007 07:58 PM
    Matt Anderson
    Hardware Services Marketing Manager
    National Instruments
    Attachments:
    RPM (Modified).JPG ‏17 KB
    RPM (modified).vi ‏72 KB

  • What am I doing wrong on this interactive SVG? Please help.

    I watched the tutorial on youtube on creating the svg and making an interactive color changing character. I have tried to implement it but I’m not doing something right and am a little lost on the code.  I was wondering if anyone could tell me what I am doing wrong.
    The SVG File
    Has 18 groups that can color change each in a different layer but not grouped within the layers
    The layer names are as follows
    Owl_Wing_Spots
    Owl_Wings
    Owl_Belly
    Owl_Body
    Trunk
    Leaf_Outline
    Leaf_1
    Leaf_2
    Leaf_3
    E2_Ear_Spots
    E2_Ear_Tail
    E2_Body
    E1_Ear_Spots
    E1_Ear_Tail
             15.  E1_Body
         16. Wall_Color
         17. Bird_Body
         18.   Bird_Butterfly_Wing
    I put the notify(this, "select"); on each layer
    I referenced http://cdn.edgecommons.org/an/1.0.0/js/min/EdgeCommons.js for the javascript file in AI and I also created a js file that is the same as the one in the video named svg.js (but neither made a difference)
    The Edge Animate File
    I added the SVG file named “elephant_tree2” and then added the following code to the CompositionReady Area
    // Load Edge Commons
    yepnope({
    load: "http://cdn.edgecommons.org/an/1.0.0/js/min/EdgeCommons.js",
    complete: function() {
                            // Enable SVG access
                            EC.accessSVG(sym.$("elephant_tree2")).done(
                                            function(svgDocument){
                                                            // add event listener
                                                            svgDocument.addEventListener("select", function(event) {
                                                                            // Remember selected part
                                                                            sym.setVariable("selectedPart", event.target);
                                                                            // show the id of the selected part in the textfield
                                                                            sym.$("selectedPartTxt").html( event.target.id );
    // insert code to be run when the composition is fully loaded here
    I added a selectedPartTxt text box and named it that too.
    None of the groups on the SVG are recognized and the selectedPartTxt does not change.  I suspect it may have something to do with the fact there are groups instead of one part but I don’t know how to fix it.
    I was also wondering if someone could tell me how to use an SVG for the color chart too instead of recreating it in Edge Animate.  I haven't tried to to the color part of the SVG because I still can't get the mouse click to work when on a group that changes.
    Any help would be appreciated.
    Thanks!
    Cherie

    Hi, I had a similar problem and this fixed it.
    You know how in the illustrator file, you need to reference a file called svg.js from the edge commons library? Download that file, or write the code in a text editor and save it in a .js file and then make sure that the file is in the same folder as your images called by the adobe edge file.
    I hope this works!
    Liz

  • What am I doing wrong with this method?

    Ok I tried this for two hours and for some reason my variables from one method wont work with the other method what am I doing wrong?
    public class Testing
    private static void storage(String[] storage){
    String retval= "";
    for(int i=0;i!=storage.length;i++){
    String getstorage= storage[i]+retval;
    return storage[i]+retval;
    }//for
    }//storage
    public static int[] find(String[] str){
    for(int i=0;i!=str.length;i++){
    if(str.equals (storage[i].substring(0,2))){
    return indexOf(str[i], str[i].length);
    else If(str[i].substring(indexOf(str[i]),str[i].length)>storage.substring(indexOf(storage[i]),storage[i].length)){
    return {0,0};
    };//elseif
    }//if
    }//for
    }//find
    }//StrStore

    Thanks got that part fixed and I even kinda learned how to make it so that I can establish the variable somewhere else lemme show you:
    public class StrStore
       private static String[] storage(String[] storage){
                for (int i=0; i!=storage.length; i++);
                  String retval="";
                  return storage[i] +retval;
               }//for
             }//storage
       public static String[] getStorageArray()
         String[] temp= new String[storage.length];
         for (int i=0; i!=storage.length; i++){
                  temp= storage[i];
    return temp;
    }//for
    }//getStorageArray
    public static int[] find(String[] str){
    for(int i=0;i!=str.length;i++){
    if(str[i].equals (storage[i].substring(0,2))){
    return {indexOf(str[i], str[i].length};
    else if(str[i].substring(indexOf(str[i]),str[i].length>storage.substring(indexOf(storage[i]),storage[i].length)){
    return {0,0};
    }//elseif
    }//if
    }//for
    }//find
    public static int[] encode(String str){
    for(int i=0;i!=str.length;i++){
    if(str[i].length>storage[i].length);
    return str[i]+storage[i];
    else{
    find(storage[i]);
    }//elseif
    }//if
    }//for
    }//encode
    public static Int[] decode(int[] code){
    for(int i=0;i!=str.length;i++){
    return find(storage[i]);
    }//for
    }//decode
    public static void main(String[] args)
    int[][] codes = new int[args.length][];
    for(int i=0;i!=args.length;i++){
    codes[i]=encode(args[i]);
    }//for
    storage(getstorage);
    System.out.println("storage = "+ getStorage);
    for(int i=0;i!=args.length;i++){
    System.out.println(decode(codes[i]));
    }//for
    }//main()
    }//StrStore
    however Im still coming up with 5 errors now one is stating that in this section:
    public static String[] getStorageArray()
         String[] temp= new String[storage.length];
         for (int i=0; i!=storage.length; i++){
                  temp= storage[i];
    return temp;
    }//for
    }//getStorageArray
    that a class is expected but I thought I had the class defined? I get that also here:
       public static int encode(String str){
               for(int i=0;i!=str.length;i++){
                 if(str.length>storage[i].length);
    return str[i]+storage[i];
    else{
    find(storage[i]);
    }//elseif
    }//if
    }//for
    }//encode
    but instead of the beginning I get it at the very last line of that snippet
    then I get that these two variables are incompatible
    private static String[] storage(String[] storage){
                for (int i=0; i!=storage.length; i++);
                  String retval="";
                  return storage[i] +retval;
               }//for
             }//storage

  • What am I doing wrong on this SQL file???

    Here is the file I have been working on all night and keep getting error messages incuding errors:
    line 8: name already used by an existing constraint
    line 10: missing right perenthesis (what am I missing?)
    line 1: name already used by an existing object
    line 5: invalid identifier
    Only one table created
    Thanks in advance because I am so very new to this stuff its 4:36AM and I have not gone to bed yet.
    Canaan
    create table game
    (game_id number(5) not null,
    game_title varchar2(35),
    version char(5),
    genre char(10),
    platform char(11),
    publisher char(15),
    constraint pk_game primary key (game_id));
    create table customer
    (cust_id number(9) not null,
    first_name varchar2(30),
    last_name varchar2(30),
    phone_no char(10),
    st_address varchar2(50),
    zip_code char(5),
    city varchar2(20),
    state char(2)     
    contact varchar2(40),
    constraint pk_cust primary key (cust_id)
    constraint fk_account foreign key (fk_acc_no) references account
    create table cust_rental
    (cust_id number(9) not null,
    Date_Rented date not null,
    Date_Returned date,
    constraint pk_cust primary key (cust_id)
    create table game_rental
    (game_id number(5) not null,
    Date_Rented date not null,
    Date_Returned date,
    constraint pk_cust primary key (cust_id)
    create table account
    (acc_no number(7) not null,
    charges number(10),
    acct_change number(10),
    constraint pk_acc primary key (acc_no)
    Message was edited by:
    Canaan639

    in oracle constraints are a separate object in itself. and you cannot have 2 different objects with the same name.
    in your first create table statement you have given the name for the primary key constraint as pk_cust. and the same name is given in the second create table statement also, which is causing the error.
    give unique names for each constraint.

  • What am I doing wrong with this simple array?

    I have an array that I need to add single characters to slowly.
    So the array is wordToCheck and I have some "drop places" to check and see if a letter has been "dropped off." Each drop point is assigned an index and I just want to add the letter to the proper index of the array so that I can push it into a string.
    This is my code:
    wordToCheck[currentBlank.register] = currentLetter.letter.toLowerCase();
    So you can see that if "A" was dropped at the blank spot with the register 2 it would return "- - A".
    The problem is that it's deleting it every time I add a letter. So if I put "A" in register 2 and then "M" in register 3 it returns "- - - M".
    How do I get it to not override itself each time?

    I tried making it an object but I guess I'm confused how that is supposed to work.
    When I tried to parse my array to a string it had a bunch of ","'s in it. So if I got it to be myArray["a" "b" "c"] it returns the string "a,b,c" instead of "abc."
    Why is that? Would using an object fix it? How is using an object different than using an array?
    I've read dozens of forums on this and I just can't figure out the difference except that in an object you are allowed to use a letter as the reference instead of a number.

  • I am trying to re-install ITunes on Windows XP.  When I do this, all I get is the "save" or "cancel" message, not "run".  What am I doing wrong?

    Because of  getting the message that I had to uninstall Apple Mobile Support Device and ITunes, in order to get my ITunes to be usable, I did that.  While trying to re-install ITunes, all I get on the message is the choice to "save" or "cancel".  It will not give me the "run" choice.  What am I doing wrong?  This should be fairly simple to reinstall, I thought.
    I am running Windows XP on a desktop computer using Firefox.

    Thanks so much.  This definitely worked.  I'm sorry I did  not think of using IE.  I use Foxfire exclusively so seldom even think of IE as an alternative.

  • My Top Rated songs, when I synch my iP4S - comes up with an error message saying it can't find all the songs. When I check, library has songs listed but with a "!" bubble next to them. When I click on them they play. What am I doing wrong?

    When synching, itcomes up with an error message saying it can't find all the songs. When I check, library has songs listed but with a "!" bubble next to them. When I click on them they play. What am I doing wrong? This happens every time so I click them and it sorts them (boring with 200 odd). How can I prevent this?

    Once you successfully add you iTunes library to iTunes Match, you go to Settings>iTunes & App Store on your iOS device and turn on iTunes Match.  Your iTunes Match library will then appear on your iOS device.

  • I created a Group and put in all names and email addresses but cannot get the group to appear in an outgoing email message.  What am I doing wrong?

    I created a Group and put in all names and email addresses but cannot get the group to appear in an outgoing email message.  What am I doing wrong?

    This may help.
    Can't connect to the iTunes Store
    What happens whenyou try to connect? Error messages?

  • DescriptorEvents-What am I doing wrong?

    I am running 9.0.3.4 of Oracle Toplink. I am registering a DescriptorEvent, but it does not appear to be working, it never get's called Perhaps someone could point out what I am doing wrong.
    This is the code for monitoring the event:
    public class AuditInfoListener
    extends DescriptorEventAdapter
         public void aboutToInsert(DescriptorEvent arg0)
    System.out.println("In Insert Event");          super.aboutToInsert(arg0);
              processInsertEvent(arg0);
         public void aboutToUpdate(DescriptorEvent arg0)
    System.out.println("In Update Event");
              super.aboutToUpdate(arg0);
              processUpdateEvent(arg0);
         public AuditInfoListener()
              super();
         public static void addListeners(Project project)
              Iterator iterator =
              project.getDescriptors().values().iterator();
              while (iterator.hasNext())
                   Descriptor descriptor = (Descriptor)iterator.next();
                   if (!descriptor.isChildDescriptor() )
                   descriptor.getEventManager().addListener(new AuditInfoListener());
    This is the code to registed the event with the project:
    project = XMLProjectReader.read(projectXmlFile);
    serverSession = (ServerSession) project.createServerSession();
    serverSession.setProject(project);
    serverSession.setName(projectKey);
    serverSession.getEventManager().addListener(new DiamondTopLinkEvents());
    serverSession.login();
    AuditInfoListener.addListeners(serverSession.getProject());
    I see in the debugger that it registers the events with the descriptors. But I never see the events get called. I
    have break points and messages in the aboutToInsert and aboutToUpdate and neither gets called on when writing objects. I know they are writing because I see the sql and the database is updated. I have tried registering the event before creating the ServerSession, before login and here after login, nothing seems to work. I know I am missing something, but not sure what.
    Thansk

    Try this way, add the listeners to the project before you login. I wouldn't be surprised if something was setup during the login, something cloned, etc...
    project = XMLProjectReader.read(projectXmlFile);
    AuditInfoListener.addListeners(project);
    serverSession = (ServerSession) project.createServerSession();
    serverSession.setProject(project);
    serverSession.setName(projectKey);
    serverSession.getEventManager().addListener(new DiamondTopLinkEvents());
    serverSession.login();
    - Don

  • Each time I try to save my slideshow I get the pop up "The file untitled.key-tef couldn't be opened". Any ideas on what I'm doing wrong?

    Each time I try to save my slideshow I get the pop up "The file untitled.key-tef couldn't be opened". Any ideas on what I'm doing wrong?

    > Apple do not give statements here, this is a user to user discussion.
    I didn't realise that. Wow that is TERRIBLE: I thought was Apple not Microsoft. Next we'll have Cook jumping up and down yelling "Developers, developers, developers!"
    > If you provide details of what is wrong, you might get a reply from experienced users.
    The fact that it's been here for more than nine months without a response suggests not.

  • Reflections: What am I doing wrong here?

    Given the object:
    public class TestObject
         public Object[] oArray;
         public int[] iArray;
    }and the code
    TestObject to = new TestObject();
    Field objectArrayField = to.getClass().getField("oArray");
    Object oArray = Array.newInstance(objectArrayField.getType(), 0);
    objectArrayField.set(to, oArray);
    Field intArrayField = to.getClass().getField("iArray");
    Object iArray = Array.newInstance(intArrayField.getType(), 0); // <-- Exception on this line
    intArrayField.set(to, iArray);I am getting the following exception:
    java.lang.IllegalArgumentException
         at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source)
         at java.lang.reflect.Field.set(Unknown Source)
         at com.efw.cp.ObjectParser.main(ObjectParser.java:151)For the life of me, I can't see what I am doing wrong. This always fails whether the int[] array is defined to an array or defined to be null.
    Any ideas?

    You quite surely want to access the field's component type, not the field's type:
    - objectArrayField.getType() returns the class for an array of Object
    - intArrayField.getType() returns the class for an array of int
    You surely want:
    - objectArrayField.getType() returns the class for Object
    - intArrayField.getType().getComponentType() returning the class for int

  • I keep getting this error in Dreamweaver when I am trying to upload my website?  Can you tell me what I am doing wrong?  here is the error message: /html - error occurred - Unable to create remote folder /html.  Access denied.  The file may not exist, or

    I keep getting this error in Dreamweaver when I am trying to upload my website?  Can you tell me what I am doing wrong?  here is the error message: /html - error occurred - Unable to create remote folder /html.  Access denied.  The file may not exist, or there could be a permission problem.   Make sure you have proper authorization on the server and the server is properly configured.  File activity incomplete. 1 file(s) or folder(s) were not completed.  Files with errors: 1 /html

    Nobody can tell you anything without knowing exact site and server specs, but I would suspect that naming the folder "html" wasn't the brightest of ideas, since that's usually a default (invisible) folder name existing somewhere on the server and the user not having privileges to overwrite it.
    Mylenium

  • Unable to delete email from trash bin.  How do I do this?  If I select and chose delete, it doesn't.  What am I doing wrong?  My grand daughte is using my iPad and I don't want her to see some of the mail there.

    Unable to delete email from trash bin.  How do I do this?  If I select and chose delete, it doesn't.  What am I doing wrong?  My grand daughte is using my iPad and I don't want her to see some of the mail there.

    There are two ways that should work. When you are in the trash folder, you can swipe on the email in the list - left to right - and a red Delete button should pop up. Or you can select - Edit - at the top of the list of messages and then select the message and tap delete.
    Not sure exactly how this works - but if you have restrictions enabled - especially since you let your grandchild use the device - that may be restricting what you can do in the mail app. Go to Settings>General>Restrictions. If you have it set to on - turn it off or see if you have mail restricted.

Maybe you are looking for

  • Very Slow preview rendering for lightroom 5 on import

    I am seeing very very slow rendering of preview images only when using the import function in lightroom 5. By slow, I mean for a shoot of 60 shots in raw, it could take 30 minutes before I can preview them all in the pane to see which ones I want to

  • ORA-01591: lock held by in-doubt distributed transaction

    I am using oracle wcf adapter to connect to oracle to insert. I am getting the ORA-01591: lock held by in-doubt distributed transaction. Any ideas as to what could be the resolution. I have followed the below mentioned steps. but that's not a permane

  • Why does my Photos folder have this inside?

    So, to cut this short, I plugged my iPod in today and BAM! 6 Local Disks. What are these in my photos file? I ran a virus scan in there and no negative results were returned. Any help would be highly appreciated Thanks!

  • Ever growing width of 'Edit Saved Customizations' window in IE

    We run our BI reports individually through our java application. When a report has saved customizations and we select to edit the saved customizations, the edit window comes up and keeps getting ever wider in IE. This means we can't get to the OK and

  • Cannot Type Some Arabic  Characters

    Dear All, I am working in bilingual project English and Arabic. In 10gforms i can type arabic and save it properly but in 10g reports i cannot type some of the arabic characters in design view. but the same characters i can type in arabic using other