Getting syntax error in procedure

Hi,
Oracle9i
Trying to update table EMP using procedure as below :
CREATE OR REPLACE PROCEDURE SCOTT.UPDATE_EMP
IS
v_ename varchar2(10);
BEGIN
update emp set ename: = 'XYZ' where empno='7934';
END;
but getting error :
[Error] Syntax check (9: 21): ERROR line 9, col 21, ending_line 9, ending_col 21, Found ':', Expecting: = -or- .
with regards

You do it like this:
SQL> desc emp
Name                                      Null?    Type
EMPNO                                     NOT NULL VARCHAR2(20)
ENAME                                              VARCHAR2(20)
DEPTNO                                             NUMBER
SQL>
SQL>
SQL> CREATE OR REPLACE PROCEDURE UPDATE_EMP (p_empno emp.empno%type, p_name in emp.ename%type) IS
  2  BEGIN
  3
  4    update emp set ename = p_name where empno= p_empno;
  5    commit;
  6
  7  END;
  8  /
Procedure created.
SQL> select * from emp;
EMPNO                ENAME                    DEPTNO
2                    a1                           10
SQL> exec update_emp(2, 'testing proc');
PL/SQL procedure successfully completed.
SQL> select * from emp;
EMPNO                ENAME                    DEPTNO
2                    testing proc                 10
SQL>Asif Momen
http://momendba.blogspot.com
Edited by: Asif Momen on Jun 18, 2010 3:04 PM
Included "DESC EMP"

