def test_oracle_clobproc(): e = xsc.Frag(toxic.proc(), toxic.args("c_out out clob"), oraclecode()) tmpl = e.conv().string(encoding="ascii") sql = toxicc.compile(tmpl) print(sql) assert "dbms_lob.createtemporary" in sql assert "procedure write" in sql assert "c_out out clob" in sql
def test_sqlserver_clobproc(): e = xsc.Frag( toxic.proc(), toxic.args("@c_out varchar(max) output"), sqlservercode(), ) tmpl = e.conv().string(encoding="ascii") sql = toxicc.compile(tmpl, mode="sqlserver") assert "@c_out varchar(max) output" in sql assert "set @c_out = @c_out +" in sql
def test_oracle_clobproc(): e = xsc.Frag( toxic.proc(), toxic.args("c_out out clob"), oraclecode() ) tmpl = e.conv().string(encoding="ascii") sql = toxicc.compile(tmpl) print(sql) assert "dbms_lob.createtemporary" in sql assert "procedure write" in sql assert "c_out out clob" in sql
def test_oracle_varcharproc(): e = xsc.Frag( toxic.proc(), toxic.type("varchar2(20000)"), toxic.args("c_out out varchar2(20000)"), oraclecode(), ) tmpl = e.conv().string(encoding="ascii") sql = toxicc.compile(tmpl) assert "dbms_lob.createtemporary" not in sql assert "procedure write" not in sql assert "c_out := c_out ||" in sql assert "c_out out varchar2(20000)" in sql