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.

Similar Messages

  • SSMS 2012: Using CTE in a query - Invalid column name 'EmployeeID' !!??

    Hi all,
    From Page 88 of the Book "SQL Programming & Database Design Using Microsoft SQL Server 2012" written by Kalman Toth, I copied the following code of Using CTE in a query:
    -- CTETest2.sql /// saved in C:\My Documents\SQL Server Management Studio\
    ----Page 88 of Book by Toth === Using CTE in a query ----- 13 March 2015
    --Using CTE in a query
    ;WITH CTE (SalesPersonID, NumberOfOrders, MostRecentOrderDate)
    AS (SELECT SalesPersonID, COUNT(*), CONVERT(date, MAX(OrderDate))
    FROM Sales.SalesOrderHeader GROUP BY SalesPersonID )
    --Start of outer (main) query
    SELECT E.EmployeeID,
    OE.NumberOfOrders AS EmpOrders,
    OE.MostRecentOrderDate AS EmpLastOrder,
    E.ManagerID,
    OM.NumberOfOrders AS MgrOrders,
    OM.MostRecentOrderDate AS MgrLastOrder
    FROM HumanResources.Employee AS E
    INNER JOIN CTE AS OE ON E.EmployeeID = OE.SalesPersonID
    LEFT OUTER JOIN CTE AS OM ON E.ManagerID = OM.SalesPersonID
    In my SQL Server 2012 Management Studio, I executed this set of code and I got the following fatal error:
    Msg 207, Level 16, State 1, Line 16
    Invalid column name 'EmployeeID'.
    I have no clues why I got this error message in this .sql trial of my second practice in doing CTE.  Please kindly help and let me know where I made mistake and how to resolve this problem.
    Thanks in advance,
    Scott Chang

    Hi scott_morris-ga, Thanks for your nice response.
    I changed EmployeeID to BusinessEntityID as you pointed out and executed the revised code:
    -- CTETest2.sql /// saved in C:\My Documents\SQL Server Management Studio\
    ----Page 88 of Book by Toth === Using CTE in a query ----- 13 March 2015
    --Using CTE in a query
    ;WITH CTE (SalesPersonID, NumberOfOrders, MostRecentOrderDate)
    AS (SELECT SalesPersonID, COUNT(*), CONVERT(date, MAX(OrderDate))
    FROM Sales.SalesOrderHeader GROUP BY SalesPersonID )
    --Start of outer (main) query
    SELECT E.BusinessEntityID,
    OE.NumberOfOrders AS EmpOrders,
    OE.MostRecentOrderDate AS EmpLastOrder,
    E.ManagerID,
    OM.NumberOfOrders AS MgrOrders,
    OM.MostRecentOrderDate AS MgrLastOrder
    FROM HumanResources.Employee AS E
    INNER JOIN CTE AS OE ON E.BusinessEntityID = OE.SalesPersonID
    LEFT OUTER JOIN CTE AS OM ON E.ManagerID = OM.SalesPersonID
    I got 2 new error messages:
    Msg 207, Level 16, State 1, Line 17
    Invalid column name 'ManagerID'.
    Msg 207, Level 16, State 1, Line 12
    Invalid column name 'ManagerID'.
    I have no ideas what should be used to replace 'ManagerID' in my revised code. Could you please help again and give me the right thing to replace the 'ManagerID'? By the way, where in the AdventureWorks do you find the right things?  Please enlighten
    me in this matter.
    Many Thanks again,  Scott Chang 

  • INSERT INTO with SELECT invalid column name error

    I have a problem where I wish to update a table with only records that have changed or insert into a table with only new records. The Source table is queried using OPENQUERY as we have no staging db for this.
    I have the following code (adapted from a working example):
    INSERT INTO dbo.Contact
    SELECT contactID, lastUpdatedDateTime
    FROM
    MERGE INTO dbo.Contact AS DT
    USING (SELECT * FROM OPENQUERY(LINKED_SERVER,'SELECT contactID, lastUpdatedDateTime FROM Contact')) AS DS
    ON (DT.ContactID = DS.ContactID)
    WHEN NOT MATCHED THEN
    INSERT VALUES (DS.contactID, DS.lastUpdatedDateTime)
    WHEN MATCHED AND (DT.lastUpdatedDateTime <> DS.lastUpdatedDateTime) THEN
    UPDATE SET DT.contactID = DS.contactID, DT.lastUpdatedDateTime = DS.lastUpdatedDateTime
    OUTPUT $Action Action_Out
    AS MERGE_OUT
    WHERE MERGE_OUT.Action_Out = 'UPDATE';
    GO
    When I run this query I am getting the following errors referring to the columns in the SELECT:
    Msg 207, Level 16, State 1, Line 2
    Invalid column name 'contactID'.
    Msg 207, Level 16, State 1, Line 2
    Invalid column name 'lastUpdatedDateTime'.
    Am I missing something obvious as I can't quite work out why? The Target and source definitely exist with the specified columns present in both...

    Hello,
    The issue is because you are not outputting those values from the inner merge statement. All you are currently outputting is the action, so the error is correct as those columns do not exist.
    Change your output portion to be:
    OUTPUT inserted.contactID, inserted.lastUpdatedDateTime, $Action Action_Out
    Then it should work.
    Sean Gallardy | Blog | Microsoft Certified Master

  • ORA-00904: invalid column name in select query by using abstract datatype

    Hi,
    I had created abstract datatype as PERSON_TY and ADDRESS_TY ,
    after inserting the record . i'm tryng to select the column but i got the error , even i refferd all those thing. they are given that same please look this finde me a result.
    SQL> DESC PERSON_TY
    Name Null? Type
    NAME VARCHAR2(25)
    ADDRESS ADDRESS_TY
    SQL> DESC ADDRESS_TY
    Name Null? Type
    STREET VARCHAR2(30)
    CITY VARCHAR2(25)
    STATE CHAR(2)
    COUNTRY VARCHAR2(15)
    SQL> SELECT * FROM EMPLOYE
    2 ;
    EMP_CODE
    PERSON(NAME, ADDRESS(STREET, CITY, STATE, COUNTRY))
    10
    PERSON_TY('VENKAT', ADDRESS_TY('112: BLUE MOUNT', 'CHENNAI', 'TN', 'INDIA'))
    20
    PERSON_TY('SRINI', ADDRESS_TY('144: GREEN GARDEN', 'THAMBARAM', 'TN', 'INDIA'))
    SQL> SELECT PERSON.NAME FROM EMPLOYE
    2 ;
    SELECT PERSON.NAME FROM EMPLOYE
    ERROR at line 1:
    ORA-00904: invalid column name
    regards
    venki

    SELECT PERSON.NAME FROM EMPLOYEIf you look in the documentation, you will see that we need to alias the table in order to make this work:
    select e.person.name from employees e
    /Cheers, APC
    Blog : http://radiofreetooting.blogspot.com

  • Invalid column name in WLS 6.1 sp4

    We have been using WLS 6.1 sp2 with toplink and never had any problems. Recently
    we migrated to sp4 and get a invalid column name exception while updating records.
    For select queries there is no error. The SQL generated by toplink is -
    UPDATE PR_SUPP SET CNTC_PRSN_NAME = ''
    , REMK = 'Remark 123', LAST_CHNG_DTTM = {ts '2002-11-29 10:59:56.0'} WHERE ((S
    UPP_CODE = 'A0001') AND (LAST_CHNG_DTTM = {ts '2002-11-29 10:46:01.0'}))
    It looks like some problem with the JDBC driver. The databse is Oracle 8.17. How
    to fix it
    The exception stack trace is -
    2002-11-27 11:56:25,763 ERROR com.pws.ubiquity.pr.business.TransactionTypeFacade
    - Error while commiting transaction (creating TransactionType):LOCAL EXCEPTION
    STACK:
    EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DatabaseException
    EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-00904: invalid column name
    INTERNAL EXCEPTION: java.sql.SQLException: ORA-00904: invalid column name
    ERROR CODE: 904
         at oracle.toplink.exceptions.DatabaseException.sqlException(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(Unknown
    Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(Unknown
    Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(Unknown
    Source)
         at oracle.toplink.publicinterface.UnitOfWork.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown
    Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown
    Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.insertObject(Unknown
    Source)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(Unknown
    Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown
    Source)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommit(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedWrite(Unknown
    Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedInsert(Unknown
    Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown
    Source)
         at oracle.toplink.queryframework.WriteObjectQuery.executeCommit(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWrite(Unknown
    Source)
         at oracle.toplink.queryframework.WriteObjectQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.internal.sessions.CommitManager.commitAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.Session.writeAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.issueSQLbeforeCompletion(Unknown
    Source)
         at oracle.toplink.jts.AbstractSynchronizationListener.beforeCompletion(Unknown
    Source)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:551)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:88)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:982)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1506)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:215)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:247)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:584)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
         at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
         at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
         at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    INTERNAL EXCEPTION STACK:
    java.sql.SQLException: ORA-00904: invalid column name
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
         at weblogic.jdbc.jts.Statement.executeUpdate(Statement.java:503)
         at weblogic.jdbc.rmi.internal.PreparedStatementImpl.executeUpdate(PreparedStatementImpl.java:66)
         at weblogic.jdbc.rmi.SerialPreparedStatement.executeUpdate(SerialPreparedStatement.java:57)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(Unknown
    Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(Unknown
    Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(Unknown
    Source)
         at oracle.toplink.publicinterface.UnitOfWork.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown
    Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown
    Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.insertObject(Unknown
    Source)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(Unknown
    Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown
    Source)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommit(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedWrite(Unknown
    Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedInsert(Unknown
    Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown
    Source)
         at oracle.toplink.queryframework.WriteObjectQuery.executeCommit(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWrite(Unknown
    Source)
         at oracle.toplink.queryframework.WriteObjectQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.internal.sessions.CommitManager.commitAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.Session.writeAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.issueSQLbeforeCompletion(Unknown
    Source)
         at oracle.toplink.jts.AbstractSynchronizationListener.beforeCompletion(Unknown
    Source)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:551)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:88)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:982)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1506)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:215)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:247)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:584)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
         at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
         at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
         at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    --------------- nested within: ------------------
    weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion:
    sync=oracle.toplink.jts.wls.WebLogicSynchronizationListener@373d4a
    EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-00904: invalid column name
    INTERNAL EXCEPTION: java.sql.SQLException: ORA-00904: invalid column name
    ERROR CODE: 904 - with nested exception:
    [EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DatabaseException
    EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-00904: invalid column name
    INTERNAL EXCEPTION: java.sql.SQLException: ORA-00904: invalid column name
    ERROR CODE: 904]
         at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1490)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:265)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:247)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:584)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
         at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
         at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
         at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    2002-11-27 11:56:25,793 DEBUG com.pws.framework.common.MessageSourceFactory -
    Get MessageSource for error message.:
    2002-11-27 11:56:25,793 DEBUG com.pws.framework.common.MessageSourceFactory -
    Get MessageSource for error message.:
    com.pws.framework.exception.GeneralException: There was an unexpected error. Please
    contact your system administrator.
         at com.pws.framework.exception.GeneralException.create(GeneralException.java:111)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:588)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
         at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
         at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
         at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

    We have changed default thin driver to 920 from 817 in 610sp4. If you are using 817/901 dbserver, please put 817/901 classes12.zip in your
    classpath before weblogic.jar and you will be ok.
    Mitesh
    vivek wrote:
    We have been using WLS 6.1 sp2 with toplink and never had any problems. Recently
    we migrated to sp4 and get a invalid column name exception while updating records.
    For select queries there is no error. The SQL generated by toplink is -
    UPDATE PR_SUPP SET CNTC_PRSN_NAME = ''
    , REMK = 'Remark 123', LAST_CHNG_DTTM = {ts '2002-11-29 10:59:56.0'} WHERE ((S
    UPP_CODE = 'A0001') AND (LAST_CHNG_DTTM = {ts '2002-11-29 10:46:01.0'}))
    It looks like some problem with the JDBC driver. The databse is Oracle 8.17. How
    to fix it
    The exception stack trace is -
    2002-11-27 11:56:25,763 ERROR com.pws.ubiquity.pr.business.TransactionTypeFacade
    - Error while commiting transaction (creating TransactionType):LOCAL EXCEPTION
    STACK:
    EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DatabaseException
    EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-00904: invalid column name
    INTERNAL EXCEPTION: java.sql.SQLException: ORA-00904: invalid column name
    ERROR CODE: 904
    at oracle.toplink.exceptions.DatabaseException.sqlException(Unknown Source)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(Unknown
    Source)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(Unknown
    Source)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(Unknown
    Source)
    at oracle.toplink.publicinterface.UnitOfWork.executeCall(Unknown Source)
    at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown
    Source)
    at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown
    Source)
    at oracle.toplink.internal.queryframework.CallQueryMechanism.insertObject(Unknown
    Source)
    at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(Unknown
    Source)
    at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown
    Source)
    at oracle.toplink.queryframework.InsertObjectQuery.executeCommit(Unknown Source)
    at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedWrite(Unknown
    Source)
    at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedInsert(Unknown
    Source)
    at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown
    Source)
    at oracle.toplink.queryframework.WriteObjectQuery.executeCommit(Unknown Source)
    at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWrite(Unknown
    Source)
    at oracle.toplink.queryframework.WriteObjectQuery.execute(Unknown Source)
    at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
    at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
    at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
    at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
    at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
    at oracle.toplink.internal.sessions.CommitManager.commitAllObjects(Unknown Source)
    at oracle.toplink.publicinterface.Session.writeAllObjects(Unknown Source)
    at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
    at oracle.toplink.publicinterface.UnitOfWork.issueSQLbeforeCompletion(Unknown
    Source)
    at oracle.toplink.jts.AbstractSynchronizationListener.beforeCompletion(Unknown
    Source)
    at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:551)
    at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:88)
    at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:982)
    at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1506)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:215)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
    at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:247)
    at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:584)
    at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
    at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
    at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
    at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    INTERNAL EXCEPTION STACK:
    java.sql.SQLException: ORA-00904: invalid column name
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
    at weblogic.jdbc.jts.Statement.executeUpdate(Statement.java:503)
    at weblogic.jdbc.rmi.internal.PreparedStatementImpl.executeUpdate(PreparedStatementImpl.java:66)
    at weblogic.jdbc.rmi.SerialPreparedStatement.executeUpdate(SerialPreparedStatement.java:57)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(Unknown
    Source)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(Unknown
    Source)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(Unknown
    Source)
    at oracle.toplink.publicinterface.UnitOfWork.executeCall(Unknown Source)
    at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown
    Source)
    at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown
    Source)
    at oracle.toplink.internal.queryframework.CallQueryMechanism.insertObject(Unknown
    Source)
    at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(Unknown
    Source)
    at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown
    Source)
    at oracle.toplink.queryframework.InsertObjectQuery.executeCommit(Unknown Source)
    at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedWrite(Unknown
    Source)
    at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedInsert(Unknown
    Source)
    at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown
    Source)
    at oracle.toplink.queryframework.WriteObjectQuery.executeCommit(Unknown Source)
    at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWrite(Unknown
    Source)
    at oracle.toplink.queryframework.WriteObjectQuery.execute(Unknown Source)
    at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
    at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
    at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
    at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
    at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
    at oracle.toplink.internal.sessions.CommitManager.commitAllObjects(Unknown Source)
    at oracle.toplink.publicinterface.Session.writeAllObjects(Unknown Source)
    at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
    at oracle.toplink.publicinterface.UnitOfWork.issueSQLbeforeCompletion(Unknown
    Source)
    at oracle.toplink.jts.AbstractSynchronizationListener.beforeCompletion(Unknown
    Source)
    at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:551)
    at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:88)
    at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:982)
    at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1506)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:215)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
    at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:247)
    at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:584)
    at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
    at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
    at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
    at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    --------------- nested within: ------------------
    weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion:
    sync=oracle.toplink.jts.wls.WebLogicSynchronizationListener@373d4a
    EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-00904: invalid column name
    INTERNAL EXCEPTION: java.sql.SQLException: ORA-00904: invalid column name
    ERROR CODE: 904 - with nested exception:
    [EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DatabaseException
    EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-00904: invalid column name
    INTERNAL EXCEPTION: java.sql.SQLException: ORA-00904: invalid column name
    ERROR CODE: 904]
    at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1490)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:265)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
    at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:247)
    at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:584)
    at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
    at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
    at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
    at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    2002-11-27 11:56:25,793 DEBUG com.pws.framework.common.MessageSourceFactory -
    Get MessageSource for error message.:
    2002-11-27 11:56:25,793 DEBUG com.pws.framework.common.MessageSourceFactory -
    Get MessageSource for error message.:
    com.pws.framework.exception.GeneralException: There was an unexpected error. Please
    contact your system administrator.
    at com.pws.framework.exception.GeneralException.create(GeneralException.java:111)
    at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:588)
    at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
    at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
    at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
    at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

  • Use of NOT IN leads to an invalid column name error

    The query works just fine when placed directly into sql plus
    The query works, called from a Java using an Oracle Statement, ONLY IF I remove the NOT.
    However, with NOT it chokes, and gives me this:
    selQ=select lenum, zeugn from stock_rpt where lenum NOT in ('X12345', 'X23456')
    Could Select or Read Selected data
    java.sql.SQLException: Invalid column name
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3319)
    at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1926)
    at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515)
    at ecspack.StockRpt.selRecsByQ(StockRpt.java:172)
    at ecspack.StockRpt.selByDiff(StockRpt.java:261)
    at teste.main(teste.java:40)
    The column does have an index.
    The above is my simplified test query, I am using to narrow down the problem.
    SelQ is the value of the Select String.
    Really I want to do something like this:
    select x1, x2 from tableX where x1 NOT IN (select y1 from tableY)
    I know I can just compare records one at a time, but I would rather not, if there is a way to make NOT IN work.
    Thank you

    Hi Eileen Keeney ,
    may be you can use prepared statement but beware of sql injection
    selQ=select lenum, zeugn from stock_rpt where lenum NOT in ('X12345', 'X23456')
    Try :
    selQ=select lenum, zeugn from stock_rpt where lenum NOT in (?, ?)
    Then try running it with this fixed parameter binding:
    prest.setString(1, "X12345");
    prest.setString(2, "X23456");

  • Using "$" character with Oracle; getting "invalid column name"

    I am running the following query against an Oracle database:
    select price from my_table
    where index_name = 'CGPR_C$'
    and settlement_date = to_date('02/19/2001','MM/DD/YYYY')
    The query runs fine in TOAD.
    If I run this query from my java code, I get an "invalid column name" exception.
    If I take out the "$" character, the query runs fine.
    I've tried inserting the "$" in as unicode, escaping out the character, ||chr(36)||, and nothing works.
    Please help!
    Ashley

    Look up your Oracle SQL documentation and find out how to use column names that would otherwise be invalid. Some databases allow you to put column names, table names, and so on in square brackets (e.g. [CGPR_C$]) but I don't know Oracle's syntax.

  • Invalid column name error

    Having an interesting problem with a site I'm fixing. I'm
    sure I'm looking past the obvious, so maybe some of you can help:
    ASP Pages display results from recordset based on a session
    variable (memberID) that is created during user login.
    Recordset looks like this:
    <%
    Dim rs__MMColParam
    rs__MMColParam = "%"
    If (Session("memberID") <> "") Then
    rs__MMColParam = Session("memberID")
    End If
    %>
    <%
    set rs = Server.CreateObject("ADODB.Recordset")
    rs.ActiveConnection = MM_cnConnection_STRING
    rs.Source = "SELECT id, adminusername, anotherone1,
    anotherone2, anotherone3 FROM dbo.basic1 WHERE adminusername = '" +
    Replace(rs__MMColParam, "'", "''") + "'"
    rs.CursorType = 0
    rs.CursorLocation = 2
    rs.LockType = 3
    rs.Open()
    rs_numRows = 0
    %>
    Seems correct to me, unles I'm overlooking something obvious.
    Unfortunately I keep getting the following error:
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column
    name 'SESSIONVAR'.
    (Note: in this error above, SESSIONVAR is the name of the
    session variable memberID)
    Strange thing is, as long as the session variable is a #,
    everything works. If it's a word, it won't work. So it appears the
    session variables are being defined and passed to the next page.
    As for the database, it's a SQL Database
    column 'adminusername' is a NVARCHAR with a 4000 char limit
    Thanks in advance for any help.

    Are you sure the query is the same? It looks like the one you posted has a syntax error
    SELECT e.emp_id, e.dep_id
      FROM emp e, loc ct, dep dt
    WHERE[b] c.dep_id[/b] IN (SELECT dt.dep_idYou've aliased the LOC table to CT in the FROM clause, but you're using the alias C in the WHERE clause. You use the correct alias CT in the query in your IN clause.
    Justin

  • 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

  • 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 'origfillfactor'

    Hi,
    Getting message --- "Failed to load source model. [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'origfillfactor' --- when the OMWB is loading source model.
    I am using OMWB 9.2.0.1.7 Build 20031209 with MSQL Server 7.0 plugin. Source DB is SQL Server 7.
    In case this is related to Index Fill factor, the current setting on SQL Server (SQL Server properties - Database Settings) is Default(optimal). Should this be changed to set it to a fixed value?
    Any hints to solve this....thanks

    Hi,
    I found that there is a column by name "OrigFillFactor" in table sysindexes in SQL.
    Has anyone come across problems related to field names (esp of system tables) while migrating from SQL 7 to Oracle 8? I am not sure why this error is popping up. But wanted to know how the field name problems are resolved. Maybe the same might work for me too!!
    Thanks in anticipation.....

  • 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>

  • 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./

  • 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.

  • Sybase JDBC driver & Invalid column name error

    I submitted a note a year ago concerning JDBC-ODBC bridge and SQL Server db. Same Invalid column name error. The resolution was a bug in the XSU code.
    This time the error is with a jconnect5 JDBC driver from Sybase to a Sybase ASA db. ASA is Adaptive Server Anywhere.
    <ERROR xsql-timing="140">oracle.xml.sql.OracleXMLSQLException: S0022: Invalid column name 'name'.</ERROR>
    However if I use a Sybase JDBC driver from INet Software of Germany, I get the desired result of my query.
    Below are sample XSQLConfig.xml definitions.
    INet Software Sybase JDBC driver definition:
    - <connection name="deasa">
    <username>dba</username>
    <password>sql</password>
    <dburl>jdbc:inetsyb:LEMKAU:2638?database=asademo</dburl>
    <driver>com.inet.syb.SybDriver</driver>
    <autocommit>true</autocommit>
    </connection>
    Sybase jconnect5 Sybase JDBC driver definition:
    - <connection name="asa">
    <username>dba</username>
    <password>sql</password>
    <dburl>jdbc:sybase:Tds:lemkau:2638?ServiceName=asademo</dburl>
    <driver>com.sybase.jdbc.SybDriver</driver>
    <autocommit>true</autocommit>
    </connection>
    I believe the bug has to do with the numeric codes that the drivers use to determine data types are not properly interpreted.
    See XML General note title "insert-request, xsu 2.1.0 beta & SQL Server" for reference.
    Steve.

    Thanks for the notification. We will look into this issue...

Maybe you are looking for

  • Use of FIELD in Attribute SQL Query

    Hi folks, Back in 7.1 you could use %FIELD.[attributename]% in a sql query defining an identity store attribute's values. Does anyone know if this functionality was lost in 7.2?  Can't seem to get it to work. Thanks, Matt

  • Upgraded computer and PSE... where are old tags?

    I recently got a new computer. I also changed OS from Windows 7 32bit to Windows 7 64bit which required re-formating my drive. I made a backup copy of everything. After installing the new OS, I upgranded from PSE 8 to PSE 9. I tried importing my pict

  • Kernel panic on waking from sleep

    About three months ago I had a persistent issue where waking my Powerbook 12" from sleep caused a kernel panic. I resolved it by resetting the PRAM (holding down cmdoption+pr while booting), but now it seems to have started up again and zapping the P

  • Wd_this- get_componentcontroller_ctr() is not recognised

    Morning all I am trying to create a (popup) window to display a table that a user will then select one line from. I seem to have an issue in that the method get_componentcontroller_ctr() of wd_this is not recognised. The following is my code data:   

  • Need to Deauthorise stolen laptop

    Hi Guys A few weeks ago we had our flat broken into and the Macbook nicked. It's now been replaced, however, obviously, when I've authorised this MB to play the music we've bought, it tells me that 2 computers are now authorised. Since I no longer ha