📄 ij2.sql
字号:
-- this test shows some ij abilities against an active databasecreate table t (i int);insert into t values (3), (4);prepare s as 'select * from t';execute s;remove s;-- now it won't find sexecute s;prepare s as 'select * from t where i=?';-- fails, needs parameterexecute s;-- works, finds valueexecute s using 'values 3';prepare t as 'values 3';-- same as last executeexecute s using t;-- same as last executeexecute 'select * from t where i=?' using 'values 3';-- same as last executeexecute 'select * from t where i=?' using t;-- param that is not needed gets out of range messageexecute 'select * from t where i=?' using 'values (3,4)';-- ignores rows that are not neededexecute 'select * from t where i=?' using 'values 3,4';-- with autocommit off, extra rows are processed and no warning resultsautocommit off;execute 'select * from t where i=?' using 'values 3,4';execute 'select * from t where i=?' using 'values 3';autocommit on;-- will say params not set when no rows in using valuesexecute 'select * from t where i=?' using 'select * from t where i=9';-- will say params not set when using values is not a queryexecute 'select * from t where i=?' using 'create table s (i int)';-- note that the using part was, however, executed...drop table s;-- bug 5926 - make sure the using clause result set got closeddrop table t;create table t(c1 int);insert into t values(1);execute 'select * from t where c1=?' using 'select * from t where c1=1';drop table t;create table t(c1 int);insert into t values(1);insert into t values(2);execute 'select * from t where c1=?' using 'select * from t where c1>=1';drop table t;-- show that long fields now don't take forever...create table t ( c char(50));insert into t values('hello');select cast(c as varchar(20)) from t;drop table t;-- show multiconnect ability; db name is wombat, reuse it...-- assumes ij.protocol is appropriately set...connect 'wombat' as wombat;show connections;set connection connection0;show connections;set connection wombat;disconnect;show connections;set connection connection0;show connections;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -