views:

105

answers:

1

Hi

I run this query to read the count of the Records with an output parameter using OracleCommand:

var query = "declare MyCount number; begin SELECT COUNT(*) INTO :MyCount FROM T_ISSUE; end;";

this one works fine.

But if I split the query into two lines like this:

var query = @"declare MyCount number; 
              begin SELECT COUNT(*) INTO :MyCount FROM T_ISSUE; end;";

I get the follwoing Exception:

System.Data.OracleClient.OracleException: ORA-06550: line 1, column 25:
PLS-00103: Encountered the symbol "" when expecting one of the following:

   begin function package pragma procedure subtype type use
   <an identifier> <a double-quoted delimited-identifier> form
   current cursor
The symbol "" was ignored.

Anybody know why?

Thanks for your help.

+2  A: 

This is due to VS using windows-style line breaks (CR+LF) but Oracle only accepts Unix-style (LF only).

At least this was the case in VB6.

erikkallen