Bind variable not declared - please help

Hello,
I have wrote a PL/SQL script to update some order_id's in a table. I have declared all my variables but get an error -- bind variable not declared. Can anyone tell me what the problem might be?
DECLARE
         last_ship      DATE ;
         last_order     NUMBER;
         last_cust      NUMBER;
VARIABLE curr_item      NUMBER;
VARIABLE curr_order     NUMBER;
         aorder_id      CHAR(6);
         aitem_id       CHAR(2);
         acust_id       NUMBER(6);
         aship_date     DATE;
CURSOR c1 IS
      SELECT 
              order_id,
              item_id,
              ship_date,
              cust_id
      FROM
              test_sales
      ORDER BY
              1,2,3,4,5;
BEGIN
      SELECT
              MAX(order_id)
      INTO
               curr_order
      FROM
               sales_order;
OPEN c1;
     LOOP
         FETCH c1 INTO aorder_id, aitem_id, aship_date, acust_id;
         EXIT WHEN c1%NOTFOUND;
           last_cust      := c1.cust_id;          -- Saves the last values to check if processing same order
           last_order     := c1.aorder_id;        --
           last_ship      := c1.aship_date;       --
           IF c1.aorder_id = last_order AND c1.cust_id = last_cust AND c1.ship_date = last_ship THEN
              curr_item   := curr_item  +1;
              UPDATE test_sales SET c1.aorder_id = :curr_order;
              UPDATE test_sales SET c1.aitem_id  = :curr_item;
           ELSE
              curr_order := curr_order + 1;
              curr_item  := 1;
              UPDATE test_sales SET c1.aorder_id =  :curr_order;
              UPDATE test_sales SET c1.aitem_id  = :curr_item;
           END IF; 
    END LOOP;
CLOSE c1;
END;
/Cheers
Mike

check yours code you are direct accesing cusrsor named directly which is not allowed
  1  DECLARE
  2  vemp  emp.empno%TYPE;
  3  vemp1 emp.empno%TYPE;
  4  CURSOR c1 IS SELECT empno FROM emp;
  5  BEGIN
  6   OPEN c1;
  7    LOOP
  8     FETCH c1 INTO vemp;
  9     EXIT WHEN c1%NOTFOUND;
10     vemp1:=c1.empno;
11    END LOOP;
12   CLOSE c1;
13* END;
SQL> /
   vemp1:=c1.empno;
ERROR at line 10:
ORA-06550: line 10, column 14:
PLS-00225: subprogram or cursor 'C1' reference is out of scope
ORA-06550: line 10, column 4:
PL/SQL: Statement ignored
SQL> DECLARE
  2  vemp emp.empno%TYPE;
  3  CURSOR c1 IS SELECT empno FROM emp;
  4  BEGIN
  5   OPEN c1;
  6    LOOP
  7     FETCH c1 INTO vemp;
  8     EXIT WHEN c1%NOTFOUND;
  9    END LOOP;
10   CLOSE c1;
11  END;
12  .
SQL> /
PL/SQL procedure successfully completed.Yours code
OPEN c1;
LOOP
FETCH c1 INTO aorder_id, aitem_id, aship_date, acust_id;
EXIT WHEN c1%NOTFOUND;
last_cust:= c1.cust_id;
last_order:= c1.aorder_id;
END LOOP;
CLOSE c1;
END;You sholud move it c1.cust_id within fetch statment or
bind the cursor name with another local cursor variable
then fetch into this local bind variable and use cursor
via this variable
e.g
DECLARE
CUSRSOR c1 IS SELECT cust_id,aorderid
    FROM <TABLE>;
c2      c1%ROWTYPE;
OPEN c1;
LOOP
FETCH c1 INTO c2;
aorder_id:=c2.aorderid;
last_cust:= c1.cust_id;
last_order:= c1.aorder_id;
END LOOP;
CLOSE c1;
END;Khurram

