Procedure Syntax Error Question

Hi all, new here but working on an intro database application project and am getting stuck on this procedure, any feedback would be greatly appreciated
create or replace procedure "PROJ_NEW_TRANSACTION"
(arg_transid IN NUMBER,
arg_totalcost IN NUMBER,
arg_pmtmethod IN VARCHAR2,
arg_amtpaid IN NUMBER,
arg_register IN NUMBER,
arg_customer IN NUMBER)
is
ws_availcash number;
insufficient_change exception;
begin
SELECT avail_cash into ws_availcash FROM proj_register WHERE arg_register = reg_id;
IF (arg_amtpaid - arg_totalcost) > ws_availcash
THEN raise insufficient_change;
END IF;
INSERT into proj_transaction values (arg_transid, arg_totalcost, arg_pmtmethod, arg_amptpaid, arg_register, arg_customer);
EXCEPTION
WHEN insufficient_change THEN
raise_application_error(-20000, 'Insufficient change in register');
end;
This is the syntax to the procedure, I have 3 tables (proj_transaction, proj_customer, proj_register) and am trying to get this procedure to ensure there is enough change in the register, and if not raise the exception and display the message indicated. I have to add more aspects to the procedure later, but I need to know why this isn't working. I keep getting the errors (Line 19, Position 81, PL/SQL: ORA-00984: column not allowed here) and (Line 19, Position 1, PL/SQL: SQL Statement ignored) -- Line 19 starts with the INSERT statement
These are the tables I am using:
create table proj_transaction
(trans_id      number(3) primary key,
total_cost      number(6,2) not null,
pmt_method      varchar2(6) check(pmt_method in('Cash', 'Credit')),
amt_paid     number(6,2) not null,
register     number(3) references proj_register(reg_id),
customer     number(3) references proj_customer(cust_id));
create table proj_register
(reg_id      number(3) primary key,
avail_cash     number(6,2) not null,
accounts_rec     number(6));
create table proj_customer
(cust_id     number(3) primary key,
money_amt      number(6,2),
cust_name     varchar(15));

Welcome to the OTN forums.
As advice for a new user, please do not duplicate posts. {thread:id=2220607}
And this question is better placed in the {forum:id=75} forum. Please try to get a feel for the different forums and their typical topics/discussions.
If you had looked up the error message, you would have found:
>
ORA-00984 column not allowed here
Cause: A column name was used in an expression where it is not permitted, such as in the VALUES clause of an INSERT statement.
Action: Check the syntax of the statement and use column names only where appropriate.

