Home All Groups Group Topic Archive Search About

Oracle Error Invalid character

Author
26 Feb 2007 2:45 PM
Oldman
I am setting the command object text of an OracleCommand to "Select
FNGETDBVER() FROM DUAL;"

I am attempting to retrieve the result of this function.  However, when I
call ExecuteScalar on this I get an invalid character error: "ORA-00911:
invalid character".

Any ideas?  I can execute this sql fine from any oracle client tool.

Thanks

Author
26 Feb 2007 3:18 PM
Glenn
Try removing the semi-colon.

Show quote
"Oldman" <Old***@discussions.microsoft.com> wrote in message
news:7DF681BA-58ED-4E62-BEF0-D3EBA64ED0D4@microsoft.com...
>I am setting the command object text of an OracleCommand to "Select
> FNGETDBVER() FROM DUAL;"
>
> I am attempting to retrieve the result of this function.  However, when I
> call ExecuteScalar on this I get an invalid character error: "ORA-00911:
> invalid character".
>
> Any ideas?  I can execute this sql fine from any oracle client tool.
>
> Thanks
Author
26 Feb 2007 3:46 PM
Oldman
Thanks.  That was it.  One thing I hate about Oracle is the fact that their
PL-SQL language is an extension and doesn't work hand and hand with their SQL
implementation.  If this select statement was within a PL-SQL block it would
have required the semi-colon.

I was originally thinking that it didn't like the ( or ) in the select
statement.

Anyway, thanks again.


Show quote
"Glenn" wrote:

> Try removing the semi-colon.
>
> "Oldman" <Old***@discussions.microsoft.com> wrote in message
> news:7DF681BA-58ED-4E62-BEF0-D3EBA64ED0D4@microsoft.com...
> >I am setting the command object text of an OracleCommand to "Select
> > FNGETDBVER() FROM DUAL;"
> >
> > I am attempting to retrieve the result of this function.  However, when I
> > call ExecuteScalar on this I get an invalid character error: "ORA-00911:
> > invalid character".
> >
> > Any ideas?  I can execute this sql fine from any oracle client tool.
> >
> > Thanks
>
>
>
Author
26 Feb 2007 3:31 PM
David Browne
"Oldman" <Old***@discussions.microsoft.com> wrote in message
news:7DF681BA-58ED-4E62-BEF0-D3EBA64ED0D4@microsoft.com...
>I am setting the command object text of an OracleCommand to "Select
> FNGETDBVER() FROM DUAL;"
>
> I am attempting to retrieve the result of this function.  However, when I
> call ExecuteScalar on this I get an invalid character error: "ORA-00911:
> invalid character".
>
> Any ideas?  I can execute this sql fine from any oracle client tool.
>

Just like the error says.  ';' is an invalid character in Oracle SQL.  Other
client tools will strip it off.

David

AddThis Social Bookmark Button