Advertisement
Guest User

Untitled

a guest
May 20th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. FUNCTION no_of_lines(table_name IN VARCHAR2) RETURN NUMBER AS
  2. no_entries NUMBER(10);
  3. sql_stmt VARCHAR2(500);
  4. BEGIN
  5. sql_stmt:='SELECT count(*) FROM '||table_name;
  6. EXECUTE IMMEDIATE sql_stmt INTO no_entries;
  7. RETURN no_entries;
  8. EXCEPTION WHEN NO_DATA_FOUND THEN
  9. RETURN -1; --- 'Tabeleul nu este populat'
  10. END no_of_lines;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement