on 2015 Sep 22 10:39 AM
Some skripts we've used for year with SA11 up to SA16 start throwing errors when used with SA17, complaining about Transact Syntax in a Watcom function.
Example:
I'd suppose SA would be able to differentiate between a Watcom FUNCTION and the TRANSACT style (which doesn't support the IN keyword in the parameter list, according to the docs, but uses AS before the statement block).
What can I do to fix this? Have I overlooked anything?
create or replace function FuncTest (@charVal char(30), @intVal integer= null) returns integer begin return @intVal; end
which throws the (german) error message:
Anweisung konnte nicht ausgeführt werden.
Syntaxfehler bei ';' in Zeile 5 (Transact-SQL)
SQLCODE=-131, ODBC 3-Status="42000"
Zeile 1, Spalte 1
That exposed the actual source of the problem: because the function contains nearly no code, the parser must be tripping over the assignment of a default value via the operator "=" instead of using DEFAULT (as defined by the syntax description).
We got a pack of SPs defined that way, since we started using default values for procedures / functions starting IIRC with ASA9. Ever since no one bothered to write DEFAULT, if "=" would do the trick.
I'v checked that the sample above is accepted and works correctly with ASA9, SA11, SA12 and SA16.
So the question should rather be converted to an Enhancement Request :
Extend the syntax for the parameter definition part [ DEFAULT expression ] to [ {DEFAULT | = } expression ] (or sth. like that).
User | Count |
---|---|
82 | |
12 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.