I'm trying to write a diff procedure in pl/sql. The error message never says what the structure should be like, only it expected some other symbol, usually that would indicate the end of the line. Also I keep getting errors on example code...
- Why does it stop at the first error instead of giving a list of all errors found?
- CREATE TYPE EditCost, found EditCost, expecting some other symbol.
- cost_matrix INTEGER[, found [, expecting some other symbol.
- original.length, invalid reference.
- cost_matrix[, found [, expecting some other symbol.
- return cost_matrix, no value allowed after return, then how am I to return values?
This code gives me many errors, I removed parts only to find errors in other parts.
CREATE OR REPLACE PROCEDURE diff_string(original in varchar2, other in varchar2, result out varchar2)
is -- Maybe should be as, don't know.
CREATE TYPE EditCost { 'Change', 'Copy', 'Delete', 'Insert', 'Kill' };
cost_matrix INTEGER[original.length, other.length];
BEGIN
IF original = NULL THEN
result := other;
ELSIF other = NULL then
result := original;
else
for i in 1 .. length(original)
loop
for j in 1 .. length(other)
loop
cost_matrix[i, j] := i * j;
end loop;
end loop;
return cost_matrix;
end if;
END diff_string;
/