Re: sql problems
Date: Thu, 10 Apr 2003 16:09:16 GMT
Message-ID: <MPG.18ff3703507e354f98972b_at_news.la.sbcglobal.net>
scott_at_rigent.com said...
> Hi there ...
>
> I'm trying to get a sql statement to run in the web.config file of asp.net
> to connect to Oracle. It seems to connect ok but Oracle is spitting back ""
>
> I'm not so experienced with oracle - can anyone tell me what I might check
> in this sql? These are the ones i find suspect:
>
> <add key="cmdProductListSelectPartList.CommandText" value="SELECT ID,
> DESCRIPTION, USER_10 FROM SYSADM_PART" />
> <add key="cmdSelectPartDetails.CommandText" value="SELECT SYSADM_PART.*
> FROM SYSADM_PART ORDER BY ID" />
> <add key="cmdSelectPartNames.CommandText" value="SELECT ID, ID + ' ' +
> DESCRIPTION AS DESCRIPTION FROM SYSADM_PART ORDER BY DESCRIPTION" />
>
> The error I get is:
>
> Command was not prepared. ORA-01722: invalid number
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> can anyone tell me potential errors are in this?
>
> sm
>
You're trying to give two aliases (both named DESCRIPTION) in your 3rd
select statement. What Oracle sees is:
select id, id description as description from...
-- /Karsten DBA > retired > DBAReceived on Thu Apr 10 2003 - 18:09:16 CEST