ORA-01008: not all variables bound .

ORA-01008: not all variables bound .

Post by perseu » Wed, 13 Mar 2002 21:06:28



Hi all, I've got a function like this

    public double getSectionTotalManday(Connection conn,   String section,
String sub_section,

GregorianCalendar ReqPeriod,
            String reportsTo) throws SQLException {
            StringBuffer sqlBuffer = new StringBuffer(1024);

            sqlBuffer.append("SELECT * FROM EA_MR_DTL_TBL dtl ");
            sqlBuffer.append("WHERE dtl.SECTION = ? ");

            PreparedStatement stmt =
conn.prepareStatement(sqlBuffer.toString());
            int i = 0;
            stmt.setString(++i, section);

            ResultSet rslt = stmt.executeQuery(sqlBuffer.toString());
            return -1;
 }

working with table EA_MR_DTL_TBL {
...
 section                         VARCHAR2(5) NOT NULL,
...

Quote:}

but when I do call this in JSP , I got ORA-01008: not all variables bound .

Why's that ? Thanks .

Perseus

 
 
 

ORA-01008: not all variables bound .

Post by Lee Fesperma » Thu, 14 Mar 2002 09:17:44



> Hi all, I've got a function like this

>     public double getSectionTotalManday(Connection conn,   String section,
> String sub_section,

> GregorianCalendar ReqPeriod,
>             String reportsTo) throws SQLException {
>             StringBuffer sqlBuffer = new StringBuffer(1024);

>             sqlBuffer.append("SELECT * FROM EA_MR_DTL_TBL dtl ");
>             sqlBuffer.append("WHERE dtl.SECTION = ? ");

>             PreparedStatement stmt =
> conn.prepareStatement(sqlBuffer.toString());
>             int i = 0;
>             stmt.setString(++i, section);

>             ResultSet rslt = stmt.executeQuery(sqlBuffer.toString());

Use instead:

            ResultSet rslt = stmt.executeQuery();

Note: the prepareStatement() has already received and prepared the sql comand.

Quote:>             return -1;
>  }

> working with table EA_MR_DTL_TBL {
> ...
>  section                         VARCHAR2(5) NOT NULL,
> ...
> }

> but when I do call this in JSP , I got ORA-01008: not all variables bound .

> Why's that ? Thanks .

You're using the wrong version of executeQuery().

--
Lee Fe*an, FFE Software, Inc. (http://www.veryComputer.com/)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS  (http://www.veryComputer.com/)

 
 
 

ORA-01008: not all variables bound .

Post by Avi Abram » Thu, 14 Mar 2002 11:07:02



> Hi all, I've got a function like this

>     public double getSectionTotalManday(Connection conn,   String section,
> String sub_section,

> GregorianCalendar ReqPeriod,
>             String reportsTo) throws SQLException {
>             StringBuffer sqlBuffer = new StringBuffer(1024);

>             sqlBuffer.append("SELECT * FROM EA_MR_DTL_TBL dtl ");
>             sqlBuffer.append("WHERE dtl.SECTION = ? ");

>             PreparedStatement stmt =
> conn.prepareStatement(sqlBuffer.toString());
>             int i = 0;
>             stmt.setString(++i, section);

>             ResultSet rslt = stmt.executeQuery(sqlBuffer.toString());
>             return -1;
>  }

> working with table EA_MR_DTL_TBL {
> ...
>  section                         VARCHAR2(5) NOT NULL,
> ...
> }

> but when I do call this in JSP , I got ORA-01008: not all variables bound .

> Why's that ? Thanks .

> Perseus

Hi Perseus,
Just a wild guess, but maybe the value of your method parameter
"section" is null?

Good Luck,
Avi.

 
 
 

1. Urgent !!!! -- ORA-01008: not all variables bound

Hi All,
In my application, at runtime, I am getting the following exception:

Description: Class: FdpMbrDatesData Method: executeQuery() :
SQLException
java.sql.SQLException: ORA-01008: not all variables bound

I am not able to guess what is the problem with the following portion
of the code.

pstmt = rO_conn.prepareStatement(lS_SQLStatement);

pstmt = this.setBindParams(pstmt);

int ii_position = 1;
//set timestamp of query; Take stamp before query as this is the most
conservative view

super.setSQLDateTimeStamp(new java.util.Date());
rs = pstmt.executeQuery();

While crossing the "pstmt.executeQuery()" it is throwing the above
exception.

It is very Urgent...If any body have any idea please let me know.

Thanks in advance,

Shanmugam.

--
Posted via http://dbforums.com

2. OpenRecordSet problem

3. ORA-01008: not all variables bound

4. Saving objects to a relational database (Access)

5. ORA-01008 not all variables bound ?

6. WA, OR-FLOW MANUFACTURING GURU

7. ORA-01008: not all variables bound error in WebLOgic connection pooling

8. Dynamic CREATE TABLE syntax question

9. ORA-03106 alt. ORA-01008

10. OCI: Binding collections (varray), Ora 1008: not all variables bound

11. sql loader and ora-01008 (cross posted to tools)