def test_sqlserver_varcharfunc(): e = xsc.Frag( toxic.type("varchar(20000)"), sqlservercode(), ) tmpl = e.conv().string(encoding="ascii") sql = toxicc.compile(tmpl, mode="sqlserver") assert "declare @c_out varchar(20000)" in sql assert "returns varchar(20000)\n" in sql assert "set @c_out = @c_out +" in sql
def test_sqlserver_varcharfunc(): e = xsc.Frag( toxic.type("varchar(20000)"), sqlservercode(), ) tmpl = e.conv().string(encoding="ascii") sql = toxicc.compile(tmpl, mode="sqlserver") assert "declare @c_out varchar(20000)" in sql assert "returns varchar(20000)\n" in sql assert "set @c_out = @c_out +" in sql
def test_oracle_varcharfunc(): e = xsc.Frag( toxic.type("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 "return varchar2\n" in sql
def test_sqlserver_varcharproc(): e = xsc.Frag( toxic.proc(), toxic.type("varchar(20000)"), toxic.args("@c_out varchar(20000) output"), sqlservercode(), ) tmpl = e.conv().string(encoding="ascii") sql = toxicc.compile(tmpl, mode="sqlserver") assert "c_out varchar(20000) output" in sql assert "set @c_out = @c_out +" in sql
def test_oracle_varcharfunc(): e = xsc.Frag( toxic.type("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 "return varchar2\n" in sql
def test_sqlserver_varcharproc(): e = xsc.Frag( toxic.proc(), toxic.type("varchar(20000)"), toxic.args("@c_out varchar(20000) output"), sqlservercode(), ) tmpl = e.conv().string(encoding="ascii") sql = toxicc.compile(tmpl, mode="sqlserver") assert "c_out varchar(20000) output" in sql assert "set @c_out = @c_out +" in sql