Invalid column name when executing explain plan
SQL Developer version 4.0, SQL Worksheet, Windows 2000, Database 9.2.0.6.
When attempted to run a explain plan on a simple two table join query, it generates error invalid column name. Removed aliases and simplify query to one table row count, and still get the same error. Even tried the schema owner and got the same error.
I decided to check the explain plan table and found out that it was from an older version. Recreated the explain plan table and was able to run the explain plan.
I'm just posting this in the event somebody else runs into the same problem.
This was fixed in the 4.1 or 1215 build. Please update by downloading or check for updates.
-thanks
kris
Similar Messages
-
"Invalid column name" when restoring SAP DM IFRS Starter Kit
I want to share an issue that we came across when restoring the SAP Disclosure Management IFRS Starter Kit. Namely when trying to restore it on an environment we got the following error:
Server Error in '/' Application.
Invalid column name 'AccountExpirationDate'.
Invalid column name 'PasswordChangedDate'.
Invalid column name 'LastSuccessfulLoginDate'.
In our case, after getting this error we tried restoring the SK on SAP Disclosure Management SP06 and it turned out to work ok so hope that this solves it for anyone else stuck at the sameHi Rajneesh,
Check whether you have both the row-axis and column-axis of the input template through 'edit report'.
Probably your input template has some member dimensions missing in your template.
We have faced the same problem before and corrected it.
This error occurs sometimes when we create a input template by clearing defining the row & column axis in the template but afterwards try some EPMOlapmember in any axis by deleting the original report elements.
So check the input template once again. I think you will track the error.
Regards,
Bishwajit -
Invalid Object Name When Executing from Report Manager
I ran some code to create a modified view of ExecutionLog3 on a SQL Server 2012 instance. The ReportServer and ReportServerTempDB were transferred from a 2005 instance and are still on that compatibility level. After creating the new view, I
created a report in SSDT and it runs fine. I deployed the dataset followed by the report. I went to Report Manager to test it and the report fails with the following:
An error has occurred during report processing. (rsProcessingAborted)
The execution failed for the shared data set
'ExecutionLog'. (rsDataSetExecutionError)
Query execution failed for dataset ''. (rsErrorExecutingCommand)
Invalid object name 'ExecutionLog3_Modified'.
The code for the view is below and it came from MSSQLTips. Why does the report run fine from SSDT and fail in Report Manager?
USE [ReportServer]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[ExecutionLog3_Modified]
AS
SELECT
EL.InstanceName,
COALESCE(C.Path, 'Unknown') AS ItemPath,
EL.UserName,
EL.ExecutionId,
CASE(EL.RequestType)
WHEN 0 THEN 'Interactive'
WHEN 1 THEN 'Subscription'
WHEN 2 THEN 'Refresh Cache'
ELSE 'Unknown'
END AS RequestType,
-- SubscriptionId,
EL.Format,
Parameters,
CASE(EL.ReportAction)
WHEN 1 THEN 'Render'
WHEN 2 THEN 'BookmarkNavigation'
WHEN 3 THEN 'DocumentMapNavigation'
WHEN 4 THEN 'DrillThrough'
WHEN 5 THEN 'FindString'
WHEN 6 THEN 'GetDocumentMap'
WHEN 7 THEN 'Toggle'
WHEN 8 THEN 'Sort'
WHEN 9 THEN 'Execute'
ELSE 'Unknown'
END AS ItemAction,
EL.TimeStart,
YEAR(EL.TimeStart) AS Start_Year,
MONTH(EL.TimeStart) AS Start_Month,
DATENAME(MONTH,EL.TimeStart) AS Start_Month_Name,
DATENAME(DW,EL.TimeStart) AS Start_Day_Of_Week,
DATEPART(WEEKDAY,EL.TimeStart) AS Start_Day_Number_of_Week,
EL.TimeEnd,
EL.TimeDataRetrieval,
EL.TimeProcessing,
EL.TimeRendering,
CASE(EL.Source)
WHEN 1 THEN 'Live'
WHEN 2 THEN 'Cache'
WHEN 3 THEN 'Snapshot'
WHEN 4 THEN 'History'
WHEN 5 THEN 'AdHoc'
WHEN 6 THEN 'Session'
WHEN 7 THEN 'Rdce'
ELSE 'Unknown'
END AS Source,
EL.Status,
EL.ByteCount,
EL.[RowCount],
EL.AdditionalInfo,
C.Name,
C.CreatedByID,
C.ModifiedByID,
C.Description,
C.CreationDate,
C.ModifiedDate,
CASE
WHEN C.TYPE=1 THEN 'Folder'
WHEN C.TYPE=2 THEN 'Report'
WHEN C.TYPE=3 THEN 'XML'
WHEN C.TYPE=4 THEN 'Linked Report'
WHEN C.TYPE=5 THEN 'Data Source'
WHEN C.TYPE=6 THEN 'Model'
WHEN C.TYPE=8 THEN 'Shared Dataset'
WHEN C.TYPE=9 THEN 'Report Part'
END AS Type_Description
FROM
ExecutionLogStorage AS EL
LEFT OUTER JOIN Catalog AS C ON (EL.ReportID = C.ItemID)
GO
Lee MarkumHi Lee,
According to your description, you can't process the dataset when viewing the report on report server. Right?
In this scenario, as you can see the dataset name in error message is empty, and it says "Invalid Object Name". Because you have already created a view in your database. When you run this report again, this query be executed again so that you can
not create another view with same name. So you just need to query the view directly when creating dataset.
Select * from ExecutionLog3_Modify
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Invalid column name (with ojdbc)
hi,
I created a resultSet by executing query with more then one table in it. (left join)
and now i want to getObject. so I execute resultSet.getObject("tablename.columnName")
and I get this error "invalid column name".
when i'm doing the same thing with MySQL it works fine.
I don't want to do aliases for all the columns because there are too much of those.
please help.
thanks,
asaf.that's not standard JDBC. You must use either the plain column name,
or the column number. In cases where there are multiple columns with
the same name you must use the column number for all but the first
column with the same name.
Joe Weinstein -
Invalid Column name during export
When a FULL or USER level export is taken after the export is completed the following error appears.
ORA-00904 Invalid Column name
When I take table level export it complets successfully.
I had run catalog.sql, catproc.sql and catexp.sql.
Mohan
nullHi,
I normaly get this error when using an export utility that has different version from the DB, normally when using an export utility of a version above the DB version.
I hope this will be useful for You.
Bye Max
null -
Invalid column name 'SKEY_VAL' Error when Populating a planning dimension
I'm trying to populate a planning dimension from a view in MSSQL. I thought that I had mapped the all of the required columns in my interface in ODI, but I am getting the following error:
207 : S0001 : com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'SKEY_VAL'.
I can see in Operator that ODI is generating the following SQL
select
LEFT(DIM_ACCOUNT.FLEX_VALUE,80) as C1_ACCOUNT,
DIM_ACCOUNT.PARENT_FLEX_VALUE as C2_PARENT,
LEFT(DIM_ACCOUNT.DESCRIPTION,80) as C3_DESCRIPTION,
LEFT(DIM_ACCOUNT.DESCRIPTION,80) as C4_ALIAS__DEFAULT,
SKEY_VAL
from DOT_STAGE.dbo.DIM_ACCOUNT_T_V as DIM_ACCOUNT
where (1=1)
But I don't know why it is asking for the SKEY_VAL column or how I can map a value into this column when setting up the interface?
I've read through the user guide and the getting started guide and I can't find any reference to this SKEY_VAL column.
Does anyone know what causes this error and how I can fix it?1) No SKEY_VAL is not a variable.
2) This is my first attempt at using ODI, I did not create the SQL. All I did was to create a reverse a model against my MSSQL staging database and create and reverse a model against the planning application. Then I created an interface for the Account dimension in planning mapped the account, parent and description columns from my SQL table to the Planning dimension and I get this error. There are no columns called SKEY_VAL in either the source or the target and I have not created any objects with this name in ODI. I can see that ODI is asking for this column when I execute the interface, but I don't know why. -
Error "Invalid Column Name tp_level" when open restored web app
Hi,
I have a web application in development environment and it works fine when I try to restore the web application to the staging or production environment it is restored successfully but when I open the web application I got an error "Invalid column name
tp_level"
I don't know why this issue occurred. Do anyone knows what is the reason and how to solve it.
Thank you.
Ehabtp_level is an internal column of a content database. Can you check permissions on a restored content database for an account used for web app pool running?
If it will not help, I offer you to create web application in staging/production and then make a copy of a content database from development enviroment and attach it to a newly created web app. -
When Import get Error-00904 Invalid Column Name
Hi all,
I'm using DI Premium 3.0 with Oracle 10.2.0.1.0 repository. I'm trying to connect Oracle 8.1.4.7.1 (8i) but when i going to import tables get Error-00904 Invalid Column Name. If i connect to Oracle 10.2.0.4.0 don't get error.
Trying from DI XI R2 (11.7) with Oracle 10.2.0.2.0 repository, to connect Oracle 8.1.4.7.1 (8i) don´t get error!
Is error from Oracle repository version?
Thanks in advance.
JorgeHi Manoj,
This is the output:
SQL> desc all_tab_columns
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
TABLE_NAME NOT NULL VARCHAR2(30)
COLUMN_NAME NOT NULL VARCHAR2(30)
DATA_TYPE VARCHAR2(106)
DATA_TYPE_MOD VARCHAR2(3)
DATA_TYPE_OWNER VARCHAR2(30)
DATA_LENGTH NOT NULL NUMBER
DATA_PRECISION NUMBER
DATA_SCALE NUMBER
NULLABLE VARCHAR2(1)
COLUMN_ID NOT NULL NUMBER
DEFAULT_LENGTH NUMBER
DATA_DEFAULT LONG
NUM_DISTINCT NUMBER
LOW_VALUE RAW(32)
HIGH_VALUE RAW(32)
DENSITY NUMBER
NUM_NULLS NUMBER
NUM_BUCKETS NUMBER
LAST_ANALYZED DATE
SAMPLE_SIZE NUMBER
CHARACTER_SET_NAME VARCHAR2(44)
CHAR_COL_DECL_LENGTH NUMBER
GLOBAL_STATS VARCHAR2(3)
USER_STATS VARCHAR2(3)
AVG_COL_LEN NUMBER
Thanks for your help.
Jorge -
Invalid column name: get_column_index
Salam 2all
please help me to solve this problem
i have this error
Invalid column name: get_column_index
when i execute this code
rs = stmt.executeQuery("Select EmpNo,Name,Degree,Occupation,DomainNo,Signature from Employee where EmpNo='"+cno+"'");
if (rs.next())
emp.setText(rs.getString("EmpNo"));
name.setText(rs.getString("Name"));
degree.setText(rs.getString("Degree"));
occ.setText(rs.getString("Occupation"));
int index=SearchIndex(Integer.parseInt(rs.getString("DomainNo"))); dom.setSelectedIndex(index);
domn.setText(rs.getString("Signature"));
By tracing the code using System.out.println("BBBBBBBB");
i reach that the error is in the statment
{ domn.setText(rs.getString("Signature"));
but the spelling for"Signature" is the same, and i write it in the oracle creation table as follow
create table Employee(
EmpNo varchar(40) NOT NULL,
Name varchar(40) NOT NULL,
Degree varchar(4),
Occupation varchar(4),
DomainNo varchar(4),
Signature varchar(40),
primary key(EmpNo ),
foreign key(DomainNo) references Cycle);
Thanks 4 ur help
Salam 2all'Signature' doesn't seem to be a reserved word in Oracle.
First, I would try entering this query from a query tool. That may provide some clues.
Next, I would try changing the column name to 'Signaturexxx' and see if it fixes the problem.
This may be a bug in the driver. -
Invalid column name - fixed by inserting a carriage return - Why?
I'm writing some JSP pages and am executing a statement that retrieves values from three tables.
When executing the statement I receive the error
java.sql.SQLException: Invalid column name
I just want to state here that ALL the column names are definitely correct. I attempted to isolate the problem using my SQL*Plus Interface.
When copying and pasting the SQL that was used (I put the SQL statement into the HTML to allow me to do this) into SQL*Plus it also come up with the error. I found that if I broke up the statement it would run. Specifically if I placed a carriage return (by hitting enter) prior to the 'A' of the AND operator and then copied and pasted into SQL*Plus it would work!
I thought the problem was related to bad syntax in the outer join operator. But removal of the outer join operator and making it a EQUI JOIN situation still gave the same results. I tried the use of brackets to 'help' the DB engine figure it out - silly I know, but it didn't work anyway :(
I've tried this out on UNIX in SQL*Plus where the query was on one line and it worked fine. I've tried it on Oracle 8.1.5 SQL*Plus & Oracle 8.1.7 SQL*Plus on Win2000 and WinNT and no go.
It has also been tested on an Oracle 7.3.4 DB and no go either.
Remember I'm only using SQL*Plus to find out why it is not working - I'm actually attempting to execute this via JDBC (classes12.zip Oracle9 version) in my JavaBean. I can't place a carriage return to 'fix' the problem, and I'm assuming that I shouldn't either.
I've pasted the SQL below (both non-working and working versions). I was going to paste the output of DESC on the associated tables should you too would rule out a mispelled column name, but I didn't want to put anyone off with a long post.
If you can provide any advice I would be very appreciative.
Darren James
Show Me Technology
SQL> SELECT UNIT.Asset_Number,Model,PERSON.Novell_User_Name FROM
UNIT, UNIT_USERS, PERSON
2 WHERE UNIT.Hardware_Reference_Number =
UNIT_USERS.Hardware_Reference_Number(+) AND UNIT_USERS
.Novell_User_Name = PERSON.Novell_User_Name (+) ORDER BY Make,
Model, Asset_Number,Serial_Number,
UNIT.Hardware_Reference_Number,Unit_Type,PERSON.Last_Name,PERSON.Fi
rst_Name,PERSON.Novell_User_Name;
3 /
WHERE UNIT.Hardware_Reference_Number =
UNIT_USERS.Hardware_Reference_Number(+) AND UNIT_USERS.Novel
ERROR at line 2:
ORA-00904: invalid column name
REM -- Using the one with an return prior to the AND
SQL> SELECT UNIT.Asset_Number,Model,PERSON.Novell_User_Name FROM
UNIT, UNIT_USERS, PERSON
2 WHERE UNIT.Hardware_Reference_Number =
UNIT_USERS.Hardware_Reference_Number(+)
3 AND UNIT_USERS.Novell_User_Name = PERSON.Novell_User_Name
(+) ORDER BY Make, Model,
4 Asset_Number,Serial_Number,
5
UNIT.Hardware_Reference_Number,Unit_Type,PERSON.Last_Name,PERSON.Fi
rst_Name,PERSON.Novell_User_
Name;
ASSET_NUMBER
MODEL
NOVELL_USE
10023445
desktop raider
tabisho
10023445
desktop raider
pjblee
100349864
VEi8
SQL>Ok. I feel ashamed that the answer was so simple and not the
problem I thought it was. But in the interests of perhaps
preventing someone else doing the same silly thing....
The error was caused by using a wrong name when 'getting' the
values int the return ResultSet object. (eg using getString
("s.Some_Name") when it should have been getString
("s.Another_Name").
Interestingly the error did occur in one of our SQL*Plus
versions. Why we still are not sure, but since this was a silly
error on my part, I'm sure a similarly silly reason will be the
cause there two.
I appreciate those who responded though. It is a great resource.
Darren James
I'm just guessing here, but could it be some sort of a size thing? Could it be that, if you don't break up line 2, somehow
it gets truncated or wrapped at an inappropriate place? To test
this theory, you might try putting the carriage return in front
of the ORDER BY, instead of in front of the AND, and see if it
has the same effect. If you do get it figured out, please
satisfy our curiosity and let us know. -
Oracle Invalid Column Name Error in JSP
I was wondering if anyone could provide some help. I am new to JSP, Beans and Oracle and I am getting a java.sql.SQLException: ORA-00904: invalid column name error when I run the JSP below. The Java Bean's code it is referencing is also included and this bean is just storing information from the server from a previous login page.
Eventually I need to display more columns from the database using this JSP, but since I can even get this one working, I am at a loss!
PLEASE HELP!!!!
I have even tried to replace the beans reference in the sql with just a login and password I know exists in the database! Same error... Help!
I am running Tomcat and Oracle 9i!
<!--
Assign-->
<html>
<head>
<title>Student Signon on page</title>
</head>
<body bgcolor="#FDF5E6">
<h1 align="center">>Student Signon on page</h1>
<%@ page import="java.sql.*" %>
<%@ page import="BeanAs2.Bean5b" %>
<%
String driverClassString = "oracle.jdbc.driver.OracleDriver";
String driverConnectString;
driverConnectString = "jdbc:oracle:thin:@midas2:1521:globaldb";
String user = "system";
String passwd = "manager";
%>
<jsp:useBean id="Bean5b" class="BeanAs2.Bean5b" />
<jsp getProperty id = "Bean5b" property = "login" />
<jsp getProperty id = "Bean5b" property = "pswd" />
<%
Connection connection = null;
try {
Class.forName(driverClassString);
connection = DriverManager.getConnection(driverConnectString, user, passwd);
catch (Exception e) {
out.println("Cannot close connect to database!"+e);
if (connection != null) {
String login =Bean5b.getpassword();
String pswd =Bean5b.getStudentlogin();
String sql = "SELECT studentinfo.familyname FROM STUDENTINFO WHERE studentinfo.username='login' AND studentinfo.password='pswd';";
try { // execute the query
//SELECT studentinfo.familyname FROM STUDENTINFO WHERE studentinfo.username='s40079703' AND studentinfo.password='p4007swd'
Statement stmt = connection.createStatement();
ResultSet rst;
rst = stmt.executeQuery(sql);
// Fetch the query result, and dispaly them in a table
while (rst.next()) {
%>
<tr>
<td> <%= rst.getString("system.teaching.code") %> </td>
</tr>
<%
stmt.close();
connection.close();
} catch(Exception e) {
out.println("Cannot fetch data from database!"+e);
%>
</body></html>
package BeanAs2;
import java.util.*;
public class Bean5b {
// all variables must not be public in a bean
private String Studentlogin;
private String password;
public String getStudentlogin() {
return this.Studentlogin;
public String getpassword() {
return this.password;
public void setStudentlogin(String login) {
this.Studentlogin = login;
public void setpassword(String pswd) {
this.password = pswd;Hi
Thanks for your reply, I should of looked at my code before I copied over. The field should of been "studentinfo.familyname" which I was calling, I have just been changing so much code in this to try and see what the problem is, I didnt fix this before I copied this over.... trust me, I have tried everything........ Hence when I correctly called the "concatination the login name and password to the query properly" as you pointed out, I got rid of the error, BUT now it returning NO DATA????? (the table is populated - I have checked this!!!!)
The table I am trying to get information from sits under a schema called system. It has the following columns;
STUDENTID NUMBER 8
FAMILYNAME VARHCAR 60
GIVENNAME VARCHAR 60
USERNAME VARCHAR 9
PASSWORD VHARCHAR 60
The database is called globaldb. My computer is called Midas2
Whats more, the query works in Oracle sql*plus!!! Returning the relevent data!!!
Actually here is the code for the JSP, with all the changes and none of the mistakes of my previous post...........,
Pleaes help!!!
<html>
<head>
<title>Student Signon on page</title>
</head>
<body bgcolor="#FDF5E6">
<h1 align="center">>Student Signon on page</h1>
<%@ page import="java.sql.*" %>
<%@ page import="BeanAs2.Bean5b" %>
<%
String driverClassString = "oracle.jdbc.driver.OracleDriver";
String driverConnectString;
driverConnectString = "jdbc:oracle:thin:@midas2:1521:globaldb";
String user = "system";
String passwd = "manager";
%>
<jsp:useBean id="Bean5b" class="BeanAs2.Bean5b" />
<jsp getProperty id = "Bean5b" property = "login" />
<jsp getProperty id = "Bean5b" property = "pswd" />
<%
Connection connection = null;
try {
Class.forName(driverClassString);
connection = DriverManager.getConnection(driverConnectString, user, passwd);
catch (Exception e) {
out.println("Cannot close connect to database!"+e);
if (connection != null) {
String login =Bean5b.getpassword();
String pswd =Bean5b.getStudentlogin();
String sqlQuery;
sqlQuery = ("SELECT studentinfo.familyname FROM STUDENTINFO WHERE studentinfo.username='" + login + "' AND studentinfo.password='" + pswd + "'"); %>
<% try { // execute the query
Statement stmt = connection.createStatement();
ResultSet rst;
rst = stmt.executeQuery(sqlQuery);
// Fetch the query result, and dispaly them in a table
while (rst.next()) {
%>
<tr>
<td> <%= rst.getString("studentinfo.familyname") %> </td>
</tr>
<%
stmt.close();
connection.close();
} catch(Exception e) {
out.println("Cannot fetch data from database!"+e);
%>
</body></html> -
Strange error "Invalid column name 'not applicable'
When I am trying this piece of code on Solaris 10 having sybase ASE 12.5 installed :
ResultSet rs = stmt.executeQuery("sp_helpdb master");
while(rs.next()){
System.out.println(rs.getString(1));
I am getting the following error:
Invalid column name 'not applicable'
This query returns multiple result sets.
I am able to print all values in the first result set only.
Its failing in rs.next();
I am using jConnect 5.2 driver.
The same query is executing fine on Solaris 8 having ASE 12.0 installed.
If i use :
ResultSet rs = stmt.executeQuery("sp_helpdb master");
then there is no problem in Solaris 10
Plz help me.
Its urgentYou need to use execute() not executeQuery() in the scenario below and use the multi-result set logic
If you are using jConnect, see the samples for an example. -
Error : ABEND RS_EXCEPTION (000): Invalid column name 'TXTMD'
Dear Team,
Am getting this Dump / Error Msg. when tring to execute the query in BI Java Stack, the same query is executing perfectly in BI ABAP Stack, could some one throw some light to how to fix this, we are in process of Upgradating from BI 3.5 to BI 7.0 EHP1,
all production report of earlier version is being upgraded to BI. 7, currently our Java Stack is on SP 6.
The details of the error Msg:
The initial exception that caused the request to fail was:
Termination message sent
ABEND RS_EXCEPTION (000): [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid column name 'TXTMD'.
MSGV1: [Microsoft][SQL Server Native Client 10.0][SQL
MSGV2: Server]Invalid column name 'TXTMD'.
pl. revert. Your early responses are highly appreciated..!
Thanks in Advance.Nasiroddin,
according following post:
Re: 500 Internal Server Error
might be that some of variables linked to characteristics that is contained in free characteristics area is corrupted. Try to remove it.
BR
m./ -
Track down an INVALID COLUMN NAME.
Hi,
I have a SQL statement which contains a lot of column names and joins.
There may be approx 150 column names in my Select clause.
Now,when I run this in the User Env,i get the correct output.
But when this is run in the Prod Env,I get the Error:
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
oracle.jdbc.driver.OracleSQLException: ORA-00904: invalid column nameIs there any way where I can find out which is the INVALID COLUMN NAME in my SQL statement which gives an error when run in PROD env?Oracle9i or later would tell you the exact name of the column that is the problem. MAybe, you are on a release earlier than that.
SQL> desc emp
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
TITLE VARCHAR2(20)
SQL> select ename, invalid_column from emp ;
select ename, invalid_column from emp
ERROR at line 1:
ORA-00904: "INVALID_COLUMN": invalid identifier
SQL> disconnect
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production
SQL>What you could do is get the query that you are executing and run it in production SQL*Plus (or ask your DBA to do that for you). SQL*Plus would tell you the line number that has the problem (and hence you would know the column name):
SQL> select ename,
2 empno,
3 job,
4 invalid_column,
5 sal
6 from emp ;
invalid_column,
ERROR at line 4:
ORA-00904: "INVALID_COLUMN": invalid identifier
SQL>See, SQL*Plus tells you the problem is at line 4 and line 4 contains the offending column name. -
Java.sql.SQLException: Invalid column name: user_id
Hi,
I am using SQL Server 2000 database and using a Java DAO class executing an SQL query using preparedStatement.The issue is that intermittently i get the following exception: "SQLException:Invalid column name". I checked the filed name in the table and the filed name i gave in the resultset.getInt("field_name")and both are matching.The parameter values for the query are fetched from a JSP report and the surprsing issue is that this exception comes on & off. So iam unable to find the cause of this exception.Can anyone help me out?
Query Used :
SELECT usrs.user_id,uperm.value,uedis.attrib_value.......
FROM USERS usrs
LEFT OUTER JOIN extended_user_attributes uedis
ON (usrs.user_id = uedis.user_id AND usdis.attrib_id=?),
user_permission uperm
WHERE usrs.user_id = uperm.user_id
AND uperm.name=?
I am getting exception when iterating resultset.
ResultSet rs = preparedStatement.executeQuery();
while(rs.next())
UserID userid = new UserID();
userid.setUserID(rs.getInt("user_id"));
Thanks
Balaji.MGiving an alias name to the column name will work. If the query uses join or fetching rows from multiple tables, then giving an alias name to the column name, should work fine.
By,
Sethu
It seems you have two user_id columns and the server
or driver names the column automatically(I am not
sure of that) in some way. Try giving some alias to
the field you want, like:
SELECT usrs.user_id
u_user_id,uperm.value,uedis.attrib_value.......
userid.setUserID(rs.getInt("u_user_id"));HTH
MikeBy
Maybe you are looking for
-
Syntax check error in the standard include
Hi, I have modified one standard include using access key to insert one logic as per businness requirements.Now after inserting that code iam getting syntax error but while activating it is not showing the error and getting activated. The include is
-
Illustrator and Photoshop (and Skype) keep quitting unexpectedly at launch
I wasn't sure which specific one I should post this in, Illustrator, or Photoshop, or somewhere else :T So I apologize if this isn't the right place. But I really need to fix this problem. All 3 of these programs keep doing this..And I don't know why
-
I have music on my Ipod touch, how can I get it on to my new macbook?
Hello! My old macbook died, I want to get my music from my ipod touch to my new macbook. I know this requires a third party program, are there any recommendations? Thanks
-
Exporting imovie through AVDV converter box?
I have been using either export or share to send finished videos through a converter box and into a VCR for years with no problem. When trying to export the latest project, it jumps in pieces and freezes up. It plays fine in imovie but can't export.
-
I'm having a problem with the iTunes shortcut, I pin it to my taskbar but all I get is this: http://i38.tinypic.com/bdmmhi.png The iTunes shortcut looks like it hasn't been booted, right? But thing is, it has, it's just that the actual iTunes-process