📄 ejbql.out
字号:
A -----------1 ij> create table myconcat( a varchar(10) default null, b varchar(10) default null, c int);0 rows inserted/updated/deletedij> insert into myconcat (c) values( 1 );1 row inserted/updated/deletedij> insert into myconcat (c) values( 2 );1 row inserted/updated/deletedij> insert into myconcat (a) values( 'hello' );1 row inserted/updated/deletedij> insert into myconcat (b) values( 'world' );1 row inserted/updated/deletedij> insert into myconcat (a,b) values( 'hello', 'world' );1 row inserted/updated/deletedij> select * from myconcat;A |B |C ---------------------------------NULL |NULL |1 NULL |NULL |2 hello |NULL |NULL NULL |world |NULL hello |world |NULL ij> select { fn concat( a, b ) } from myconcat;1 --------------------NULL NULL NULL NULL helloworld ij> drop table concat;0 rows inserted/updated/deletedij> drop table myconcat;0 rows inserted/updated/deletedij> -- End of CONCAT test-- This test the EJBQL function, LOCATE. Resolve 3535-- LOCATE( string1, string2[, start] ) --- string1, searching from the beginning-- of string2 }; if start is specified, the search begins from position start.-- 0 is returned if string2 does not contain string1. Position1 is the first-- character in string2.-- Begin of LOCATE test-- Basic-- 2 argsvalues{ fn locate( 'hello', 'hello' ) };1 -----------1 ij> values{ fn locate( 'hello', 'hellohello' ) };1 -----------1 ij> values{ fn locate( 'hello', 'helloworld' ) };1 -----------1 ij> values{ fn locate( 'hello', 'h?hello' ) };1 -----------3 ij> values{ fn locate( 'hello', 'match me, hello now!' ) };1 -----------11 ij> values{ fn locate( '?', '?' ) };1 -----------1 ij> values{ fn locate( '\', '\\') };1 -----------1 ij> values{ fn locate( '/', '//') };1 -----------1 ij> values{ fn locate( '\\', '\') };1 -----------0 ij> values{ fn locate( '//', '/') };1 -----------0 ij> values{ fn locate( '', 'test' ) };1 -----------1 ij> values{ fn locate( '', '' ) };1 -----------1 ij> values{ fn locate( 'test', '' ) };1 -----------0 ij> -- 3 args values{ fn locate( 'hello', 'hello',-1 ) };1 -----------ERROR 22014: The start position for LOCATE is invalid; it must be a positive integer. The index to start the search from is '-1'. The string to search for is 'hello'. The string to search from is 'hello'. ij> values{ fn locate( 'hello', 'hello',-0 ) };1 -----------ERROR 22014: The start position for LOCATE is invalid; it must be a positive integer. The index to start the search from is '0'. The string to search for is 'hello'. The string to search from is 'hello'. ij> values{ fn locate( 'hello', 'hello', 0 ) };1 -----------ERROR 22014: The start position for LOCATE is invalid; it must be a positive integer. The index to start the search from is '0'. The string to search for is 'hello'. The string to search from is 'hello'. ij> values{ fn locate( 'hello', 'hello', 1 ) };1 -----------1 ij> values{ fn locate( 'hello', 'hello', 2 ) };1 -----------0 ij> values{ fn locate( 'hello', 'hello', 5 ) };1 -----------0 ij> values{ fn locate( 'hello', 'hello', 9 ) };1 -----------0 ij> values{ fn locate( 'hello', 'hellohello', 0 ) };1 -----------ERROR 22014: The start position for LOCATE is invalid; it must be a positive integer. The index to start the search from is '0'. The string to search for is 'hello'. The string to search from is 'hellohello'. ij> values{ fn locate( 'hello', 'hellohello', 1 ) };1 -----------1 ij> values{ fn locate( 'hello', 'hellohello', 2 ) };1 -----------6 ij> values{ fn locate( 'hello', 'hellohello', 5 ) };1 -----------6 ij> values{ fn locate( 'hello', 'hellohello', 6 ) };1 -----------6 ij> values{ fn locate( 'hello', 'hellohello', 7 ) };1 -----------0 ij> values{ fn locate( 'hello', 'h?hello', 1 ) };1 -----------3 ij> values{ fn locate( 'hello', 'h?hello', 2 ) };1 -----------3 ij> values{ fn locate( 'hello', 'h?hello', 3 ) };1 -----------3 ij> values{ fn locate( 'hello', 'h?hello', 4 ) };1 -----------0 ij> values{ fn locate( 'hello', 'match me, hello now!', 7 ) };1 -----------11 ij> values{ fn locate( 'hello', 'match me, hello now!', 15 ) };1 -----------0 ij> values{ fn locate( '?', '?',-1 ) };1 -----------ERROR 22014: The start position for LOCATE is invalid; it must be a positive integer. The index to start the search from is '-1'. The string to search for is '?'. The string to search from is '?'. ij> values{ fn locate( '?', '?',-0 ) };1 -----------ERROR 22014: The start position for LOCATE is invalid; it must be a positive integer. The index to start the search from is '0'. The string to search for is '?'. The string to search from is '?'. ij> values{ fn locate( '?', '?', 0 ) };1 -----------ERROR 22014: The start position for LOCATE is invalid; it must be a positive integer. The index to start the search from is '0'. The string to search for is '?'. The string to search from is '?'. ij> values{ fn locate( '?', '?', 1 ) };1 -----------1 ij> values{ fn locate( '?', '?', 2 ) };1 -----------0 ij> values{ fn locate( '\', '\\',0) };1 -----------ERROR 22014: The start position for LOCATE is invalid; it must be a positive integer. The index to start the search from is '0'. The string to search for is '\'. The string to search from is '\\'. ij> values{ fn locate( '\', '\\',1) };1 -----------1 ij> values{ fn locate( '\', '\\',2) };1 -----------2 ij> values{ fn locate( '\', '\\',3) };1 -----------0 ij> values{ fn locate( '/', '//',0) };1 -----------ERROR 22014: The start position for LOCATE is invalid; it must be a positive integer. The index to start the search from is '0'. The string to search for is '/'. The string to search from is '//'. ij> values{ fn locate( '/', '//',1) };1 -----------1 ij> values{ fn locate( '/', '//',2) };1 -----------2 ij> values{ fn locate( '/', '//',3) };1 -----------0 ij> values{ fn locate( '\\', '\',1) };1 -----------0 ij> values{ fn locate( '//', '/',1) };1 -----------0 ij> values{ fn locate( '', 'test',1) };1 -----------1 ij> values{ fn locate( '', 'test',2) };1 -----------2 ij> values{ fn locate( '', 'test',3) };1 -----------3 ij> values{ fn locate( '', 'test',4) };1 -----------4 ij> values{ fn locate( '', 'test',5) };1 -----------5 ij> values{ fn locate( '', '' ,1) };1 -----------1 ij> values{ fn locate( 'test', '',1) };1 -----------0 ij> values{ fn locate( 'test', '',2) };1 -----------0 ij> values{ fn locate( 'test', '',3) };1 -----------0 ij> values{ fn locate( 'test', '',4) };1 -----------0 ij> values{ fn locate( 'hello', 1 ) };ERROR 42884: No authorized routine named 'LOCATE' of type 'FUNCTION' having compatible arguments was found.ij> values{ fn locate( 1, 'hello' ) };ERROR 42884: No authorized routine named 'LOCATE' of type 'FUNCTION' having compatible arguments was found.ij> values{ fn locate( 'hello', 'hello', 'hello' ) };ERROR 42884: No authorized routine named 'LOCATE' of type 'FUNCTION' having compatible arguments was found.ij> values{ fn locate( 'hello', 'hello', 1.99999999999 ) };ERROR 42884: No authorized routine named 'LOCATE' of type 'FUNCTION' having compatible arguments was found.ij> values{ fn locate( 1, 'hel1lo' ) };ERROR 42884: No authorized routine named 'LOCATE' of type 'FUNCTION' having compatible arguments was found.ij> values{ fn locate( 1, 1 ) };ERROR 42884: No authorized routine named 'LOCATE' of type 'FUNCTION' having compatible arguments was found.ij> values{ fn locate( 1, 1, '1' ) };ERROR 42884: No authorized routine named 'LOCATE' of type 'FUNCTION' having compatible arguments was found.ij> values{ fn locate( '1', 1, 1 ) };ERROR 42884: No authorized routine named 'LOCATE' of type 'FUNCTION' having compatible arguments was found.ij> values{ fn locate( '1', '1', '1' ) };ERROR 42884: No authorized routine named 'LOCATE' of type 'FUNCTION' having compatible arguments was found.ij> -- End of EJBQL function test for LOCATE.-- This test the EJBQL function, LOCATE. Resolve 3535-- LOCATE( string1, string2[, start] ) --- string1, searching from the beginning-- of string2; if start is specified, the search begins from position start.-- 0 is returned if string2 does not contain string1. Position1 is the first-- character in string2.-- Begin of LOCATE test-- Basiccreate table locate( a varchar(20) );0 rows inserted/updated/deletedij> -- create table myChar( a char(10), b char(20), c int default '1' );create table myChar( a char(10), b char(20), c int );0 rows inserted/updated/deletedij> insert into myChar (a, b) values( '1234567890', 'abcde1234567890fghij' );1 row inserted/updated/deletedij> insert into myChar (a, b) values( 'abcdefghij', 'abcdefghij1234567890' );1 row inserted/updated/deletedij> insert into myChar (a, b) values( 'abcdefghij', '1234567890abcdefghij' );1 row inserted/updated/deletedij> insert into myChar (a, b) values( 'abcdefghij', '1234567890!@#$%^&*()' );1 row inserted/updated/deletedij> insert into myChar values( '1234567890', 'abcde1234567890fghij', 2 );1 row inserted/updated/deletedij> insert into myChar values( 'abcdefghij', 'abcdefghij1234567890', 1 );1 row inserted/updated/deletedij> insert into myChar values( 'abcdefghij', '1234567890abcdefghij', 15 );1 row inserted/updated/deletedij> insert into myChar (c) values( 0 );1 row inserted/updated/deletedij> insert into myChar (c) values( 1 );1 row inserted/updated/deletedij> insert into myChar (c) values( 2 );1 row inserted/updated/deletedij> insert into myChar (a) values( 'hello' );1 row inserted/updated/deletedij> insert into myChar (b) values( 'hello' );1 row inserted/updated/deletedij> insert into myChar values( 'abcdefghij', '1234567890!@#$%^&*()', 21 );1 row inserted/updated/deletedij> select a, b, c from myChar;A |B |C -------------------------------------------1234567890|abcde1234567890fghij|NULL abcdefghij|abcdefghij1234567890|NULL abcdefghij|1234567890abcdefghij|NULL abcdefghij|1234567890!@#$%^&*()|NULL 1234567890|abcde1234567890fghij|2 abcdefghij|abcdefghij1234567890|1 abcdefghij|1234567890abcdefghij|15 NULL |NULL |0 NULL |NULL |1 NULL |NULL |2 hello |NULL |NULL NULL |hello |NULL abcdefghij|1234567890!@#$%^&*()|21 ij> select locate(a, b) from myChar;1 -----------6 1 11 0 6 1 11 NULL NULL NULL NULL NULL 0 ij> select locate(a, b, c) from myChar;1 -----------6 1 11 0 6 1 0 NULL NULL NULL NULL NULL 0 ij> drop table myChar;0 rows inserted/updated/deletedij> create table myLongVarChar( a long varchar, b long varchar, c int);0 rows inserted/updated/deletedij> insert into myLongVarChar (a, b) values( '1234567890', 'abcde1234567890fghij' );1 row inserted/updated/deletedij> insert into myLongVarChar (a, b) values( 'abcdefghij', 'abcdefghij1234567890' );1 row inserted/updated/deletedij> insert into myLongVarChar (a, b) values( 'abcdefghij', '1234567890abcdefghij' );1 row inserted/updated/deletedij> insert into myLongVarChar (a, b) values( 'abcdefghij', '1234567890!@#$%^&*()' );1 row inserted/updated/deletedij> insert into myLongVarChar (a, b) values( 'abcde', 'abcde' );1 row inserted/updated/deletedij> insert into myLongVarChar (a, b) values( 'abcde', 'abcd' );1 row inserted/updated/deletedij> insert into myLongVarChar (a, b) values( '', 'abcde' );1 row inserted/updated/deletedij> insert into myLongVarChar (a, b) values( 'abcde', null );1 row inserted/updated/deletedij> insert into myLongVarChar (a, b) values( null, 'abcde' );1 row inserted/updated/deletedij> insert into myLongVarChar values( '1234567890', 'abcde1234567890fghij', 2 );1 row inserted/updated/deletedij> insert into myLongVarChar values( 'abcdefghij', 'abcdefghij1234567890', 1 );1 row inserted/updated/deletedij> insert into myLongVarChar values( 'abcdefghij', '1234567890abcdefghij', 15 );1 row inserted/updated/deletedij> insert into myLongVarChar values( 'abcde', 'abcde', 1 );1 row inserted/updated/deletedij> insert into myLongVarChar values( 'abcde', 'abcd', 1 );1 row inserted/updated/deletedij> insert into myLongVarChar values( '', 'abcde', 2 );1 row inserted/updated/deletedij> insert into myLongVarChar values( 'abcde', null, 1 );1 row inserted/updated/deletedij> insert into myLongVarChar values( null, 'abcde', 1 );1 row inserted/updated/deletedij> insert into myLongVarChar (c) values( 0 );1 row inserted/updated/deletedij> insert into myLongVarChar (c) values( 1 );1 row inserted/updated/deletedij> insert into myLongVarChar (c) values( 2 );1 row inserted/updated/deletedij> insert into myLongVarChar (a) values( 'hello' );1 row inserted/updated/deletedij> insert into myLongVarChar (b) values( 'hello' );1 row inserted/updated/deletedij> insert into myLongVarChar values( 'abcdefghij', '1234567890!@#$%^&*()', 21 );1 row inserted/updated/deletedij> select a, b, c from myLongVarChar;A |B |C -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------1234567890 |abcde1234567890fghij
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -