Invalid descriptor index error
hai...
i am having this error..
java.sql.SQLException:[Microsoft][ODBC Microsoft Access Driver]invalid descriptor index.
I am doing RMI application..while i am trying to insert i got this error...
here i paste my code....can anyone help me in finding out error.please...
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:bnk11","","");
Statement max = conn.createStatement();
rs1 = max.executeQuery("Select max(AccountNo) from Customer");
rs1.next();
String maxValue = rs1.getString(1);
int maxx = Integer.parseInt(maxValue);
int max1 = maxx+2;
max2 = Integer.toString(max1);
Statement pin = conn.createStatement();
rs2 = max.executeQuery("Select max(PinNo) from Customer");
rs2.next();
String maxValue1 = rs2.getString(2);
int pinmaxx = Integer.parseInt(maxValue1);
int pinmax1 = pinmaxx+3;
String pinmax2 = Integer.toString(pinmax1);
Statement sm=conn.createStatement();
rs=sm.executeQuery("Select * from Customer");
sm.executeUpdate("insert into Customer values('"+max2+"','"+pinmax2+"','"+c+"','"+d+"','"+e+"','"+f+"','"+g+"','"+h+"','"+i+"')");
conn.close();
Thanks in advance...
In future when you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.
The error is happening here
rs2 = max.executeQuery("Select max(PinNo) from Customer");
rs2.next();
String maxValue1 = rs2.getString(2); // WRONG!You can't get the second column (2). There is only one column in that result set. It should be getXXX(1)
And that's another thing. What in the holy hell are you doing here?
String maxValue = rs1.getString(1);
int maxx = Integer.parseInt(maxValue);
int max1 = maxx+2;Sillyness.
int max1 = rs1.getInt(1)+2;Finally you should look into using PreparedStatements. http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html
Similar Messages
-
Invalid Descriptor Index problem
I'm accessing a SQL Server 7 DB and when i attempt to display an integer with 'rs.getString("newsId")' I get an - 'Invalid Descriptor Index' error on the page. I also tried getInt and getLong, but nothing seems to work. The code works with no errors when i connect to a MS Access DB. Any ideas?
I just found my answer. I noticed a post where the person switched the variables to the order in which they were in the DB and it worked.
Thanks anyway. -
<p>I'm getting the following error:</p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Database Connector Error: '07009:[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index'</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"> </p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="times new roman,times" size="2">when trying to run a report in Crystal 11 (inside of Crystal Report Designer 11)</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"> </p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="times new roman,times" size="2">Please help!!!!!</font></p>
duplicate - please do not post multiple times
-
Getting Invalid Descriptor Index (SQL ERROR) ERROR
Hi,
When i am running this java class then i am fetiching all the values from database table to the CSV file then i am getting the following database error.
import java.io.FileWriter; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import com.fidelity.ftg.ereviewg2.migration.connection.DatabaseConnection; import com.fidelity.ftg.ereviewg2.migration.vo.object.DmUserVO; import com.fidelity.ftg.ereviewg2.migration.vo.table.Iereview.ITMigFilenetAttachErrorVO; /** * @Organization: Fidelity Investments/FTG * @Project: eReview_DataConversion * @File: DatabseFetching.java * @Description: * @date: Oct 28, 2008 * @author: 197881 **/ /** * @author 197881 * */ public class DatabseFetching { /** * @param args */ public static void main(String[] args) throws SQLException, Exception { // TODO Auto-generated method stub DatabaseConnection con = new DatabaseConnection(); Connection connection = con.getConnection(); String AttachId=null; StringBuffer buffer = new StringBuffer(); String tMigFilenetAttachErrorColumnName[] = { ITMigFilenetAttachErrorVO.PIECE_ID, ITMigFilenetAttachErrorVO.PIECE_NUM, ITMigFilenetAttachErrorVO.PIECE_VER, ITMigFilenetAttachErrorVO.PIECE_INSTANCE, ITMigFilenetAttachErrorVO.ATTACH_ID, ITMigFilenetAttachErrorVO.ERROR_CD, ITMigFilenetAttachErrorVO.ERROR_REASON }; FileWriter createCsvFileObj = new FileWriter("D:/TCS/1.csv"); String SQL = "select * from t_mig_filenet_attach_error"; Statement stmt = connection.createStatement(); ResultSet resultObj = stmt.executeQuery(SQL); while (resultObj.next()) { AttachId=resultObj.getString("attach_id"); if(AttachId.equals("attacha")) { System.out.println("attach id is"+AttachId); for (int i = 0; i < tMigFilenetAttachErrorColumnName.length; i++) { buffer.append(resultObj.getString(tMigFilenetAttachErrorColumnName));
buffer.append(",");
buffer.append("falure");
buffer.append("\n");
createCsvFileObj.write(buffer.toString());
createCsvFileObj.close();
*{color:#ff0000}********************ERROR*************************{color}* *{color:#ff0000}{color:#000000}# Connected to Database: sun.jdbc.odbc.JdbcOdbcConnection@a62fc3* *attach id isattacha* *{color}Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index* * at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)* * at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)* * at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(Unknown Source)* * at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(Unknown Source)* * at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)* * at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)* * at DatabseFetching.main(DatabseFetching.java:58){color}*The columns from the ResultSet must be retrieved in the order in which they appear in the table. Say your table has columns Name, Address, City. Then you should retrieve them as:
ResultSet.getString("Name");
ResultSet.getString("Address");
ResultSet.getString("City");
Otherwise you will get an Invalid Descriptor Index.
Like this:
ResultSet.getString("Address");
ResultSet.getString("Name");
ResultSet.getString("City");
Invalid Descriptor Index -
Sybase ASE 15.7.103 ODBC Driver invalid descriptor index
Hey guys,
after migration from oracle nuc to sybase ase 15.7.101 unicode and implementation of sapnote 1558958 (dbacockpit collection for NW 702) there were everything which was in dbacockpit displayed ok.
After upgrade to patch 103 theres a problem in the dbacockpit. I will show in the register Database SID - Space - Tables and Indices - Tables.
After I select this. There comes follwing error: ASE Error SQL30013:07009][SAP][ASE ODBC Driver]Invalid descriptor index.
In error details I see SQLCode 30013
The Database ist open and there are no other kown problems with connection. SAP could establish connection to sybase ase database and users can work normally.
In the dbacockpit Database SID - Space - Devices and Databases are shown without problems.
message details:
Exception CX_DBA_ADBC in class CL_SYB_RDI_QUERY method GET_TABLES_SPACE line 217
Kernel Error ID:
WP ID: 4
WP PID: 4272
SYSID: SE1
SY-SUBRC: 0
SQL statement: SELECT TOP 50 DBNAME, USER_NAME AS TABOWNER, TAB_NAME AS TABNAME, ' ' AS PARTITIONNAME, 0 AS ID, 0 AS PARTITIONID, ' ' AS SNAPSHOT_TIMESTAMP, ' ' AS TIMESTAMP_FROM, ' ' AS TIMESTAMP_TO, SUM(TIME_PERIOD) AS TIME_PERIOD, AVG(ROW_COUNT) AS ROW_COUNT, MAX(ROW_COUNT) AS ROW_COUNT_MAX, AVG(TAB_RESERVED_LOB_KB) AS TAB_RESERVED_LOB_KB, MAX(TAB_RESERVED_LOB_KB) AS TAB_RESERVED_LOB_KB_MAX, AVG(TAB_USED_LOB_KB) AS TAB_USED_LOB_KB, MAX(TAB_USED_LOB_KB) AS TAB_USED_LOB_KB_MAX, AVG(TAB_DATA_LOB_KB) AS TAB_DATA_LOB_KB, MAX(TAB_DATA_LOB_KB) AS TAB_DATA_LOB_KB_MAX, AVG(TAB_DATA_UTL_KB) AS TAB_DATA_UTL_KB, MAX(TAB_DATA_UTL_KB) AS TAB_DATA_UTL_KB_MAX, AVG(TAB_DATAPGCLRATIO)*100 AS TAB_DATAPGCLRATIO, MIN(TAB_DATAPGCLRATIO)*100 AS TAB_DATAPGCLRATIO_MIN, AVG(TAB_LRGIOEFF)*100 AS TAB_LRGIOEFF, MIN(TAB_LRGIOEFF)*100 AS TAB_LRGIOEFF_MIN, AVG(DATACHANGE) AS DATACHANGE, MAX(DATACHANGE) AS DATACHANGE_MAX, AVG(forwrowcnt) AS forwrowcnt, MAX(forwrowcnt) AS forwrowcnt_MAX, AVG(delrowcnt) AS delrowcnt, MAX(delrowcnt) AS delrowcnt_MAX, AVG(extent0pgcnt) AS extent0pgcnt, MAX(extent0pgcnt) AS extent0pgcnt_MAX, AVG(oamapgcnt) AS oamapgcnt, MAX(oamapgcnt) AS oamapgcnt_MAX, AVG(oampagecnt) AS oampagecnt, MAX(oampagecnt) AS oampagecnt_MAX, MAX(str_replace(str_replace(str_replace(convert(VARCHAR(19),statmoddate,23),':',NULL),'-',NULL),'T',NULL)) AS statmoddate, AVG(datarowsize) AS datarowsize, MAX(datarowsize) AS datarowsize_MAX, AVG(TAB_DATA_TOTAL_KB) AS TAB_DATA_TOTAL_KB, MAX(TAB_DATA_TOTAL_KB) AS TAB_DATA_TOTAL_KB_MAX, AVG(TAB_DATA_UTL_TOTAL_KB) AS TAB_DATA_UTL_TOTAL_KB, MAX(TAB_DATA_UTL_TOTAL_KB) AS TAB_DATA_UTL_TOTAL_KB_MAX, AVG(TAB_USED_TOTAL_KB) AS TAB_USED_TOTAL_KB, MAX(TAB_USED_TOTAL_KB) AS TAB_USED_TOTAL_KB_MAX, AVG(TAB_RESERVED_TOTAL_KB) AS TAB_RESERVED_TOTAL_KB, MAX(TAB_RESERVED_TOTAL_KB) AS TAB_RESERVED_TOTAL_KB_MAX, AVG(TAB_UNUSED_TOTAL_KB) AS TAB_UNUSED_TOTAL_KB, MAX(TAB_UNUSED_TOTAL_KB) AS TAB_UNUSED_TOTAL_KB_MAX FROM ( SELECT DBNAME, USER_NAME, TAB_NAME, SNAPSHOT_TIMESTAMP AS SNAPSHOT_TIMESTAMP, SUM(TIME_PERIOD) AS TIME_PERIOD, SUM(ROW_COUNT) AS ROW_COUNT, SUM(TAB_RESERVED_LOB_KB) AS TAB_RESERVED_LOB_KB, SUM(TAB_USED_LOB_KB) AS TAB_USED_LOB_KB, SUM(TAB_DATA_LOB_KB) AS TAB_DATA_LOB_KB, SUM(TAB_DATA_UTL_KB) AS TAB_DATA_UTL_KB, CASE WHEN SUM(ROW_COUNT) > 0 THEN SUM(ROW_COUNT*TAB_DATAPGCLRATIO) / SUM(ROW_COUNT) ELSE 1 END AS TAB_DATAPGCLRATIO, CASE WHEN SUM(ROW_COUNT) > 0 THEN SUM(ROW_COUNT*TAB_LRGIOEFF) / SUM(ROW_COUNT) ELSE 1 END AS TAB_LRGIOEFF, CASE WHEN SUM(ROW_COUNT+delrowcnt) > 0 THEN SUM((ROW_COUNT+delrowcnt)*DATACHANGE) / SUM(ROW_COUNT+delrowcnt) ELSE 0 END AS DATACHANGE, SUM(forwrowcnt) AS forwrowcnt, SUM(delrowcnt) AS delrowcnt, SUM(extent0pgcnt) AS extent0pgcnt, SUM(oamapgcnt) AS oamapgcnt, SUM(oampagecnt) AS oampagecnt, MAX(statmoddate) AS statmoddate, CASE WHEN SUM(ROW_COUNT) > 0 THEN SUM(ROW_COUNT*datarowsize) / SUM(ROW_COUNT) ELSE 0 END AS datarowsize, SUM(TAB_DATA_KB+TAB_DATA_LOB_KB) AS TAB_DATA_TOTAL_KB, SUM(TAB_DATA_UTL_KB+TAB_DATA_LOB_KB) AS TAB_DATA_UTL_TOTAL_KB, SUM(TAB_USED_KB+TAB_USED_LOB_KB) AS TAB_USED_TOTAL_KB, SUM(TAB_RESERVED_KB+TAB_RESERVED_LOB_KB) AS TAB_RESERVED_TOTAL_KB, SUM((TAB_RESERVED_KB+TAB_RESERVED_LOB_KB) - (TAB_USED_KB+TAB_USED_LOB_KB)) AS TAB_UNUSED_TOTAL_KB FROM saptools..DBH_STG_TABLES WHERE SNAPSHOT_TIMESTAMP >= dateadd(ss,TIME_PERIOD,?) AND SNAPSHOT_TIMESTAMP <= dateadd(ss,5,?) AND BDOP = 1 AND BDOI = 0 GROUP BY DBNAME, USER_NAME, TAB_NAME, SNAPSHOT_TIMESTAMP ) AS STD_AGGR GROUP BY DBNAME, USER_NAME, TAB_NAME ORDER BY TAB_RESERVED_TOTAL_KB DESC AT ISOLATION READ UNCOMMITTED
Database: +++SYBADM
caused by
Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
Kernel Error ID:
DB Error: Yes
SQL Code: 30013
SQL Message: [ASE Error SQL30013:07009][SAP][ASE ODBC Driver]Invalid descriptor index
DB Object Exists: No
Duplicated Key: No
Internal Error: 1
Invalid Cursor: No
Unknown Connection: No
Connection Closed: NoThanks Mr Model-Bosch,
we have installed the latest dbsl Patch 213. And we have installed the Patch Collection twice as described in SAP Note 1558958.
So I have to wait. I hope my SAP Message will be edited soon. -
Strange - Invalid Descriptor Index
Hello everyone,
When I run the following code I get an Invalid Descriptor Index.
//////////////////CODE////////////
Object answer = JOptionPane.showInputDialog(this, "Enter Employee Name", "Search Records", JOptionPane.OK_CANCEL_OPTION);
String query = ("SELECT * FROM tblEmployee WHERE employeeName = " + "'" + answer.toString() + "'");
results = stmt.executeQuery(query);
tfModField1.setText(results.getString(0));
tfModField2.setText(results.getString(1));
tfModField3.setText(results.getString(2));
tfModField4.setText(results.getString(3));
tfModField5.setText(results.getString(4));
I know this error is usually caused by trying to use the columns in a different order than they were called by the query, but how does this apply when you want to select all of the columns? If anyone can help with this I would greatly appreciate it.
Regards,
Michael FinleyI have also tried the following, which generates an Invalid Cursor State error
//////////CODE/////////
Object answer = JOptionPane.showInputDialog(this, "Enter Employee Name", "Search Records", JOptionPane.OK_CANCEL_OPTION);
String query = ("SELECT employeeName, employeePW, employeeSecurity, employeeTickets, employeeStatus FROM tblEmployee WHERE employeeName = " + "'" + answer.toString() + "'");
JOptionPane.showMessageDialog(this, query);
results = stmt.executeQuery(query);
tfModField1.setText(results.getString("employeeName"));
tfModField2.setText(results.getString("employeePW"));
tfModField3.setText(results.getString("employeeSecurity"));
tfModField4.setText(results.getString("employeeTickets"));
tfModField5.setText(results.getString("employeeStatus"));
Again, I'm stumped.
Regards,
Mike Finley -
I am using MS Sql Server 2000. I am getting following error while trying to retrieve records.
javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.modiimptrans_jsp._jspService(modiimptrans_jsp.java:126)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
root cause
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3908)
sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5699)
sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:353)
sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:410)
org.apache.jsp.modiimptrans_jsp._jspService(modiimptrans_jsp.java:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)Gave up to use odbc jdbc bridge driver for MS SQLServer. Then try:
http://jtds.sourceforge.net/
or
http://www.microsoft.com/downloads/details.aspx?FamilyID=4F8F2F01-1ED7-4C4D-8F7B-3D47969E66AE&displaylang=en
Then your issue should disappear. -
Invalid Descriptor Index After First Record
recordCount = 1;
if(rs != null)
rs.last();
totalRows = rs.getRow();
rs.first();
System.out.println("Total Rows: "+totalRows);
if (rs != null) while ( rs.next() )
hasResults = true;
for(rowCount = 0; rowCount < totalRows; rowCount++)
for(columnCount = 0; columnCount < 9; columnCount++)
SearchMenu.fieldArray[rowCount][columnCount].setText(rs.getString(recordCount));
recordCount++;
}I am using the above code to read and display data in a 20 row 9 column array of text fields. The database has 9 columns. The first record in a query is displaying correctly, but then I get Invalid Descriptor Index (and no more records are displayed). Can anyone help? Thanks a bunch.I went ahead and tried resetting the recordCount to 1
after each row like you suggested, but that produced
the same error and problem. Then you have another problem. But I doubt this is happening.
It is my understanding
that the first object in the resultset's second row
is one past the last object of the first row, so
resetting this count doesn't make sense to me
anyway.I don't know what you mean exactly but I am pretty sure this is wrong.
Try this.
recordCount = 1;
if(rs != null)
rs.last();
totalRows = rs.getRow();
rs.first();
System.out.println("Total Rows: "+totalRows);
if (rs != null) while ( rs.next() )
hasResults = true;
recordCount = 1;//new line here!
for(rowCount = 0; rowCount < totalRows; rowCount++)
for(columnCount = 0; columnCount < 9; columnCount++)
SearchMenu.fieldArray[rowCount][columnCount].setText(rs.getString(recordCount));
recordCount++;
} -
Invalid column Index error - While consuming Calculation view via Native SQL
Hi Experts,
I am trying to consume a Calculation view (sql script one) , which has input parameters, via Native SQL in a ABAP program .
Code snippet for the same would be as follows , Upon execution, it throws an error "Invalid Column Index (8) error " . Can anyone help what could be the issue here ?
Thanks in Advance,
Suma
REPORT ZTEST_HANA2.
*Report to consume Calculation view (script based) from ABAP
PARAMETERS: ip_docnr type BELNR_D,
ip_gjahr type GJAHR,
ip_bukrs type BUKRS,
ip_blgr type FAGL_RLDNR.
DATA: LO_SQL_STMT TYPE REF TO CL_SQL_STATEMENT,
LO_CONN TYPE REF TO CL_SQL_CONNECTION,
LO_RESULT TYPE REF TO CL_SQL_RESULT_SET,
LV_SQL TYPE STRING,
LR_DATA TYPE REF TO DATA.
DATA: LX_SQL_EXC TYPE REF TO CX_SQL_EXCEPTION,
LT_SEPMAPPS_CLSDINV TYPE TABLE OF SEPMAPPS_CLSDINV,
LV_TEXT TYPE STRING.
TRY.
lv_sql = |SELECT * FROM "_SYS_BIC"."DEMO-ABAP/CA_GET_FI_DATA" | &&
|WITH PARAMETERS ('placeholder'= ('$$p_DOCNR$$','{ ip_docnr }'),| &&
|'placeholder'=('$$p_GJAHR$$','{ ip_gjahr }')| &&
|,'placeholder'= ('$$S_BUKRS$$','{ ip_bukrs }')| &&
|,'placeholder'= ('$$p_base_ledger$$','{ ip_blgr }') )| .
LO_CONN = CL_SQL_CONNECTION=>GET_CONNECTION( ).
"Create an SQL statement to be executed via the connection
LO_SQL_STMT = LO_CONN->CREATE_STATEMENT( ).
"Execute the native SQL query
LO_RESULT = LO_SQL_STMT->EXECUTE_QUERY( LV_SQL ).
"Read the result into the internal table lt_sepmapps_clsdinv
GET REFERENCE OF LT_SEPMAPPS_CLSDINV INTO LR_DATA.
LO_RESULT->SET_PARAM_TABLE( LR_DATA ).
LO_RESULT->NEXT_PACKAGE( ).
LO_RESULT->CLOSE( ).
LO_CONN->CLOSE( ).
CATCH CX_SQL_EXCEPTION INTO LX_SQL_EXC.
LV_TEXT = LX_SQL_EXC->GET_TEXT( ).
MESSAGE LV_TEXT TYPE 'E'.
ENDTRY.Hi Suma,
Post the SQL you success run directly on Studio together with error message (even if is the Invalid column index error).
Check there if the parameters case is working properly... Is it really this confusing options:
p_GJAHR
S_BUKRS
p_base_ledger
Why not all lower or all upper? Anyhow you must test and find which option works according your modeling
Regards, Fernando Da Rós -
Hi all,
I am trying to create a new report using
1. Crystal Report XI
2. Oracle 9i
3. A stored Procedure
4. JDBC connection.
But i could not do it.
Invalid Column index error is coming.
Can anyone help.
Thanks
Saravanakumar.I know this is an old thread but I too am getting a column index error accessing an Oracle 10g database stored procedure using Crystal Reports XI, using the New Report wizard to select the stored procedure. It prompts me for the sp parameters; I select "set to null" and click OK and get
Failed to retrieve data from the database. Details: SQL Exception: [SQL State:] null [Error message:] Invalid Column Index [Database vendor code 17003]
I can run the procedure and get data just fine with no errors using PL/SQL. -
Hi All,
The Actual query to perform is below.
SELECT name,number from emp WHERE CASE WHEN :1='T' AND term_date IS Not NULL THEN 1 WHEN :1='A' AND term_date IS NULL THEN 1 WHEN :1='ALL' THEN 1 ELSE 1 END = 1;
I have tried in DB adapter like below as a parameter for :1 as #vInputParam
SELECT name,number from emp WHERE CASE WHEN #vInputParam='T' AND term_date IS Not NULL THEN 1 WHEN #vInputParam='A' AND term_date IS NULL THEN 1 WHEN #vInputParam='ALL' THEN 1 ELSE 1 END = 1;
Getting Error code :17003 .java.sql.SQLException: Invalid column index error.
Please suggest me on using ':' bind character in DB adapter Select Query SOA11g.
Can someone help me on this please?
Thanks,
HariHi,
Could you please make sure your binding style(Oracle Positional,Oracle named..etc) of the Seeded VO and Custom Vo are same.
This is the option you will get when you are extending your vo. So make sure that both are same.
You can refer the below link too
VO extension leads to "Invalid column index" exception
Thanks
Bharat -
Invalid column index error in sql developer
Hi,
I was trying to create stored procedures, functions and packages in sql developer which is connected to Oracle 11g. My instructor is able to execute all of them without any errors in 10g. However, when I try to execute them, I get- "Invalid column index error". Any suggestions on how to rectify this error?Hi,
That is probably an
ORA-17003: Invalid column index
Which is a JDBC error. Is Java/JDBC somehow involved?
If not, could you please post one of the failing statements?
Regards
Peter -
Oracle DB Query Generating Invalid Column Index error
Dear All,
Apologies for a question on this rather basic error but I don't understand why i'm experiencing the behaviour described.
The piece of code below connects to a database, runs a query, then attempts to display the contents of the resultset. I understand from other posts on the topic that the query I am executing (INSERT INTO table VALUES (...)) as in the comments below needs to have autocommit disabled to allow me to access the resultset without the transaction closing.
public void runQuery(String query) throws Exception { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con = DriverManager.getConnection(database, username, password); con.setAutoCommit(false); Statement st = con.createStatement(); ResultSet rs = st.executeQuery (query); // "select * from user_tables" // "INSERT INTO BH VALUES ('','2.25','Dark Red','Samsonite','4987638762')" while (rs.next()) { System.out.print (rs.getString(1)); // Exception thrown here } con.commit(); st.close(); con.close(); }
I have removed try {} catch {} error handling for clarity.
I am receiving the invalid column index error from the indicated line, which clearly suggest column 1 doesn't exist, however if i run the same query in another tool, something like the following is returned:
Rows Affected
1
The query is being received by the database as the row ends up in the table intact, so I am clearly missing something about how to access the resultset correctly.
I am guessing that I am either misusing/misunderstanding the autocommit option or that the resultset is different to what I am expecting...
Can someone please shed a little light?
Many thanks!
GeorgeOk, I've done a little more digging, and i've come to the conclusion that an INSERT query doesn't return a resultset (or returns an empty one)
Could someone with a little more knowledge confirm this as I've had little luck finding an explicit yes or no from the web!
Many Thanks in advance... -
Invalid Descriptor Index - darn SQL2000
I'd like to first off say that I would much rather be using MySQL than SQL2000 but I have no choice. My boss is a Microsoft freak. eeuuuwww!!!
Ok, my question. I have a table with approx 150 fields and I get an Invalid Descriptor Index when I use "SELECT * FROM". I know that the reason is because I have to list every field in the order of return but there are so many and if they are null then they are not displayed (thanx dreamweaver).
When I run the query off the SQL2000 manager, it works without a problem.
Is there a way to get this to work without typing out all 150 fields?
Thanx,
PhilipI'd like to first off say that I would much rather be
using MySQL than SQL2000 but I have no choice. My
boss is a Microsoft freak. eeuuuwww!!!
And apparently you (or perhaps even your boss) does not understand the power of stored procedures, triggers, etc.
>
Ok, my question. I have a table with approx 150
fields and I get an Invalid Descriptor Index when I
use "SELECT * FROM". I know that the reason is
because I have to list every field in the order of
return but there are so many and if they are null then
they are not displayed (thanx dreamweaver).
When I run the query off the SQL2000 manager, it works
without a problem.
Is there a way to get this to work without typing
out all 150 fields? Well you would never 'type' them out anyways. You would simply use Enterprise Manager to export the schema and then just use that when building the select.
Of course I would guess something is seriously wrong when you need to access 150 fields in the first place. Not to mention if they are in a single table. -
Invalid Descriptor Index (SQL exception)
Hi Defts,
im developing an application using swings, im getting an Invalid Descriptor Index (SQL exception). I have given my code below kindly help me out.
private void formWindowActivated(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
try
Class.forName("sun.jdbc.odbc.JdbcOdbc");
Connection con = DriverManager.getConnection("jdbc:odbc:tourismdatasource", "sa", "");
String sel= "select * from tab_places where place_ID=?";
PreparedStatement ps=con.prepareStatement(sel);
ps.setString(1, jTextField4.getText().toString().trim());
ResultSet rs=ps.executeQuery();
if(rs.next())
jTextField1.setText(rs.getString("place_name").toString());
jTextField2.setText(rs.getString("state").toString());
jTextField3.setText(rs.getString("category").toString());
jTextArea1.setText(rs.getString("place_des").toString());
catch(SQLException se){JOptionPane.showMessageDialog(null, se.getMessage());}
catch(ClassNotFoundException ce){JOptionPane.showMessageDialog(null, ce.getMessage());}
}It would help to know what statement is throwing the exception. The stack trace tells you that.
As a guess the "select *" is returning the columns in a specific order. You are not calling getString() in that order though.
Or one of the getString() values is wrong.
And get rid of the ToString() calls on the getString() methods - they are already strings.
Maybe you are looking for
-
Sat Pro A60: ati2dvag display driver not working properly
help.... i know very little about computer and need to know what, how and where i can get a solution to this problem. It occurs more and more frequently now, it messes up the display and i have to restart only for it to happen again. i tried to down
-
hi i am working on an enhancement within cif to transfer material master in ecc to scm . i need to check if mrp view exists or no for every material transferred. now how do i do this coding wise ? which field or table do i need to check if mrp view
-
Problem to run Flightgear 2.6
i have the next problem after install flightgear 2.6 in my system with intel grafics 32-bits FlightGear has worked perfect in windows and ubuntu on the same machine. KI266 dme indicator #0 initialized loading scenario 'nimitz_demo' creating 3D noise
-
When I try to start up SAFARI it wont work?!?!?!?!
When I try to open up safari it comes up witha a grey screen that has the back and forward buttons and the bookmarks button. like so THIS IT WHAT SAFARI LOOKS LIKE
-
Just purchased a new playbook, I decided to download a TV app. It downloaded now problem and shows up in MY World list of Apps but it doesn't show on home page, what do I need to do to fix it?