📄 stringtypes.sql
字号:
---- this test shows the current supported char, varchar, and long varchar-- functionality---- create a table with null and non-null char columns of different lengthscreate table ct (c1 char, c2 char(5) not null, c3 char(30) default null);-- insert some rows-- first, try values that fill each column with non-blanksinsert into ct values ('1', '11111', '111111111111111111111111111111');-- now try some values that are shorter than the columnsinsert into ct values ('', '22', '222');-- now try some values that are longer than the columns, where the excess-- characters are blanksinsert into ct values ('3 ', '33333 ', '333333333333333333333333333333 ');-- now try some values that are longer than the columns, where the excess-- characters are non-blanks. These should get errorsinsert into ct values ('44', '4', '4');insert into ct values ('5', '555555', '5');insert into ct values ('6', '66666', '6666666666666666666666666666666');-- now try inserting some nulls, first in columns that accept theminsert into ct values (null, '77777', null);-- now try inserting nulls into columns that don't accept theminsert into ct values ('8', null, '8');-- now check the rows that made it into the table successfullyselect * from ct;-- now try the char_length function on the columnsselect {fn length(c1)}, {fn length(c2)}, {fn length(c3)} from ct;-- now create a table with varchar columnscreate table vt (c1 varchar(1), c2 varchar(5) not null, c3 varchar(30) default null);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -