Results 1 to 3 of 3

Thread: SQL0301N error

  1. #1
    Join Date
    Jan 2003
    Posts
    2

    Question Unanswered: SQL0301N error

    Hi,

    Below is my sql statment.

    select * from document ref where ref.doc_id = ? order by ref.doc_version ASC

    I replace doc_id and excute the query with the following statements.

    PreparedStatement sp=null;
    sp = dbConn.prepareStatement("select * from document ref where ref.doc_id = ? order by ref.doc_version ASC");
    sp.setInt(1, docId);
    result = sp.executeQuery();

    DOC_ID is declared as INTEGER in the DOCUMENT table and doc_id which i am passing to the query is int. It work fine sometimes but sometimes I get SQL0301N error. I have scratched my hear over this too much. Please help me ...

    Thanks

  2. #2
    Join Date
    Sep 2002
    Posts
    3

    Re: SQL0301N error

    Hi,

    ensure that an integer is always assigned to the variable DOC_ID before using it.

    wbr

    aman


    Originally posted by prabhakar1000
    Hi,

    Below is my sql statment.

    select * from document ref where ref.doc_id = ? order by ref.doc_version ASC

    I replace doc_id and excute the query with the following statements.

    PreparedStatement sp=null;
    sp = dbConn.prepareStatement("select * from document ref where ref.doc_id = ? order by ref.doc_version ASC");
    sp.setInt(1, docId);
    result = sp.executeQuery();

    DOC_ID is declared as INTEGER in the DOCUMENT table and doc_id which i am passing to the query is int. It work fine sometimes but sometimes I get SQL0301N error. I have scratched my hear over this too much. Please help me ...

    Thanks

  3. #3
    Join Date
    Jan 2003
    Posts
    2

    Re: SQL0301N error

    Originally posted by aman
    Hi,

    ensure that an integer is always assigned to the variable DOC_ID before using it.

    wbr

    aman
    Hi Thanks for your reply. I am assging an int always. It works sometimes but sometimes it fails.

    Vijay

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •