Search code examples
c#asp.netoracle-databaseiisora-00911

Enviromental issue for ORA-00911: ORA-00911: invalid character\n not due to missing semi-colon ;


I have a website connected to an Oracle database. When I execute the following SQL I get a result returned:

select distinct name from CONTACTS
            where upper(EMAIL) like upper(:info) 
            AND HASACCESS(NAME, :userid) = 'Y' 
            order by NAME desc

I have migrated the same code to a new server. When this code runs I now get the error:

ORA-00911: invalid character\n

I do not have a ; on the end which most people get when they get this error.

Doing some trial and error it is crapping on the call to the Stored Producer / Function call. The database that both bits of code are referencing are the same.

It is not to do with the bind variables because if I hard code them then I still get the error.

I am really perplexed on this one.


Solution

  • I have found the issue. It can be seen here

    select distinct name from CONTACTS
                where upper(EMAIL) like upper(:info) 
                AND HASACCESS(NAME, :userid) = 'Y' 
                order by NAME desc
    

    When the function is being called it is using the wrong bracket. It is using it should be (.

    PLSQL can run either bracket fine.

    Changing the bracket the code now works.

    Must be a difference in Oracle driver support. Or something else environmental. Hopefully this may help someone else one day...