Similar Messages

  • SP2-0552: Bind variable not declared error. Any help please?

    Hi Experts,
    I have a question regarding the error that I am getting: SP2-0552: Bind variable "V_COUNT_TOT_BAL" not declared.
    I have 'out' parameters declared in my procedure and executing the same from sql script as shown below:
    set ver off
    set serverout on
    set linesize 8000
    Declare
    Variable v_count_dtl_bal NUMBER(10);
    Variable v_updat_dtl_bal NUMBER(10);
    Variable v_count_tot_bal NUMBER(10);
    Begin
    execute load_abc.insert_abc_bal(:v_count_dtl_bal,:v_updat_dtl_bal,:v_count_tot_bal);
    End;
    exit;
    So, when this sql script runs it given me the above error. However, all the result looks good and there's no problem with the data or anything else that might be impacted. I suspect this error stems from the code in the sql script above.
    Any idea what am I doing wrong?
    Thanks in advance for any inputs.

    Thanks Frank. I still receive the same error if I follow your example or any of the ones explained above. This is what I am getting and still an error underneath:
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
              VARCHAR2 (n CHAR) | NCHAR | NCHAR (n) |
              NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
              BINARY_FLOAT | BINARY_DOUBLE ] ]
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
              VARCHAR2 (n CHAR) | NCHAR | NCHAR (n) |
              NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
              BINARY_FLOAT | BINARY_DOUBLE ] ]
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
              VARCHAR2 (n CHAR) | NCHAR | NCHAR (n) |
              NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
              BINARY_FLOAT | BINARY_DOUBLE ] ]
    SP2-0552: Bind variable "V_COUNT_TOT_BAL" not declared.

  • SP2-0552: Bind variable not declared

    Hi,
    I am using below bind values in a sql query.
    declare
    B1 number;
    B2 varchar2(10);
    B3 varchar2(10);
    B4 number;
    B5 date;
    B6 date;
    B7 varchar2(30);
    B8 number;
    B9 number;
    B10 varchar2(9);
    B11 number;
    Begin
    :B1 := 24152;
    :B2 := 'CR_CORP';
    :B3 := 'COST';
    :B4 := 24152;
    B5 := TO_DATE('01/29/12 23:20:34','MM/DD/YY HH24:MI:SS');
    B6 := TO_DATE('02/27/12 21:10:58','MM/DD/YY HH24:MI:SS');
    :B7 := 'BEGIN';
    :B8 := 945142827;
    :B9 := 483695;
    :B10 := 'CR_CORP';
    :B11 := 7;
    End;
    and even tried as below:
    declare
    variable B1 number;
    variable B2 varchar2(30);
    variable B3 varchar2(30);
    variable B4 number;
    B5 date;
    B6 date;
    variable B7 varchar2(30);
    variable B8 number;
    variable B9 number;
    variable B10 varchar2(30);
    variable B11 number;
    Begin
    :B1 := 24152;
    :B2 := 'CR_CORP';
    :B3 := 'COST';
    :B4 := 24152;
    B5 := TO_DATE('01/29/12 23:20:34','MM/DD/YY HH24:MI:SS');
    B6 := TO_DATE('02/27/12 21:10:58','MM/DD/YY HH24:MI:SS');
    :B7 := 'BEGIN';
    :B8 := 945142827;
    :B9 := 483695;
    :B10 := 'CR_CORP';
    :B11 := 7;
    End;
    Resulting in SP2-0552: Bind variable "B7" not declared.
    Kindly help!

    Try this:
    /* Formatted on 14-3-2012 12:02:31 (QP5 v5.163.1008.3004) */
    DECLARE
       B1             NUMBER;
       B2             VARCHAR2 (10);
       B3             VARCHAR2 (10);
       B4             NUMBER;
       B5             DATE;
       B6             DATE;
       B7             VARCHAR2 (30);
       B8             NUMBER;
       B9             NUMBER;
       B10            VARCHAR2 (9);
       B11            NUMBER;
    BEGIN
       B1          := 24152;
       B2          := 'CR_CORP';
       B3          := 'COST';
       B4          := 24152;
       B5          := TO_DATE ('01/29/12 23:20:34', 'MM/DD/YY HH24:MI:SS');
       B6          := TO_DATE ('02/27/12 21:10:58', 'MM/DD/YY HH24:MI:SS');
       B7          := 'BEGIN';
       B8          := 945142827;
       B9          := 483695;
       B10         := 'CR_CORP';
       B11         := 7;
    SELECT                                              /*+ USE_HASH(SUB_DD,BK) */
          DH.ASSET_ID,
           DH.CODE_COMBINATION_ID,
           NULL,
           DECODE (:B3,
                   'COST', CB.ASSET_COST_ACCT,
                   'CIP COST', CB.CIP_COST_ACCT,
                   'RESERVE', CB.DEPRN_RESERVE_ACCT,
                   'REVAL RESERVE', CB.REVAL_RESERVE_ACCT),
           DECODE (
              :B3,
              'RESERVE', DECODE (DD.DEPRN_SOURCE_CODE, 'D', :B7, 'ADDITION'),
              'REVAL RESERVE', DECODE (DD.DEPRN_SOURCE_CODE,
                                       'D', :B7,
                                       'ADDITION'),
              :B7),
           DECODE (:B3,
                   'COST', DD.COST,
                   'CIP COST', DD.COST,
                   'RESERVE', DD.DEPRN_RESERVE,
                   'REVAL RESERVE', DD.REVAL_RESERVE),
           :B11
      FROM FA_DEPRN_DETAIL DD,
           FA_DISTRIBUTION_HISTORY DH,
           FA_ASSET_HISTORY AH,
           FA_CATEGORY_BOOKS CB,
           FA_BOOKS BK,
           (  SELECT ASSET_ID, DISTRIBUTION_ID, MAX (PERIOD_COUNTER) MPC
                FROM FA_DEPRN_DETAIL
               WHERE BOOK_TYPE_CODE = :B2 AND PERIOD_COUNTER <= :B1
            GROUP BY ASSET_ID, DISTRIBUTION_ID) SUB_DD
    WHERE DH.BOOK_TYPE_CODE = :B10
           AND DECODE (DD.DEPRN_SOURCE_CODE, 'D', :B6, :B5) BETWEEN DH.DATE_EFFECTIVE
                                                                AND NVL (
                                                                       DH.DATE_INEFFECTIVE,
                                                                       SYSDATE)
           AND DD.ASSET_ID = DH.ASSET_ID
           AND DD.BOOK_TYPE_CODE = :B2
           AND DD.DISTRIBUTION_ID = DH.DISTRIBUTION_ID
           AND DD.PERIOD_COUNTER <= :B1
           AND DD.ASSET_ID BETWEEN :B9 AND :B8
           AND DECODE (:B3,
                       'CIP COST', DD.DEPRN_SOURCE_CODE,
                       DECODE (:B7, 'BEGIN', DD.DEPRN_SOURCE_CODE, 'D')) =
                  DD.DEPRN_SOURCE_CODE
           AND DD.PERIOD_COUNTER = SUB_DD.MPC
           AND DD.DISTRIBUTION_ID = SUB_DD.DISTRIBUTION_ID
           AND SUB_DD.ASSET_ID = DD.ASSET_ID
           AND AH.ASSET_ID = DD.ASSET_ID
           AND AH.ASSET_TYPE <> 'EXPENSED'
           AND DECODE (DD.DEPRN_SOURCE_CODE, 'D', :B6, :B5) BETWEEN AH.DATE_EFFECTIVE
                                                                AND NVL (
                                                                       AH.DATE_INEFFECTIVE,
                                                                       SYSDATE)
           AND CB.CATEGORY_ID = AH.CATEGORY_ID
           AND CB.BOOK_TYPE_CODE = DD.BOOK_TYPE_CODE
           AND BK.BOOK_TYPE_CODE = CB.BOOK_TYPE_CODE
           AND BK.ASSET_ID = DD.ASSET_ID
           AND DECODE (DD.DEPRN_SOURCE_CODE, 'D', :B6, :B5) BETWEEN BK.DATE_EFFECTIVE
                                                                AND NVL (
                                                                       BK.DATE_INEFFECTIVE,
                                                                       SYSDATE)
           AND NVL (BK.PERIOD_COUNTER_FULLY_RETIRED, :B1 + 1) > :B4
           AND DECODE (
                  :B3,
                  'COST', DECODE (AH.ASSET_TYPE,
                                  'CAPITALIZED', CB.ASSET_COST_ACCT,
                                  NULL),
                  'CIP COST', DECODE (AH.ASSET_TYPE,
                                      'CIP', CB.CIP_COST_ACCT,
                                      NULL),
                  'RESERVE', CB.DEPRN_RESERVE_ACCT,
                  'REVAL RESERVE', CB.REVAL_RESERVE_ACCT)
                  IS NOT NULL;
    END;
    /             HTH,
    Thierry

  • Varray of Objects "Bind variable not declared" error.. I don't want a bind variable.

    Hello.
    This program is supposed to pull values from a table using a loop, and in the loop, put the values in objects in a varray.  I'm new to objects and am stumped trying to get this program to run.  When I attempt to run it in SQL*Plus  I get the following feedback:
    Type created.
    Type body created
    SP2-0552: Bind variable "MY_VARRAY_EMP1" not declared.
    I don't think I even need a bind variable.  Any feedback would be appreciated.  Here's the program:
    -- Enable screen I/O
    SET SERVEROUTPUT ON SIZE 1000000
    SET VERIFY OFF
    -- begin object spec
    CREATE OR REPLACE TYPE employee3 AS OBJECT
      ename CHAR (20 char),
      empno NUMBER (4),
      sal NUMBER (10),
      MEMBER FUNCTION get_ename RETURN CHAR, MEMBER PROCEDURE set_ename (SELF IN OUT NOCOPY employee3),
      MEMBER FUNCTION get_empno RETURN NUMBER, MEMBER PROCEDURE set_empno (SELF IN OUT NOCOPY employee3),
      MEMBER FUNCTION get_sal RETURN NUMBER, MEMBER PROCEDURE set_sal (SELF IN OUT NOCOPY employee3)
    -- begin object body
    CREATE OR REPLACE TYPE BODY employee3 AS
      -- gets
      MEMBER FUNCTION get_ename RETURN CHAR IS
      BEGIN
      RETURN self.ename;
      END;
      MEMBER FUNCTION get_empno RETURN NUMBER IS
      BEGIN
      RETURN self.empno;
      END;
      MEMBER FUNCTION get_sal RETURN NUMBER IS
      BEGIN
      RETURN self.ename;
      END;
      -- sets
      MEMBER PROCEDURE set_ename(SELF IN OUT employee3) IS
      BEGIN
      self.ename := ename;
      END;
      MEMBER PROCEDURE set_empno(SELF IN OUT employee3) IS
      BEGIN
      self.empno := empno;
      END;
      MEMBER PROCEDURE set_sal(SELF IN OUT employee3) IS
      BEGIN
      self.sal := sal;
      END;
    END;
    DECLARE
      TYPE emp_varray IS VARRAY(10) OF EMPLOYEE3;
      my_varray_emp1 EMP_VARRAY;
      -- List of EMPNO's in order of appearance in EMP table (for cross-referencing, single-line retrieval)
      TYPE MYCREF_VARRAY IS VARRAY(10) OF NUMBER(4);
      varray_mycref MYCREF_VARRAY := MYCREF_VARRAY(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
      this_object EMPLOYEE3;
      -- make a variable to store one empno
      thisno NUMBER(4);
      -- make a counter
      counter INT;
      -- query variables for the set calls
      q_ename CHAR(20 CHAR);
      q_empno NUMBER(4);
      q_sal NUMBER(10);
      my_result INT;
    BEGIN
      --my_varray_emp1 := EMP_VARRAY(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
      -- Put the first 10 EMPNO's in my cref array
      SELECT empno BULK COLLECT INTO varray_mycref FROM emp WHERE ROWNUM < 11;
      -- Use a loop to retrieve the first 10 objects in the "emp" table and put them in the varray of objects
      q_ename := NULL;
      q_empno := NULL;
      q_sal := NULL;
      my_result := NULL;
      this_object := NULL;
      counter := 1;
      FOR counter IN 1..10 LOOP
      thisno := varray_mycref(counter);
      this_object := my_varray_emp1(counter);
      SELECT ename INTO q_ename FROM emp WHERE empno = thisno;
      my_result := this_object.set_ename(q_ename, NULL);
      SELECT empno INTO q_empno FROM emp WHERE empno = thisno;
      my_result := this_object.set_empno(q_empno, NULL);
      SELECT sal INTO q_sal FROM emp WHERE empno = thisno;
      my_result := this_object.set_sal(q_sal, NULL);
      END LOOP;
      -- Use another loop to display the information in the reverse order.
      FOR counter in REVERSE 1..10 LOOP
      this_object =: my_varray_emp1(counter);
      dbms_output.put_line((this_object.get_ename()) || CHR(9) || (this_object.get_empno()) || CHR(9) || (this_object.get_sal()));
      END LOOP;
    END;

    Cleaning up your code for errors and eliminating unnecessary complexity...
    Add a user-defined constructor which takes all attributes and calls the "setter" procedures in one trip:
    -- Enable screen I/O
    set SERVEROUTPUT on size 1000000
    set VERIFY off
    -- begin object spec
    create or replace type employee3 as object
      ename CHAR (20 char),
      empno NUMBER (4),
      sal NUMBER (10),
    constructor function employee3(
        self    in out nocopy    employee3,
        aEname    in        char,
        aEmpNo    in        integer,
        aSal    in        number
      return self as result,
      member function get_ename return CHAR, member procedure set_ename (SELF in out nocopy employee3, ename in char),
      member function get_empno return NUMBER, member procedure set_empno (SELF in out nocopy employee3, empno in integer),
      member function get_sal return NUMBER, member procedure set_sal (SELF in out nocopy employee3, sal in integer)
    -- begin object body
    create or replace type body employee3 as
      constructor function employee3(
        self    in out nocopy    employee3,
        aEname    in        char,
        aEmpNo    in        integer,
        aSal    in        number
      return self as result
      is
      begin
        self.set_ename(aEname);
        self.set_empno(aEmpNo);
        self.set_sal(aSal);
        return;
      end;
      -- gets
      member function get_ename return CHAR is
      begin
      return self.ename;
      end;
      member function get_empno return NUMBER is
      begin
      return self.empno;
      end;
      member function get_sal return NUMBER is
      begin
      return self.sal;
      end;
      -- sets
      member procedure set_ename(SELF in out employee3, ename in char) is
      begin
      self.ename := ename;
      end;
      member procedure set_empno(SELF in out employee3, empno in integer) is
      begin
      self.empno := empno;
      end;
      member procedure set_sal(SELF in out employee3, sal in integer) is
      begin
      self.sal := sal;
      end;
    end;
    (Since I don't have EMP handy at the moment, create a simple view instead)
    create or replace view emp
    as
    select    'EMP' || to_char(level) ename
    ,    level + 100 empno
    ,    DBMS_RANDOM.VALUE(25000,75000) sal
    from    DUAL
    connect by
        level <= 20
    Get rid of your loop and individual SELECTs, and replace it with a single SELECT BULK COLLECT INTO...
    declare
      type emp_varray is varray(10) of EMPLOYEE3;
      my_varray_emp1 EMP_VARRAY;
      this_object EMPLOYEE3;
    begin
      -- No need for a loop. Use SELECT BULK COLLECT INTO, together with a user-defined constructor call (since the
      -- user-defined constructor overrides the default constructor we need to call it using named-parameter notation):
      select    new employee3(
                aEname    => e.ename,
                aEmpNo    => e.empno,
                aSal    => e.sal
      bulk collect into
            my_varray_emp1
      from        emp e
      where        rownum <= 10;
      -- Use another loop to display the information in the reverse order.
      for counter in reverse 1..10 loop
      this_object := my_varray_emp1(counter);
      dbms_output.put_line((this_object.get_ename()) || chr(9) || to_char(this_object.get_empno()) || chr(9) || to_char(this_object.get_sal()));
      end loop;
    end;
    EMP10        
    110    60110
    EMP9         
    109    67485
    EMP8         
    108    58242
    EMP7         
    107    47597
    EMP6         
    106    58995
    EMP5         
    105    49098
    EMP4         
    104    47406
    EMP3         
    103    67574
    EMP2         
    102    59663
    EMP1         
    101    52929
    PL/SQL procedure successfully completed.
    Gerard

  • Bind variable not declared

    hi all
    declare jobno number;
    BEGIN
    DBMS_JOB.SUBMIT(:jobno,
    'proc_mvref;',
    SYSDATE, 'SYSDATE + 1');
    commit;
    END;
    when i run this statement,I get the follwing error.
    P2-0552: Bind variable "JOBNO" not declared.
    But I cannot locate the error.
    Thanks in Advance

    variable jobno number
    BEGIN
    DBMS_JOB.SUBMIT(:jobno,
    'proc_mvref;',
    SYSDATE, 'SYSDATE + 1');
    commit;
    END;
    print jobno
    Now it'll work.
    or
    set serveroutput on
    declare jobno number;
    BEGIN
    DBMS_JOB.SUBMIT(jobno, -- note the edit
    'proc_mvref;',
    SYSDATE, 'SYSDATE + 1');
    dbms_output.put_line(jobno);
    commit;
    END;
    This will work too...
    Sybrand Bakker

  • Bind variable not fully enabled

    Hello to everyone.
    I'm debugging a VBA macro with the following code:
    Dim qry_1 As String
    OraDatabase.Parameters.Add "ext_var1", UserForm3.TextBox1.Text, 1
    qry_1 = "begin SELECT max(name) into :clinom FROM sap_customers WHERE & " cust_number = :ext_var1; end;"
    OraDatabase.Parameters.Add "clinom", 0, ORAPARM_OUTPUT
    While executing the last code line i'm receiving the following message:
    OIP-04122:Bind variable not fully enabled
    Can please anyone tell me what am i doing wrong?
    Thanks in advance.
    Octavio

    ORAPARM_OUTPUT isnt defined in vbscript. You need to either define it, or replace it with the defined value like you did with the other parameter.
    ORAPARM_OUTPUT = 2
    Hope it helps
    Greg

  • Error: Javax.mail does not exist, please help

    I have copies mail.jar and activation.jar in the classpath directory as instructed, then try to compile but got the below error: package javax.mail does not exist
    please help.
    G:\CRD>javac SendMailBean.java
    SendMailBean.java:22: package javax.mail does not exist
    import javax.mail.*; //JavaMail packages
    ^
    SendMailBean.java:23: package javax.mail.internet does not exist
    import javax.mail.internet.*; //JavaMail Internet packages
    ^
    SendMailBean.java:43: cannot resolve symbol
    symbol : class Session
    location: class SendMailBean
    Session l_session = Session.getDefaultInstance(l_props, null);
    ^
    SendMailBean.java:43: cannot resolve symbol
    symbol : variable Session
    location: class SendMailBean
    Session l_session = Session.getDefaultInstance(l_props, null);
    ^
    SendMailBean.java:48: cannot resolve symbol
    symbol : class MimeMessage
    location: class SendMailBean
    MimeMessage l_msg = new MimeMessage(l_session); // Create a New message
    ^
    SendMailBean.java:48: cannot resolve symbol
    symbol : class MimeMessage
    location: class SendMailBean
    MimeMessage l_msg = new MimeMessage(l_session); // Create a New message
    ^
    SendMailBean.java:50: cannot resolve symbol
    symbol : class InternetAddress
    location: class SendMailBean
    l_msg.setFrom(new InternetAddress(p_from)); // Set the From address
    ^
    SendMailBean.java:53: package Message does not exist
    l_msg.setRecipients(Message.RecipientType.TO,
    ^
    SendMailBean.java:54: cannot resolve symbol
    symbol : variable InternetAddress
    location: class SendMailBean
    InternetAddress.parse(p_to, false));
    ^
    SendMailBean.java:57: package Message does not exist
    l_msg.setRecipients(Message.RecipientType.CC,
    ^
    SendMailBean.java:58: cannot resolve symbol
    symbol : variable InternetAddress
    location: class SendMailBean
    InternetAddress.parse(p_cc, false));
    ^
    SendMailBean.java:62: package Message does not exist
    l_msg.setRecipients(Message.RecipientType.BCC,
    ^
    SendMailBean.java:63: cannot resolve symbol
    symbol : variable InternetAddress
    location: class SendMailBean
    InternetAddress.parse(p_bcc, false));
    ^
    SendMailBean.java:68: cannot resolve symbol
    symbol : class MimeBodyPart
    location: class SendMailBean
    MimeBodyPart l_mbp = new MimeBodyPart();
    ^
    SendMailBean.java:68: cannot resolve symbol
    symbol : class MimeBodyPart
    location: class SendMailBean
    MimeBodyPart l_mbp = new MimeBodyPart();
    ^
    SendMailBean.java:72: cannot resolve symbol
    symbol : class Multipart
    location: class SendMailBean
    Multipart l_mp = new MimeMultipart();
    ^
    SendMailBean.java:72: cannot resolve symbol
    symbol : class MimeMultipart
    location: class SendMailBean
    Multipart l_mp = new MimeMultipart();
    ^
    SendMailBean.java:83: cannot resolve symbol
    symbol : variable Transport
    location: class SendMailBean
    Transport.send(l_msg);
    ^
    SendMailBean.java:98: cannot resolve symbol
    symbol : class MessagingException
    location: class SendMailBean
    } catch (MessagingException mex) { // Trap the MessagingException Error
    ^
    19 errors

    Another person who doesn't understand how to set CLASSPATH.
    Move those JARs into the same directory as your SendMailBean.java and do it like this:
    javac -classpath .;mail.jar;activation.jar -d . *.java
    java -classpath .;mail.jar;activation.jar SendMailBeanRead how to set CLASSPATH properly:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/classpath.html

  • Java.sql.BatchUpdateException: ORA-01027: bind variables not allowed for da

    Hi guys, I m facing a problem while executing below query .Query is working fine in toad i don't know what is the issue with the code
    <code>
    String url3 = "CREATE OR REPLACE VIEW Table2(PERIOD, YEARS, COST_CENTRE, S_DIR_PERM, S_DIR_CONT, S_INDIR_PERM, S_INDIR_CONT, O_DIR_PERM, O_DIR_CONT, O_INDIR_PERM, O_INDIR_CONT)AS select period, year, cost_center, sum(s_dir_perm), sum(s_dir_cont), sum(s_indir_perm), sum(s_indir_cont), sum(o_dir_perm), sum(o_dir_cont), sum(o_indir_perm), sum(o_indir_cont) from ( select b.period, b.year, a.cost_center, sum(a.perm_dir_hc) as s_dir_perm, sum(a.contract_dir_hc) as s_dir_cont, sum(a.perm_indir_hc) as s_indir_perm, sum(a.contract_indir_hc) as s_indir_cont, 0 as o_dir_perm, 0 as o_dir_cont, 0 as o_indir_perm, 0 as o_indir_cont from ZVHR_ACT_HC_ASOF_FISPRD a, pertable b where to_char(as_of_date, 'mm/dd/yyyy') = b.ENDPERIOD and shift not in ('G','N','O2','O7') and b.endperiod = ? group by b.period, b.year, a.cost_center union select b.period, b.year, a.cost_center, 0 as s_dir_perm, 0 as s_dir_cont, 0 as s_indir_perm, 0 as s_indir_cont, sum(a.perm_dir_hc) as o_dir_perm, sum(a.contract_dir_hc) as o_dir_cont, sum(a.perm_indir_hc) as o_indir_perm, sum(a.contract_indir_hc) as o_indir_cont from ZVHR_ACT_HC_ASOF_FISPRD a, pertable b where to_char(as_of_date, 'mm/dd/yyyy') = b.ENDPERIOD and shift in ('G','N','O2','O7') and b.endperiod = ? group by b.period, b.year, a.cost_center) group by period, year, cost_center";
    PreparedStatement statement3 = connection.prepareStatement(url3);
    statement3.setString(1, "12/10/2008");
    statement3.setString(2, "12/10/2008");
    statement3.addBatch();
    statement3.executeBatch();
    </code>
    i m getting the following error
    java.sql.BatchUpdateException: ORA-01027: bind variables not allowed for data definition operations
    can any1 help me with this.

    Can you explain what you are trying to do from a business perspective?
    If you are creating a view, it doesn't make sense to pass bind variables to that DDL statement. The view definition itself is going to have to end up with hard coded date values there. So what possible benefit is there to using bind variables?
    As an aside, if you are using bind variables and you have DATE columns, you really want to pass in the proper data type (i.e. setDate or setTimestamp rather than setString). Otherwise, Oracle has to do implicit string to date conversion, which depends on the session's NLS settings, which is likely to be different on different client machines and lead to all sorts of odd errors and behaviors down the line.
    Are you trying to build a view that takes parameters? If so, there are a few options for that sort of thing.
    Justin

  • HT201412 my iphone 4s does not start by power switch, it starts when i connect to pc. the proximity sensor is not working. please help

    my iphone 4s does not start by power switch, it starts when i connect to pc. the proximity sensor is not working. please help.

    Sounds like it may be a hardware issue.
    Please contact Apple Support in your country.
    Here is a list of numbers: http://support.apple.com/kb/HE57
    Regards
    J

  • I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

    I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

    I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

  • I have 4s iPhone , I download the iOS 7. Now the front receiver microphone is not working , please help me that how to fix the problem.

    I have 4s iPhone , I download the iOS 7. Now the front receiver microphone is not working , please help me that how to fix the problem.

    I live in South Africa, and I had the same problem with my iPhone 4.
    After weeks of frustration and swearing, I was in the process of restoring my phone to a previous iOS. To do that you need to turn the "Find my iPhone" option off, since i turned it off, my problem was solved. No need to repair anything or revert back to old iOS.
    ***** that i cant use Find my iPhone, but atleast i can use my phone.

  • I installed windows 7 on my macbook pro. all is working but lan adaptor and sound od laptop is not working. please help me or send the link where i can download the these drivers.

    I installed windows 7 on my macbook pro. all is working but lan adaptor and sound od laptop is not working. please help me or send the link where i can download the these drivers.I have lost my resource cd .

    If you are running Lion or Mountain Lion, the drivers are downloaded from within Bootcamp Assistant. If you are running Snow Leopard the drivers are on your Snow Leopard install disk.
    Read the Bootcamp Install Guide for your version of OSx. http://www.apple.com/support/bootcamp/
    Bootcamp questions should be asked in the Bootcamp forum where the Bootcamp gurus hang out https://discussions.apple.com/community/windows_software/boot_camp

  • I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    Plawexki wrote:
    ...  do you know if the contacts, photos, messages etc will be wiped?
    Yes... Everything will be Wiped and Replaced with what is currently on Your Mac.
    SYNCING with iTunes
    See here  >  http://support.apple.com/kb/HT1386
    From Here  >  http://www.apple.com/support/iphone/syncing/
    You may find this information of interest...
    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • HT1918 I would like to change my Visa card from the account but its not changing and the billing information is not changing and I can't purchase any thing from my account its now not usable please help me to solve the problem

    I would like to change my Visa card from the account but its not changing and the billing information is not changing and I can't purchase any thing from my account its now not usable please help me to solve the problem

    You made a purchase and exhausted the credit on your card before it processed. All purchases are final. Contact iTunes Store support. You need to settle up before you can purchase or download anything else.

  • HT4796 I have made a file using the Pages app.I mailed it to a friend.When she tried opening the same file on her pc at home , It did not open.Please help me as to how to open the file in the Microsoft word format on her pc.

    I have made a file using the Pages app.I mailed it to a friend.When she tried opening the same file on her pc at home , It did not open.Please help me as to how to open the file in the Microsoft word format on her pc.

    Send it as a PDF.

Maybe you are looking for