SQL>
SQL>
SQL> CREATE OR REPLACE FUNCTION rulerstr (len IN INTEGER) RETURN VARCHAR2
2 IS
3 digits CHAR(10) := '1234567890';
4 BEGIN
5 RETURN RPAD (digits, len, digits);
6 END;
7 /
Function created.
SQL>
SQL> select rulerstr(3) from dual;
RULERSTR(3)
----------------------------------------------------------------------------------------------------
123
SQL>
|