File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Oracle/OAS and the fly likes error invalid column name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "error invalid column name" Watch "error invalid column name" New topic
Author

error invalid column name

Megha Singhal
Ranch Hand

Joined: Feb 28, 2012
Posts: 225

in the following code



following error is coming

Connection Pooling Example.
An Error Had occurred while accessing the database
--------------------------------------------------------------------------------
Invalid column name


if i'm running this on oracle then it is giving output , i don't know why this is giving error while i'm running on server.

(I edited the code so that it wasn't far too wide -- Paul C)
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

that means one or some column names in the SELECT clause do not exist in the table. So check for typo in the column names.


PM Me If You Want to get Urgent Help on Java Programming
Megha Singhal
Ranch Hand

Joined: Feb 28, 2012
Posts: 225

Nam Ha Minh wrote:that means one or some column names in the SELECT clause do not exist in the table. So check for typo in the column names.


but the exact query running in the oracle so i don't think there is any prob like that that's why i mentioned that this query is running on oracle
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

You cannot use the dot operator in the following statements:

Megha Singhal
Ranch Hand

Joined: Feb 28, 2012
Posts: 225

Nam Ha Minh wrote:You cannot use the dot operator in the following statements:



then what should i use to get value in the variable.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18887
    
    8

Nam Ha Minh wrote:You cannot use the dot operator in the following statements:



I don't know if that's right (I'm not an Oracle expert) but at any rate "DIV.R_DESG_NAME" isn't one of the fields selected. It's easy to miss the fact that "DES.R_DESG_NAME" is actually in the query instead.
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

Megha Singhal wrote:

then what should i use to get value in the variable.


One solution I would suggest you is to remove the table alias + dot + column name (if there is no conflict) in the SELECT clause, then update the code like this:



Or you can modify the SELECT clause using AS keyword to set alias for column names, i.e:



then in Java code:

Megha Singhal
Ranch Hand

Joined: Feb 28, 2012
Posts: 225

Nam Ha Minh wrote:
Megha Singhal wrote:

then what should i use to get value in the variable.


One solution I would suggest you is to remove the table alias + dot + column name (if there is no conflict) in the SELECT clause, then update the code like this:



Or you can modify the SELECT clause using AS keyword to set alias for column names, i.e:



then in Java code:



thanks it is working now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error invalid column name