Similar Messages

  • MySQL Stored Procedure Syntax Errors

    I have an online application I would like to use transactions to either commit all db updates or none at all. The code I have created is as follows, not only am I getting a syntax error on lines 5 and 16, but quite frankly I am unsure the code will actually do what I want. Please let me know if you see the syntax errors and could explain them to me.
    CREATE PROCEDURE increase_maint_priority
        (maint_item INT, new_priority INT, cur_priority INT, center_id INT)
    BEGIN
        START TRANSACTION; -- line 5 syntax error
        -- start updates
        UPDATE maintitem SET priority = (priority+1)
            WHERE priority > cur_priority
            AND priority <= new_priority
            AND centerID = center_id;
        UPDATE maintitem SET priority = new_priority
            WHERE id = maint_item;
        COMMIT;
    END; -- line 16 syntax error
    Thank you in advance for helping a newb to stored procedures.
    If you would like to help me figure out if this code will actually work for what I want the following describes the situation.
    Main idea: business location managers submit requests for maintenance at their center. Requests can be added anywhere in the priority list (1=highest priority). They can also change the priority of a request at any time.
    Previously I have been using php to control a loop of mysql update queries (yikes, I know now, 2 sql statements could do the trick) and lately we have been experiencing duplicate priorities, and other problems that seem to be most likely linked to the updating of priorities of multiple items.
    Ex: moving priority item 6 to priority 1 requires 1 update query for the current 6th priority item, but a second query (or loop of several more since I was very new to sql statements at time of development 2 years ago) to update the other priorities.
    Thus the desire for the transaction method.
    Again, thanks in advance for any help on this issue.
    P.S. - I am using MySQL workbench to write this and that's where I get the errors.

    Yes, of course.
    DELIMITER //
    CREATE PROCEDURE increase_maint_priority
        (maint_item INT, new_priority INT, cur_priority INT, center_id INT)
    BEGIN
        START TRANSACTION;
        -- start updates
        UPDATE maintitem SET priority = (priority+1)
            WHERE priority > cur_priority
            AND priority <= new_priority
            AND centerID = center_id;
        UPDATE maintitem SET priority = new_priority
            WHERE id = maint_item;
        COMMIT;
    END //
    DELIMITER ;
    Just so you're aware, the table name is actually in a slightly dfferent format: `db_name`.`table_name` I have just renamed it for privacy purposes.

  • Stored Procedure syntax error

    I'm trying to create a stored procedure that does not have any IN or OUT parameters. It gives syntax errors:
    create or replace
    procedure GEN_NEW_DATA
    as
    cursor for_msgid is select PARENTID from WORKITEM;
    msgid_rec for_msgid%rowtype;
    begin
    for msgid_rec in for_msgid loop
    update FIELDTYPE set FIELDVALUE= (select ACCOUNTID from ACCOUNT where ACCOUNTNAME= (select FIELdVALUE from FIELDTYPE where FIELDNAME= msgid_rec.PARENTID || 'xAgency' ) ) where FIELDNAME= msgid_rec.PARENTID || 'xAgency';
    commit;
    end loop;
    dbms_output.put_line('Done');
    end;
    Can someone help me with the syntax here.

    msgid_rec for_msgid%rowtype;I think this is not allowed..
    ----Try this
    create or replace
    procedure GEN_NEW_DATA
    as
    cursor for_msgid is select PARENTID from WORKITEM;
    --msgid_rec for_msgid%rowtype;
    begin
    for msgid_rec in for_msgid loop
    update FIELDTYPE set FIELDVALUE= (select ACCOUNTID from ACCOUNT where ACCOUNTNAME= (select FIELdVALUE from FIELDTYPE where FIELDNAME= msgid_rec.PARENTID || 'xAgency' ) ) where FIELDNAME= msgid_rec.PARENTID || 'xAgency';
    commit;
    end loop;
    dbms_output.put_line('Done');
    end;
    Message was edited by:
            jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Compiles a procedure with syntax error

    In the script tab, try to compile a procedure with syntax errors.
    The message displays procedure compiled !!!
    It should display that procedure compiled with errors.

    Hi Kris,
    I searched through the threads, but did not come across a similar question and that is why i raised the query. It'll be helpful if you could answer the query.
    regards,

  • Facing syntax error while calling stored procedure

    hi
    iam calling a stored procedure which is a sybase USP.my code is as follows
    clsm3=CommonLib.cnClient.prepareCall("{call SYB1103.SIFGSYS..USP_Ins_ShipmentInvLines_Tmp "+coid+",'"+invclass+"',"+newsysno+","+productcd+",'"+batchno+"',"+qty+","+productrate+","+assrate+","+expercent+","+examt+","+saleed+","+bonused+",'"+recby+"',"+linestat+","+brno+","+prinvno+","+invno+","+recno+"}");
    clsm3.executeUpdate();
    where clsm3 is an object of CallableStatement.but it is giving me a syntax error saying
    "Invalid JDBC escape syntax at line position 84 '}' character expected"
    please reply as soon as possible

    clsm3=CommonLib.cnClient.prepareCall("{call
    {call SYB1103.SIFGSYS..USP_Ins_ShipmentInvLines_Tmp
    "+coid+",'"+invclass+"',"+newsysno+","+productcd+",'"+
    batchno+"',"+qty+","+productrate+","+assrate+","+exper
    cent+","+examt+","+saleed+","+bonused+",'"+recby+"',"+
    linestat+","+brno+","+prinvno+","+invno+","+recno+"}")
    ;clsm3=CommonLib.cnClient.prepareCall("call <PROCEDURE_NAME>(?,?,?,....)
    clsm3.setString(1,coid);
    clsm3.setInt(2,invclass);
    and so on...
    Try the above. The syntax of the call is wrong in your code.

  • Trying to execute a stored procedure gives: Syntax error or access violatio

    Hi,
    I have a stored procedure that runs fine in sqplus:
    EXEC load_image('distribuido.JPG', '1');
    When i try to execute it in PHP it gives me this error:
    [Oracle][ODBC]Syntax error or access violation.
    In php i'm using ODBC functions, with the same user configured in dsn. The sql i run in php is 100% equal...
    What's the problem and how should i run this procedure in php (or maybe grant more privileges to this user??)
    The procedure is:
    CREATE OR REPLACE PROCEDURE load_image( filename VARCHAR2, vid_membro INTEGER )
    AS
    file_lob BFILE;
    binary_lob BLOB;
    mime_type fotografia.foto_tipo%type;
    extension_pos NUMBER;
    BEGIN
    extension_pos := INSTR( filename, '.' );
    mime_type := 'image/' || SUBSTR( filename,
    extension_pos + 1,
    LENGTH( filename ) );
    INSERT INTO fotografia (id_foto, id_cat, id_membro, nota_media, num_votos, foto_tipo, fotografia)
    VALUES (fotografias_id.nextval, 1, vid_membro, 0, 0, mime_type, empty_blob())
    RETURNING fotografia INTO binary_lob;
    file_lob := BFILENAME( 'IMAGES', filename );
    dbms_lob.fileOpen ( file_lob, dbms_lob.file_readOnly );
    dbms_lob.loadFromFile( binary_lob,
    file_lob,
    dbms_lob.getLength( file_lob ) );
    dbms_lob.fileClose ( file_lob );
    END;
    /

    'exec' is an sqlplus directive. If you run this query in PHP, try:
    $query = "BEGIN
    load_image('distribuido.JPG', '1');
    END;";
    (you may have to remove the ; after 'END')

  • Stupid question: whats wrong here? -- Syntax Error in FROM clause

    i keep getting the error: Syntax Error in FROM clause.
    here is the code:
    <%@ page import="java.sql.*" %>
    <HTML>
    <HEAD>
         <TITLE>User Application Area</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:fypproject","","");
    Statement st = con.createStatement();
    String email = (String)session.getAttribute("email");
    String levelStatus = (String)session.getAttribute("levelStatus");
    String details = "SELECT PD.Forename, PD.Surname, L.Level_Name FROM PD Personal_Details AND LD Login_Details AND L Level WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND Level_ID = '" + levelStatus + "'";
    ResultSet rsDet = st.executeQuery(details);
    if(rsDet.next()) {
    String forename = rsDet.getString("Forename");
    String surname = rsDet.getString("Surname");
    String level_name = rsDet.getString("Level_Name");
    %>
    <DIV ALIGN="center"><H1>User Application Arena</H1></DIV>
    <BR>
    <H4>Welcome back <% out.println(forename + " " + surname); %> </H4>
    <BR>
    <%
    out.println(level_name);
    else {
    out.println("NOT FOUND ANYTHING");
    st.close();
    con.close();
    %>
    </BODY>
    </HTML>
    the strange thing is when i write a query that doesn't involve the 'Level' table it works fine.
    for example if i just want to display the forename and surname from 'Personal_Details' where the Email_Address = email it works fine...as soon as i involve the 'Level' table i get this error.
    i basically have 'Level_ID' in the 'Login_Details' table which is found out in the preceding jsp and passed through to this page and i can print out the Level_ID
    but....what i want to do is use this Level_ID and find the respective Level_Name in the Level table.
    my Level table looks like this:
    Level_ID Level_Name
    0 Pending
    1 Interview
    2 Rejection
    Thanks :o)

    Perhaps this is your issue ...
    The column Level_ID is in both the Login_Details and Level tables. Therefore, in your WHERE clause, you must specify a table alias for each reference to Level_ID
    WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND Level_ID = '" + levelStatus + "'";
    should be
    WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND L.Level_ID = '" + levelStatus + "'"; //ADDED "L." before Level_ID
    Level_ID would have been unique until you added the Level table.
    Good luck.
    -Mark

  • SYNTAX_ERROR unable to log in to SAP system Syntax error in program "SAPMSE

    hi SAP Experts,
    I have applied Basis patch 12 and I scheduled the background.  Backgroud job was terminated. System became slow. Then I stopped the server and restarted.  Now, I am unable to log in to SAP GUI by entering Username and Password and getting syntax error.
    Syntax error in program "SAPMSEM1".
    What happened?
    Error in the ABAP Application Program
    The current ABAP program '????????????????????????????"
    terminated because it has
    come across a statement that unfortunately cannot be executed.
    The following syntax error occured in program "SAPMSEM1" in include
    "CL_SALV_FORM_ELEMET==========CU" in
    line 13:
    "the type "IF_SALV_FORM_CONFIG" is unknown."
    The include has been created and last changed by:
    Created by: "SAP "
    Last Changed by: "SAP "
    I am unable to access any transction code.
    Please help me..
    Thanks in advance...
    Raju

    hi,
    Thanks for your response.
    i haven't take any back up.  can u pls tell me step by step procedure to implement the SP with TP.
    your answer will be helpful..
    Regards
    Raju

  • DB2 9.7 DFACT.SQL syntax error in Import ABAP phase - System Copy

    Hi all. I'm trying a system copy with a source system SAP ECC 6.0 ehp4 based on NW 701 and db2 LUW 9.1 .
    As it seems supported by SAP, i'm using db2 LUW 9.7 in target system.
    O.S. is Windows 2008.
    I got an error in phase "Import ABAP".
    Sapinst.log says:
    INFO 2010-02-18 10:12:14.337
    An error occured and the user decided to retry the current step: "|NW_ABAP_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_ABAP_Import_Dialog|ind|ind|ind|ind|5|0|NW_ABAP_Import|ind|ind|ind|ind|0|0|runMigrationMonitor".
    INFO 2010-02-18 10:12:14.509
    Switched to user: devadm.
    INFO 2010-02-18 10:12:14.572
    Creating file C:\Program Files\sapinst_instdir\ERPEhP4\LM\COPY\DB6\SYSTEM\CENTRAL\AS-ABAP\import_monitor.java.log.
    INFO 2010-02-18 10:12:14.603
    Switched to user: devadm.
    INFO 2010-02-18 10:12:14.618
    Working directory changed to C:\Program Files\sapinst_instdir\ERPEhP4\LM\COPY\DB6\SYSTEM\CENTRAL\AS-ABAP.
    INFO 2010-02-18 10:12:14.618
    Output of C:\j2sdk1.4.2_24-x64\bin\java.exe -classpath migmon.jar -showversion -Xmx1024m com.sap.inst.migmon.imp.ImportMonitor -sapinst is written to the logfile import_monitor.java.log.
    WARNING 2010-02-18 10:12:44.790
    Execution of the command "C:\j2sdk1.4.2_24-x64\bin\java.exe -classpath migmon.jar -showversion -Xmx1024m com.sap.inst.migmon.imp.ImportMonitor -sapinst" finished with return code 103. Output:
    java version "1.4.2_24-rev"
    Java(TM) Platform, Standard Edition for Business (build 1.4.2_24-rev-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 1.4.2_24-rev-b06, mixed mode)
    Import Monitor jobs: running 1, waiting 1, completed 73, failed 0, total 75.
    Loading of 'SAPDFACT' import package: ERROR
    Import Monitor jobs: running 0, waiting 1, completed 73, failed 1, total 75.
    WARNING[E] 2010-02-18 10:12:44.790
    CJS-30022  Program 'Migration Monitor' exits with error code 103. For details see log file(s) import_monitor.java.log, import_monitor.log.
    ERROR 2010-02-18 10:12:44.790
    FCO-00011  The step runMigrationMonitor with step key |NW_ABAP_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_ABAP_Import_Dialog|ind|ind|ind|ind|5|0|NW_ABAP_Import|ind|ind|ind|ind|0|0|runMigrationMonitor was executed with status ERROR .
    Looking into import_monitor.java.log i found that the problem is in dfact import.
    I've looked into sapdfact.log and i found:
    S:\usr\sap\DEV\SYS\exe\uc\NTAMD64\R3load.exe: START OF LOG: 20100218105045
    S:\usr\sap\DEV\SYS\exe\uc\NTAMD64\R3load.exe: sccsid @(#) $Id: //bas/701_REL/src/R3ld/R3load/R3ldmain.c#8 $ SAP
    S:\usr\sap\DEV\SYS\exe\uc\NTAMD64\R3load.exe: version R7.01/V1.4 [UNICODE]
    Compiled Jan 28 2010 20:22:25
    S:\usr\sap\DEV\SYS\exe\uc\NTAMD64\R3load.exe -i SAPDFACT.cmd -dbcodepage 4103 -l SAPDFACT.log -stop_on_error -loadprocedure fast LOAD:COMPRESS_ALL
    (DB) INFO: connected to DB
    (DB6) INFO: COMPRESS YES is set during table creation.
    (DB6) DB2 9.5 automatic dictionary creation does not require an explicit REORG.
    (DB6) Compression threshold is ignored.
    (GSI) INFO: dbname   = "DEV                                                                                "
    (GSI) INFO: vname    = "DB6                             "
    (GSI) INFO: hostname = "UNKNOWN                                                         "
    (GSI) INFO: sysname  = "Windows NT"
    (GSI) INFO: nodename = "SRVSAPDEV"
    (GSI) INFO: release  = "6.0"
    (GSI) INFO: version  = "6002 Service Pack 2"
    (GSI) INFO: machine  = "4x AMD64 Level 6 (Mod 26 Step 5)"
    (DB) ERROR: DDL statement failed with SQL error
    ( ALTER TABLE "/BI0/E0PPM_VC1" DROP PRIMARY KEY  )
      (SQL error -539)
      error message returned by dsql:
    SQL0539N  Table or nickname "SAPDEV./BI0/E0PPM_VC1" does not have a "PRIMARY" key.  SQLSTATE=42888
    (IMP) INFO: a failed DROP attempt is not necessarily a problem
    (DB6) INFO: executing DDL statements for object /BI0/E0PPM_VC1 from external SQL file.
    (DB) ERROR: DDL statement failed with SQL error
    ( CREATE TYPE 2 UNIQUE INDEX "/BI0/E0PPM_VC1~0" ON "/BI0/E0PPM_VC1"   ("KEY_0PPM_VC1T" ,   "KEY_0PPM_VC11" ,   "KEY_0PPM_VC1U" ,   "KEY_0PPM_VC1P" )   USING STOGROUP ___FAI PRIQTY 16   SECQTY 10240 FREEPAGE 0 PCTFREE 0   GBPCACHE CHANGED DEFINE NO   BUFFERPOOL BP3 COPY NO   PIECESIZE 2097152 K CLUSTER NOT PADDED  )
      (SQL error -7)
      error message returned by dsql:
    SQL0007N  The character "_" following "" )   USING STOGROUP" is not valid.  SQLSTATE=42601
    (DB) INFO: disconnected from DB
    S:\usr\sap\DEV\SYS\exe\uc\NTAMD64\R3load.exe: job finished with 1 error(s)
    S:\usr\sap\DEV\SYS\exe\uc\NTAMD64\R3load.exe: END OF LOG: 20100218105045
    So as you can see it seems that there's some syntax error in dfacl.log. The wrong SQL statement referred by sapdfact.log is
    ind: /BI0/E0PPM_VC1~0
    sql: CREATE TYPE 2 UNIQUE INDEX "/BI0/E0PPM_VC1~0" ON "/BI0/E0PPM_VC1"
      ("KEY_0PPM_VC1T" ,
      "KEY_0PPM_VC11" ,
      "KEY_0PPM_VC1U" ,
      "KEY_0PPM_VC1P" )
      USING STOGROUP ___FAI PRIQTY 16
      SECQTY 10240 FREEPAGE 0 PCTFREE 0
      GBPCACHE CHANGED DEFINE NO
      BUFFERPOOL BP3 COPY NO
      PIECESIZE 2097152 K CLUSTER NOT PADDED ;
      |
      ALTER TABLE "/BI0/E0PPM_VC1"
      ADD PRIMARY KEY ("KEY_0PPM_VC1T",
      "KEY_0PPM_VC11",
      "KEY_0PPM_VC1U",
      "KEY_0PPM_VC1P") ;
    Am i missing something?
    Data in referred tables (infocubes) isn't really important.
    Is there a safe way to proceed?
    Thanks in advance.
    Regards
    Simone Zaffalon

    And this is the strange point: my source system is not a BI and my dataclasses .SQL files are not empty.
    Me too i would expect that the files should be empty but instead they are full of object definitions.
    For example i have APPL0.SQL that contains a list of all tables of ECC system, for example
    tab: MAMT
    sql:     CREATE TABLE "MAMT"
            ("MANDT" SAPDB6VARCHAR(000003)
            DEFAULT '000' NOT NULL,
            "MATNR" SAPDB6VARCHAR(000018)
            DEFAULT ' ' NOT NULL,
            "SPRAS" SAPDB6VARCHAR(000001)
            DEFAULT ' ' NOT NULL,
            "MEINH" SAPDB6VARCHAR(000003)
            DEFAULT ' ' NOT NULL,
            "MTXID" SAPDB6VARCHAR(000002)
            DEFAULT ' ' NOT NULL,
            "LFDNR" SAPDB6VARCHAR(000002)
            DEFAULT '00' NOT NULL,
            "MAKTM" SAPDB6VARCHAR(000040)
            DEFAULT ' ' NOT NULL)
            IN "&location&"
            INDEX IN "&locationI&"
            LONG  IN "&locationL&"
          COMPRESS YES;
          ALTER TABLE "MAMT" LOCKSIZE ROW;
    and like this for all others tables.
    What would occur if i launch an import with such .SQL files?
    (shuld i put this question to another thread or is fine for you to answer on this?)
    Thank you again.
    Simone Zaffalon

  • Syntax error in Start Routine routine 9998 in transformation

    Hi Guyz,
    I am getting the below error while doinf the syntax check in start routine in one of the transformation in BW production after the failed TR movement
    E:In PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter
    "SOURCE_PACKAGE" is incompatible with the formal parameter
    "DATA_PACKAGE".
    but for the same transformation in quality its showing  no syntax errors found.
    its an odd behaviour.
    please guide with ur expertise.
    cheerz,
    raps.

    Hi,
    Check the note 1052648. it says that:
    Start routine:
               In the start routine, all the fields from the source are always available.
    During the migration, a type '_ty_t_SC_1_full' is generated in '2nd part global'. Since Note 1325124, this type has been adjusted when the field list is changed. In the past, a change to the field list caused syntax errors of the type:
    For update rules:
                        E: For PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter "SOURCE_PACKAGE" is not compatible with the formal parameter "DATA_PACKAGE".
    For transfer rules:
                        E:For PERFORM or CALL FUNCTION "STARTROUTINE", the actual parameter "SOURCE_PACKAGE" is not compatible with the formal parameter "DATAPAK".
               If this error continues to occur, go to the solution section to correct it.
               Solution:
               This error should now be automatically corrected with Note 1325124. Access the incorrect start routine in change mode. The type '_ty_s_SC_1_full' is then automatically adjusted to the source structure. If this does not work, you should use the tool 'RSTRAN_MIGRATION_CHECK' (described in Note 1369395) to check and possibly repair the transformation in question.
               If this error still occurs, you can correct it manually as follows:
               Copy the field list of the type     '_ty_s_SC_1' from the 'private section' of the CLASS lcl_transform DEFINITION (you can find this when you scroll up in the routine editor of the start routine) to the type '_ty_s_SC_1_full' of '2nd part global'.
    Regards,
    Anil Kumar Sharma .P

  • Error while sending E-Mail -- 501 Syntax error in parameters or arguments

    Dear Friends,
    I was trying to send E-Mail using the NTLM Authentication mechanism using the below program:
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    import javax.mail.PasswordAuthentication;
    import java.util.Date;
    import com.sun.mail.smtp.*;
    public class MailerWithAuthentication
         private String     smtpServer;
         private String      fromEmailId;
         private String      toEmailId;
         private String      ccEmailId;
         private String      bccEmailId;
         private String      subject;
         private String      message;
         private String host;
         public MailerWithAuthentication(String toemail, String msg,String sub,String fromId,String host)
              this.toEmailId = toemail;;
              this.subject = sub;
              this.message = msg;
              this.fromEmailId=fromId;
              this.host=host;
    public void sendMail()
              String mailContent = "";
              try
                   Authenticator authenticator = new Authenticator();
                   Properties props = new Properties();
              props.put("mail.smtp.host",this.host );
              props.put("mail.smtp.port", "25");
              props.put("mail.smtp.auth", "true");
              props.put("mail.smtp.auth.mechanisms", "NTLM");
              props.put("mail.smtp.auth.ntlm.flags", "0x00000200");          
              props.put("mail.smtp.auth.ntlm.domain","sal.ad");
              props.put("mail.debug", "true");
              Session session = Session.getDefaultInstance(props,authenticator);
    Message msg = new MimeMessage(session);          
              MimeMessage message = new MimeMessage(session);
              message.setContent("This is a test", "text/plain");
              message.setFrom(new InternetAddress(this.fromEmailId));
              message.addRecipient(Message.RecipientType.TO,new InternetAddress(this.toEmailId));
              Transport.send(message);
              catch (Exception e)
                   e.printStackTrace();
                   System.out.println("Exception in MailerThread : run: " + e.getMessage());               
    private class Authenticator extends javax.mail.Authenticator {
              private PasswordAuthentication authentication;
              public Authenticator() {
                   String username= "sal.ad\mailuser";
                   String password = "mail@123";          
                   authentication = new PasswordAuthentication(username, password);
              protected PasswordAuthentication getPasswordAuthentication() {
                   return authentication;
    public static void main(String args[])
              try
                   System.out.println(" Usage : java MailerWithAuthentication <To-Email> <Message> <Subject> <From-Email> <Mail-Server-IP>");
                   MailerWithAuthentication mailer = new MailerWithAuthentication (args[0],args[1],args[2],args[3],args[4]);
                   mailer.sendMail();
              catch(Exception e)
                   e.printStackTrace();
    Following is the output while running the program:
    DEBUG: JavaMail version 1.4ea
    DEBUG: java.io.FileNotFoundException: /usr/java/jdk1.5.0_14/jre/lib/javamail.providers (No such file or directory)
    DEBUG: !anyLoaded
    DEBUG: not loading resource: /META-INF/javamail.providers
    DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
    DEBUG: Tables of loaded providers
    DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
    DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
    DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
    DEBUG: !anyLoaded
    DEBUG: not loading resource: /META-INF/javamail.address.map
    DEBUG: java.io.FileNotFoundException: /usr/java/jdk1.5.0_14/jre/lib/javamail.address.map (No such file or directory)
    Mechanishm = NTLM
    DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: trying to connect to host "192.168.14.6", port 25, isSSL false
    220 ****************************************************************************
    DEBUG SMTP: connected to host "192.168.14.6", port: 25
    EHLO
    501 Syntax error in parameters or arguments -
    HELO
    501 Syntax error in parameters or arguments -
    javax.mail.MessagingException: 501 Syntax error in parameters or arguments -
    =================================
    The error is :
    EHLO
    501 Syntax error in parameters or arguments -
    HELO
    501 Syntax error in parameters or arguments -
    =================================
    Please tell me what went wrong here. Is it due to any mistake in the program ?
    Thanks in advance.

    hello Anirudh Pucha,
    thanks for your message,
    i'm downloading all the files you advised and one more doubt regarding SOA installation,
    i'm using BPEL Process manager 10.1.3.1.0 installed on my machine and not installed SOA Suite (problem in installing AS Middle tier), i send voice,sms through BPEL PM which works fine, and faced problem in e-mail notification only, according to me with out installing SOA suite we can use BPEL PM or please let me know the procedure to install the downloading files.
    if possible please send me a details in word documents to my mail "[email protected]".
    Thanks again

  • PL/SQL Procedure Compilation error

    Hi,
    <br><br>
    I have wrote a PL/SQL Stored Procedure to read a couple of table values and then output some data to a file, when I create the procedure on the database I get the following compilation error:
    <br><br>
    LINE/COL ERROR<br>
    -------- -----------------------------------------------------------------<br>
    25/7 PLS-00103: Encountered the symbol ")" when expecting one of the<br>
    following:<br>
    ( - + case mod new null <an identifier><br>
    <a double-quoted delimited-identifier> <a bind variable> avg<br>
    count current max min prior sql stddev sum variance execute<br>
    forall merge time timestamp interval date<br>
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe<br>
    The symbol "null" was substituted for ")" to continue.<br>
    <br>
    The script is below: <br><br>
    CREATE OR REPLACE <br>
         PROCEDURE TDF_EXTRACT AS<br>
    v_file UTL_FILE.FILE_TYPE;<br>
    YEAR number(4);<br>
    Q1_VALUE NUMBER(7);<br><br>
    BEGIN<br><br>
    SELECT PERSON_VALUE<br>
    INTO     Q1_VALUE<br>
    FROM PERSON<br>
    WHERE ID = 79;<br><br>
    SELECT EXTRACT(YEAR FROM SYSDATE)<br>
    INTO YEAR <br>
    FROM DUAL;<br><br>
    v_file := UTL_FILE.FOPEN(location => '/tmp',<br>
    filename => 'extratced_values.txt',<br>
    open_mode => 'W',<br>
    max_linesize => 32767);<br><br>
    UTL_FILE.PUT_LINE(v_file,<br>
    'Q1'     ||     YEAR     ||     '23'     ||     Q1_VALUE || '\r\n' ||<br>
              );<br><br>
    UTL_FILE.FCLOSE(v_file);<br><br>
    END TDF_EXTRACT;

    'Q1' || YEAR || '23' || Q1_VALUE || '\r\n' ||
    );Syntax error during concatenation, maybe?
    C.
    Message was edited by:
    cd

  • Syntax error while creating Calculation view script based

    Hi Folks,
    I'm creating Calc view based on script and drafted a simple code but I'm getting syntax error.
    Its just fetching few coloumns from two tables products and purchaseorderitem.
    /********* Begin Procedure Script ************/
    BEGIN
      var_out = select productid , category, nameid, currency, grossamount, quantity
      FROM sap.hana.democontent.epm.data.products AS P , sap.hana.democontent.epm.data.purchaseorderitem AS B
      where P.productid = B.productid;
    END /********* End Procedure Script ************/
    Could you pls take a look and let me know what wrong I'm doing?
    Error logs are:-
    sap.hana..package.project.folder.mytest.CALCSCRIPTVIEWInternal deployment of object failed;Repository: Encountered an error in repository runtime extension;Internal Error:Deploy Calculation View: SQL: sql syntax error: incorrect syntax near "democontent": line 5 col 18 (at pos 439)nSet Schema DDL statement: set schema "SYSTEM"nType DDL: create type "_SYS_BIC"."sap.hana..package.project.folder.mytest/CALCSCRIPTVIEW/proc/tabletype/VAR_OUT" as table ("PRODUCTID" NVARCHAR(10), "CATEGORY" NVARCHAR(2), "NAMEID" NVARCHAR(10), "CURRENCY" NVARCHAR(5), "GROSSAMOUNT" DECIMAL(15,2), "QUANITYT" DECIMAL(13,3))nProcedure DDL: create procedure "_SYS_BIC"."sap.hana.package.project.folder.mytest/CALCSCRIPTVIEW/proc" ( OUT var_out "_SYS_BIC"."sap.hana.package.project.folder.mytest/CALCSCRIPTVIEW/proc/tabletype/VAR_OUT" ) language sqlscript sql security definer reads sql data as n /********* Begin Procedure Script ************/ n BEGIN n t var_out = select productid , category, nameid, currency, grossamount, quantityn t FROM sap.hana.democontent.epm.data.products AS P , sap.hana.democontent.epm.data.purchaseorderitem AS Bn t where P.productid = B.productid;nnEND /********* End Procedure Script ************/n

    Hi Rubane,
    I don't have EPM installed here but based on this Table User Defined Functions( Table UDF ) in HANA  you are not properly defining the source table.
    In your case missing 1) schema of EPM, 2) not using double quotes, 3) separation of package and view, 4) missing camel case on purchaseOrderItem:
    FROM sap.hana.democontent.epm.data.products AS P , sap.hana.democontent.epm.data.purchaseorderitem AS B
    On blog:
    from "SAP_HANA_EPM_DEMO"."sap.hana.democontent.epm.data::businessPartner" as a
    SAP_HANA_EPM_DEMO is the schema
    sap.hana.democontent.epm.data is the package
    businessPartner is the view
    Start simple... before the seletion try it out on Studio SQL.
    Regards, Fernando Da Rós

  • Syntax error when executing a process chain.

    Hi gurus,
    This is a weird problem that we have been facing since yesterday. In the transaction RSPC, we had created a process chain in Feb 09. It ran smoothly till yesterday. However when I try to schedule the process chain now, it gives me a dump stating  Syntax error in program "CL_RSDMD_IOBJ_U_TPL===========CP ".
    This same dump is generated whenever I try to display variant of one of the nodes of Process Chain.
    I tried checking the corresponding programs but in vain. I have no Idea why am I receiving the error.
    If anyone has faced this problem please post the same.
    The following is brief overview of the dump.
    Information on where terminated Termination occurred in the ABAP program
    "CL_RSBK_DTP_DATABASE==========CP" - in "COPY_FROM_DB". The main program was
    "RSPC_MAINTAIN ". 
    In the source code you have the termination point in line 166
    of the (Include) program "CL_RSBK_DTP_DATABASE==========CM003".
    Any help would be appreciated.
    Regards,
    Sree.

    Hi Rayapa,
    There is no Long text as such, however, there is a short text which I have mentioned in my question itself.
    And there is a What Happened
    which is as follows
    Error in the ABAP Application Program
    The current ABAP program "CL_RSBK_DTP_DATABASE==========CP" had to be
    terminated because it has
    come across a statement that unfortunately cannot be executed.
    The following syntax error occurred in program
    "CL_RSDMD_IOBJ_U_TPL===========CP " in include
    "CL_RSDMD_IOBJ_U_TPL===========CM00E " in
    line 4:
    "Field "P_BOOKMODE" is unknown. It is neither in one of the specified t"
    "ables nor defined by a "DATA" statement. "DATA" statement."
    The include has been created and last changed by:
    Created by: "SAP"
    Last changed by: "<My SAP user>"
    Error in the ABAP Application Program
    The current ABAP program "CL_RSBK_DTP_DATABASE==========CP" had to be
    terminated because it has
    come across a statement that unfortunately cannot be executed.
    thnkz n regards,
    Sree.
    Edited by: Sree Nair on Apr 3, 2009 12:10 PM

  • Error in SUM: MAIN_NEWBAS/XPRAS_AIMMRG: Syntax Error in SAPLSUU6

    Pinging Boris Rubarth on what looks to be a minor bug with SUM 1.0 SP12 patch 12. The symptoms and resolution are pretty much identical to that described in Note 2093666 (Syntax Error in SAPLSUU6), except that according to the Note the error was corrected with SUM sp12 patch 6.
    The upgrade stopped with a number of errors in phase MAIN_NEWBAS/XPRAS_AIMMRG, essentially that job RDDEXECL terminated for post-import methods:
    /SAPSRM/PDO_MD_L_U_AFTER_IMP_I for /SAPPSSRM/CTRL
    /SAPSRM/V_SWITCH_AFTER_IMPORT for /SAPSRM/V_SWITCH
    /SAPPSSRM_BASE_AFTER_IMP for /SAPPSSRM/VC_HT
    /SAPSRM/PDO_MD_L_U_AFTER_IMP for /SAPSRM/V_ITPRO
    Digging into the job logs for RDDEXECL I saw that it was short dumping due to a syntax error in program SAPLSUU6, include LSUU6TOP: Type VSUSR_USBAPILINK is unknown. This is just as described in the Note.
    The Note says that in SUM SP12 with a patch level earlier than 6, the fix is to logon to client 000 as DDIC and execute report RSSCD_CHECK_GEN to regenerate change documents, then repeat the phase. With SUM SP12 patch 6 or greater, simply repeating the phase should fix it.
    Repeating the phase alone did not fix it, but running RSSCD_CHECK_GEN did. This was on patch 12, currently the latest. So, the workaround/fix from the Note still works, but the bug seems to still exist in SUM for a few of these after-import methods.
    This was an upgrade from SRM 5.0 to SRM 7.02 sps14 (i.e., including Basis 731 sp14). I ran SUM in 'Single System' Mode. The platform is Windows 2012 R2, SQL Server 2012 sp2 cu5.
    Otherwise, everything ran well. There was another slight hiccup in the same phase (after I resolved the one above) in which 'example' BAdI implementations are activated by the upgrade, but I think this might be more specific to SRM.
    Note to everyone else -- the discussion is not marked as a question because I have in fact resolved the issue for my system as described and moved on (the upgrade is complete and successful).
    Cheers,
    Matt

    Oops, there is one other small bug. The feedback form doesn't seem to exist. Clicking the link on the 'summary' page of the tool opens the URL http://<host>:4239/eval/EvalForm.html but results in a "Not Found" error.

Maybe you are looking for

  • Songs purchased showing in ITUNES and not in windows

    Thank you in advance for any help. I can not locate the files for the songs that I purchased, therefore when I click on the song in my "purchased" file, I get the exclamation point to the left and an error comes up telling me it can not play it becau

  • 9iAS Release 2 Forms/Reports Servers

    With 9iAS Rel1, there was a forms and a reports startup script for the servers. I'm not seeing this with Release 2. Also, we have had problems with Reports with regards to the DISPLAY environment setting. Where do I alter the DISPLAY for the reports

  • Mailapp keeps crashing on opening.

    No matter what I do Mail.app will not open and I keep getting the following error messages. I've deleted all the latest e-mails from iCloud that arrived before the unstoppable crashes this morning, but this has not addressed the problem. I cannot reb

  • Download yes; Install NO

    I can download Creative Cloud Installer but Photshop CC won't install

  • Email photos taken

    Taken some photos using the camera. When i want to send out using email, i was ask to reduce the photo size to either small, medium or large. When i press the option, nothing happen. Can anyone help ? How to reduce the photos image size and email out