This repository has been archived on 2020-02-24. You can view files and clone it, but cannot push or open issues or pull requests.
plsql-spec-example/source/betwnstr.rb

20 lines
407 B
Ruby
Raw Normal View History

2020-01-16 11:11:30 +00:00
# example from utPLSQL project (http://utplsql.sourceforge.net/)
plsql.execute <<-SQL
CREATE OR REPLACE FUNCTION betwnstr (
string_in IN VARCHAR2,
start_in IN INTEGER,
end_in IN INTEGER
)
RETURN VARCHAR2
IS
l_start PLS_INTEGER := start_in;
BEGIN
IF l_start = 0
THEN
l_start := 1;
END IF;
RETURN (SUBSTR (string_in, l_start, end_in - l_start + 1));
END;
SQL