Similar Messages

  • Getting syntax error in "SAPLBBP_PDH_CUF" in shopping cart/RFx/PO creation process in SRM7.0.Is it Patch issue?

    Getting syntax error in "SAPLBBP_PDH_CUF" in shopping cart/RFx/PO creation process in SRM7.0.Is it Patch issue?

    Hi, something wrong with your customer fields...
    Please, check them...

  • I'm getting syntax error on a python instruction.  it looks good but crashes. (print "Odd",num) becomes (print ‚Äúodd ‚Äú, num) 70 72 69 6E 74 20 E2 80 9C 6F 64 64 20 E2 80 9C 2C 20 6E 75 6D  I've rebooted and changed keyboard

    I’m getting syntax error on a python instruction.  it looks good but crashes. (print “Odd",num) becomes (print ‚Äúodd ‚Äú, num) 70 72 69 6E 74 20 E2 80 9C 6F 64 64 20 E2 80 9C 2C 20 6E 75 6D  I’ve rebooted and changed keyboard

    It worked when typed in from the command line.  Doesn't when its pasted in from Text Edit, rtf or txt. 

  • Getting syntax error while executing keyfigure routine BI 7.0

    Hello,
    I am writing a very simple keyfigure routine to calculate sales revune using sales quantity and sales price, I am getting error as follows
    - I am in 'Rules Details' screen and I have selected 'Routine' as the rule type. I enter the following code in routine
         RESULT = SOURCE_FIELDS_RULE-/BIC/IO_VB_QU *
         SOURCE_FIELDS_RULE-/BIC/IO_VB_PRC .
    - I hit the check button on the routine page, it says no syntax errors
    - Now I am back in the 'Rules Details' page and I hit the 'Check' button it gives me the following error
    Rule(target IO_VB_REV, group: Standard Group): Syntax error in routine
    Please tell me what is wrong. what should i check

    Hi Vaibhav,
    Here are the details
    - I am loading data from flatfile to an Infocube with 3 keyfigures: IO_VB_PRC (Sales Price) , IO_VB_QU (Sales Quantity), IO_VB_REV (Sales Revune). Getting values for IO_VB_QU and IO_Vb_PRC from flatfile and calculating for IO_VB_REV using routine
    - I created Transformations, and under  Rule Group: Standard Group box I see 'X' sign against 'IO_VB_REV' field, meaning not mapped to any datasource field
    - In rules detail screen, I add two source fields of Rule , IO_VB_QU and IO_VB_PRC. I see IO_VB_REV already added under 'Target fields of Rule' section
    - I then add the only following line to routine
    RESULT = SOURCE_FIELDS_RULE-/BIC/IO_VB_QU *    SOURCE_FIELDS_RULE-/BIC/IO_VB_PRC .
    Clicking on check button it gives no syntax error message. I save and exit back to Rule Details page.
    - I specify 'USD' as the Conversion Type and then click on check button it initially gives me 'Incorrect Input'  written in an information message box and then error that Syntax error in routine
    Let me know what is that I am missing
    Thanks for helping

  • Was trying to update my ITunes and get this error: The procedure entry point AVCFPlayerItemDurationChangedNotification could not be located in the dynamic link library AVFoundationCF.dll. Just got the new IPhone and am trying to share music files. Can any

    I have Windows Vista computer. I am trying to upgrade my ITunes so can share files with other home computer. (Just got the new IPhone). I get this system error: The procedure entry point AVCFPlayerItemDurationChangedNotification could not be located in the dynamic link library AVFoundationCF.dll. Tries system restore and redownloaded...NOW Itunes will not even open. Can anyone help?

    I uninstalled Apple Application Support, opened iTunesSetup with WinRar, and went down the list of msi's. AppleApplicationSupport was an install, all the others I did Repair.  Did not have to reboot. Works okay now.
    HTH

  • Beginner: Getting syntax error on WHERE clause in SELECT

    I'm very new to php and mySQL.  Am using DW master/detail to generate to basic code I need.  One thing I need to do is modify a select statement in the master to include a WHERE clause to limit the selection to a particular value in one field.
    I'm getting a syntax error with the WHERE clause I'm adding to the map select statement.
    This is the portion of the error message showing the error location:
    'WHERE Group='Community' LIMIT 0, 10'
    The php that generated the select is:
    $query_maps = "SELECT * FROM tblmaps ORDER BY tblmaps.DispSeq";
    $query_limit_maps = sprintf("%s WHERE Group='%s' LIMIT %d, %d", $query_maps, $selectGroup, $startRow_maps, $maxRows_maps);
    This approach to creating the select statement is from the code generated for the master page.  It adds the LIMIT clause.  All I did was add the "WHERE Group='%s' and the $selectGroup variable which comes from earlier code.  You can see that the $selectGroup variable is equal to the "Community: group.
    I've scanned the web to see what syntax error I might be making but haven't found anything that explains it.
    The full resolved select statement is:
    SELECT * FROM tblmaps ORDER BY tblmaps.DispSeq WHERE Group='Community' LIMIT 0,10
    What am I not seeing?
    Tom

    Thanks.  Make sense but changing that didn't help.
    Here's the error message I'm getting:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Group='Community' ORDER BY tblmaps.DispSeq LIMIT 0, 10' at line 1
    The full select (from a debugging ECHO I inserted) is:
    SELECT * FROM tblmaps WHERE Group='Community' ORDER BY tblmaps.DispSeq LIMIT 0, 10
    Note that when I take the WHERE clause out, there is no syntax error.

  • Getting syntax error in Crystal Report Viewer

    The web application that I am supporting has reports that are presented through CR Viewer. The problem that I am facing is that if I pass a value to get the report, its giving the following error.
    The syntax of the value of prompt 'name_of_paramente_passing' is incorrect. Please check the syntax and try again.
    I am not getting this error if I run the same report through the actual Crystal report program.
    So when I pass 123.1 to the crystal web viewer it wont give me any trouble. But If I pass 123.1(a) , it throws that error.
    somehow the combination of pareanthesis and the alphabet is causing some trouble....
    Is this a bug or some other problem.?
    Version that I have:
    Crystal Report web Viewer Control 11.5
    Crystal Developer 11.0.0.1282
    Please reply if you have any work around for this.
    Thank you,
    Santhosh

    Thanks Mohammed. But our application is trying to pass a parameter which contains user data like section numbers....
    So when we pass the value 123.1(a) , here what is happening behind the scene of CR viewer
    webSource0.AddParameter "promptex-NAMEOFPARAMETER", "123.1%28a%29"
    and it throws up the error
    "The syntax of the value for prompt 'NAMEOFPARAMETER' is incorrect. Please correct the syntax and try again"
    I have no idea why it is throwing up this errror....

  • Since updating to v17, I'm getting syntax errors on every site I go to. 2 windows everytime. ok twice and they are gone.

    This is the 1st small window that comes up "evalInSandbox:SyntaxError: syntax error"
    I click "OK" then the next window comes up "syntax error". I click "ok" and it goes away until I go to another web page.

    Sorry I didn't get back in here. "Social Fixer" was the problem. I ungraded it and the problem went away. Thanks for responding Kiraela.

  • Getting syntax error when i using INSERT command

    Hi,
    i am using MS Access DB. Table name is "Timesheet". the table has the following Fields,
    uname - Text
    date - Text
    intime - Text
    outtime - Text
    duration - Text
    desc - Text
    i am using preparedStatment,
    String accessDBURLPrefix = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
    String accessDBURLSuffix = ";DriverID=22;READONLY=false}";
    String filename="D:\\TimeSheet\\TimeDB.mdb"
    String databaseURL = accessDBURLPrefix + filename + accessDBURLSuffix;
    Connection con = DriverManager.getConnection(databaseURL);
    PreparedStatment st = con.prepareStatement("INSERT INTO (uname, date, intime) TimeSheet VALUES (?,?,?)");
    st.setString(1,user);
    st.setString(2,date);
    st.setString(3,intime);
    st.executeUpdate();
    }if i am going to compile this code i will get SQLException
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3150)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:214)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPreparedStatement.java:136)
         at TimeSheetDemo.writeToDB(TimeSheetDemo.java:84)
         at TimeSheetDemo.main(TimeSheetDemo.java:37)
    Really i have tired to figure out this problem. please help me anyone.
    thank you

    Thank you. it was my careless mistake. i changed that mistake. but still it is not working, get same exception.
    st = con.prepareStatement("INSERT INTO  TimeSheet (uname, date, intime) VALUES (?,?,?)");suppose, if i will give values for all fields, it will work fine, example
    st = con.prepareStatement("INSERT INTO  TimeSheet  VALUES (?,?,?,?,?,?)");
    st.setString(1,user);
    st.setString(2,date);
    st.setString(3,intime);
    st.setString(4,outtime);
    st.setString(5,duration);
    st.setString(6,descrip);
    st.executeUpdate();But my problem is i want to insert the values for only 3 fields.
    give me the solution for inserting values for specified fields

  • Keep getting syntax errors

    When I write formulas, I sometimes get a syntax error. However when I quit Numbers, open my document again, click on the syntax error and then press "enter," the syntax error has been corrected. Because I've done this many times, I know it's not that I'm incorrectly entering the formula. Can anyone shed any light on this? Thanks!

    As you are using Numbers '08, we can't use SUMIFS so :
    (1) I will assume that there is a records table for each year.
    (2) an auxiliary column (here column D) is required in the main table.
    In cells of this auxiliary column, the formula is:
    =MONTH(A)&B
    Now, I describes the table named "resume"
    In the row 1 which is an header one,
    cell A1 is blank (it may contain the year)
    in cell B1 the formula is :
    =MONTHNAME(COLUMN()-1)
    and I used fill to the right to get the other names of months.
    I used a formula so that the names match the language in use.
    In cells A2 thru A7 are the names of recorded items.
    In cell B2, the formula is:
    =SUMIF(main :: $D,"="&COLUMN()-1&$A,main :: $C)
    Then I used fill_down and fillto_theright.
    With Numbers '09 we would be allowed to use SUMIFS (which treats several conditions) so it would be easy to test: the year, the month, the item.
    Yvan KOENIG (VALLAURIS, France) vendredi 26 mars 2010 18:57:15
    Oops, I built the doc in Numbers '09 and forgot that MONTHNAME is unavailable in Numbers '08.
    So you will have to type the names of months in row 1.
    Message was edited by: KOENIG Yvan

  • Always getting syntax error when using RANK formula. Please help!!

    i am desperate! tried EVERYTHING. so as a last try, I tested the very same Example that Apple gives to elaborate how the "RANK" formula works...and you guessed it....NOT WORKING.
    not even a reconstruction 1 to 1 of the apple example worked, giving me a syntax error.
    thus i am assuming that i am doing something wrong on a very basic level i would have never thought of (maybe a setting i have wrong?, maybe if you have blue as background formulas don't work?).
    i would be sooooo grateful for any help!!!

    Thank you very much for answering this quickly.
    but unfortunately it doesnt work
    i made some screenshots, maybe this way someone sees a maybe obvious mistake i am making
    and
    Message was edited by: Apolloss

  • Why am I getting syntax error messages when sending emails thru MS Office:MAC 2011?

    Why am I getting suntax error messages when sending emails thru my outlook on my MacPro?

    What are the exact and complete error messages?

  • Getting Syntax Error in Script Editor

    I am a fairly new Mac user and also fresh to programming. I am trying run a piece of code that I copied directly from a guide but seems to be giving me a syntax error: "Expected 'into', variable name, other parameter name or property but found end of line."
    Here is the code that I am working with:
    on gestaltVersioninfo(gestaltcode, string_length)
    try
    tell application "Finder" to ¬
    copy my NumToHex((system attribute gestalt_code), ¬
    string_length) to {a, b, c, d}
    set the numeric_version to {a, b, c, d} as string
    if a is "0" then set a to ""
    set the version_string to (a & b & "." & c & "." & d) as string
    return {numeric_version, version_string}
    on error
    return {"", "unknown"}
    end try
    end gestaltVersion_info
    on NumToHex(hexData, stringLength)
    set hexString to {}
    repeat with i from stringLength to 1 by -1
    set hexString to ((hexData mod 16) as string) & hexString
    set hexData to hexData div 16
    end repeat
    return (hexString as string)
    end NumToHex
    copy my gestaltVersion_info("sysv", 4) to {system_version, system_string}
    if the system_version is less than "1050" then
    do shell script "/usr/bin/printf \"\\n# Block Adobe
    Activation\\n127.0.0.1\\tactivate.adobe.com\\n127.0.0.1\\tpractivate.adobe.com\
    \n127.0.0.1\\tereg.adobe.com\\n127.0.0.1\\tactivate.wip3.adobe.com\\n127.0.0.1\
    \tactivate.wip4.adobe.com\\n127.0.0.1\\twip3.adobe.com\\n127.0.0.1\\twip4.adobe
    .com\\n127.0.0.1\\t3dns-3.adobe.com\\n127.0.0.1\\t3dns-
    4.adobe.com\\n127.0.0.1\\t3dns-2.adobe.com\\n127.0.0.1\\tadobedns.
    adobe.com\\n127.0.0.1\\tadobe-dns-2.adobe.com\\n127.0.0.1\\tadobe-dns-
    3.adobe.com\\n127.0.0.1\\tereg.wip3.adobe.com\\n127.0.0.1\\tactivatesea.
    adobe.com\\n127.0.0.1\\twwis-dubc1-vip60.adobe.com\\n127.0.0.1\\tactivatesjc0.
    adobe.com\\n127.0.0.1\\thl2rcv.adobe.com\\n\" >> /etc/hosts" with
    administrator privileges
    else if the system_version is greater than "1050" then
    do shell script "/usr/bin/printf \"\\n# Block Adobe
    Activation\\n127.0.0.1\\tactivate.adobe.com\\n127.0.0.1\\tpractivate.adobe.com\
    \n127.0.0.1\\tereg.adobe.com\\n127.0.0.1\\tactivate.wip3.adobe.com\\n127.0.0.1\
    \tactivate.wip4.adobe.com\\n127.0.0.1\\twip3.adobe.com\\n127.0.0.1\\twip4.adobe
    .com\\n127.0.0.1\\t3dns-3.adobe.com\\n127.0.0.1\\t3dns-
    4.adobe.com\\n127.0.0.1\\t3dns-2.adobe.com\\n127.0.0.1\\tadobedns.
    adobe.com\\n127.0.0.1\\tadobe-dns-2.adobe.com\\n127.0.0.1\\tadobe-dns-
    3.adobe.com\\n127.0.0.1\\tereg.wip3.adobe.com\\n127.0.0.1\\tactivatesea.
    adobe.com\\n127.0.0.1\\twwis-dubc1-vip60.adobe.com\\n127.0.0.1\\tactivatesjc0.
    adobe.com\\n127.0.0.1\\thl2rcv.adobe.com\\n\" >> /etc/hosts;
    /usr/bin/dscacheutil -flushcache" with administrator privileges
    end if

    In your first *do shell script* statement, the *with administrator privileges* parameter is split across two lines. You just need to either put it on a single line or use option-return to continue a statement on the next line (not sure if the last *do shell script* has the same issue).
    Note that there is an AppleScript forum where these kinds of questions will be seen by a more targeted audience.

  • Getting syntax error in /usr/include/sys/ header files during Compilation

    Hi,
    I am migrating old PRO C code from Oracle 8 + Solaris 8 to Oracle 10 + Solaris 10 environment. While compiling the code it is giving error :*
    Syntax error at line 69, column 2, file /usr/include/sys/uio.h:
    Error at line 69, column 2 in file /usr/include/sys/uio.h
    lloff_t uiooffset; /* file offset */
    .1
    PCC-S-02201, Encountered the symbol "lloff_t" when expecting one of the followin
    g:
    } char, const, double, enum, float, int, long, ulong_varchar,
    OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime,
    OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
    OCIRaw, OCIString, short, signed, sql_context, sql_cursor,
    struct, union, unsigned, utext, uvarchar, varchar, void,
    volatile, a typedef name,
    The symbol "enum," was substituted for "lloff_t" to continue.
    Any guess why this is happening?

    Hi,
    Try using the PARSE=PARTIAL USERID=user/password[@SID] SQLCHECK=SEMANTICS precompiler options.
    All your hosts variables must be declared inside a Declare section.
    Reference: Pro C/C++ Programmers Guide, chapter 5
    Reguards,
    Rene Rivet

  • Getting syntax error while running ODI project

    Greetings,
    First time here with ODI. I'm using ODI version 10.1.3.5 and get the following error below on execution. I'm reading from a flat file to a mssql table. Not sure if this matters, but ODI is installed on one server running sql2005, while the staging tables are on a different server running 2008. The C$_ table is created, but contains no data.
    156 : S0001 : com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'TABLE'.
    com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'TABLE'.
         at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:197)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1493)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:390)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:340)
         at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
         at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:179)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:154)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:283)
         at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)
    Many thanks.

    Hi Lanfir,
    I'm not sure where the sql gets generated, although I see why the code fails (I think). Sql is expecting a real table name but insteas gets either a blank name or the comment /* */. Is that correct?
    This is what the error is saying at the operator.
    Loading: Query / Execution Plan
    ====================
    select     SETID     C3_SETID,
         CUSTNUM     C2_CUSTNUM,
         CUSTDESC     C1_CUSTDESC
    from      TABLE
    /*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=CUSTOMERSNP$CRLOAD_FILE=
    D:\Automation\ODI\HCCPREV\PS\Actual/CustomerMeta.txtSNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=09
    SNP$CRFILE_SEP_LINE=0D0ASNP$CRFILE_FIRST_ROW=1SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP
    $CRDWG_COLSNP$CRCOL_NAME=SETIDSNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=50
    SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=CUSTNUMSNP$CRTYPE_NAME=STRINGSNP$CRORDER=2SNP$CRLENGTH=50SNP
    $CRPRECISION=50SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=CUSTDESCSNP$CRTYPE_NAME=STRINGSNP$CRORDER=3SNP
    $CRLENGTH=250SNP$CRPRECISION=250SNP$CR$$SNPS_END_KEY*/
    Default: Query / Execution Plan
    ====================
    insert into EPMAInterfaceTST.dbo.C$_0NEW_CustomerTST
         C3_SETID,
         C2_CUSTNUM,
         C1_CUSTDESC
    values
         :C3_SETID,
         :C2_CUSTNUM,
         :C1_CUSTDESC
    )

Maybe you are looking for