V
VictorReinhart
<<stored procedures are validated at the time of creation or change. >>
It is true that in C#, there is no validation of SQL when it is
compiled. In PowerBuilder, however, there is. You will get a compiler
warning for any embedded SQL which has a database syntax error, for
example, incorrect column or table name. This can also be turned off.
This is another advantage of embedded SQL. The same applies for stored
procedure calls.
If your C# code which calls a stored procedure has the wrong number or
type of arguments, do you get a warning at compile time?
<<Personally, I'd hate to be the one to hunt down and fix
who-knows-how-many embedded SQL statements in a large project (the size
of those to which you refer in another post), should there ever be a
need to alter the database design. >>
Well, in PowerBuilder, if you compile your application, all SQL errors
in embedded SQL show up as warnings. True, not all my SQL is embedded
-- some is dynamic and most is in datawindows, but the point is that it
is possible for the C# language to be more tightly integrated with
relational databases than it is.
In my opinion, using embedded SQL, given the syntax checking at compile
time, it would actually be much easier to maintain than to maintain
stored procedures. For example, to unit test my embedded SQL, just
copy and paste into SQL*Plus and test it. How do you test your stored
procedures?
It is true that in C#, there is no validation of SQL when it is
compiled. In PowerBuilder, however, there is. You will get a compiler
warning for any embedded SQL which has a database syntax error, for
example, incorrect column or table name. This can also be turned off.
This is another advantage of embedded SQL. The same applies for stored
procedure calls.
If your C# code which calls a stored procedure has the wrong number or
type of arguments, do you get a warning at compile time?
<<Personally, I'd hate to be the one to hunt down and fix
who-knows-how-many embedded SQL statements in a large project (the size
of those to which you refer in another post), should there ever be a
need to alter the database design. >>
Well, in PowerBuilder, if you compile your application, all SQL errors
in embedded SQL show up as warnings. True, not all my SQL is embedded
-- some is dynamic and most is in datawindows, but the point is that it
is possible for the C# language to be more tightly integrated with
relational databases than it is.
In my opinion, using embedded SQL, given the syntax checking at compile
time, it would actually be much easier to maintain than to maintain
stored procedures. For example, to unit test my embedded SQL, just
copy and paste into SQL*Plus and test it. How do you test your stored
procedures?