Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISQL: Provide actual types of COMPUTED-BY fields in SHOW TABLE output [CORE5096] #5381

Open
firebird-automations opened this issue Feb 1, 2016 · 0 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

It will be useful to see actual types of computed fields in the 'SHOW TABLE' output.
Currently one need to look at table DDL by using ISQL -X.

Test:
#⁠#⁠#⁠#⁠

recreate table t1 (
n0 int

 ,si smallint computed by\(32767\)
,bi bigint computed by \(2147483647\)
,s2 smallint computed by \( mod\(bi, nullif\(si,0\)\) \)

,dx double precision computed by \(pi\(\)\)
,fx float computed by \(dx\*dx\)
,nf numeric\(3,1\) computed by \(fx\)

,dt date computed by \('now'\)
,tm time computed by \('now'\)
\-\- eval not supported: ,dx  computed by \( dateadd\(1 day to dt\) \)

,c1 char character set win1251 computed by \('ы'\)
,c2 char character set win1252 computed by \('å'\)
,cu char character set utf8 computed by \('∑'\)

,c1x char computed by\(c1\)
,c2x char computed by\(c2\)
,cux char computed by\(cu\)

,b1 blob character set win1251 computed by \('ы'\)
,b2 blob character set win1252 computed by \('ä'\)
,bu blob character set utf8 computed by \('∑'\)
,bb blob computed by \('∞'\)

,b1x blob computed by \(b1\)
,b2x blob computed by \(b2\)
,bux blob computed by \(bu\)
,bbx blob computed by \(bb\)

);
commit;

show table t1;

Output:
#⁠#⁠#⁠#⁠#⁠#⁠

N0 INTEGER Nullable
SI Computed by: (32767)
BI Computed by: (2147483647)
S2 Computed by: ( mod(bi, nullif(si,0)) )
DX Computed by: (pi())
FX Computed by: (dx*dx)
NF Computed by: (fx)
DT Computed by: ('now')
TM Computed by: ('now')
C1 Computed by: ('ы')
C2 Computed by: ('å')
CU Computed by: ('∑')
C1X Computed by: (c1)
C2X Computed by: (c2)
CUX Computed by: (cu)
B1 Computed by: ('ы')
B2 Computed by: ('ä')
BU Computed by: ('∑')
BB Computed by: ('∞')
B1X Computed by: (b1)
B2X Computed by: (b2)
BUX Computed by: (bu)
BBX Computed by: (bb)

PS. "ISQL -x" will show proper types for computed by fields only since build 32306 (01-feb-2016):

CREATE TABLE T1 (N0 INTEGER,
SI SMALLINT COMPUTED BY (0),
BI BIGINT COMPUTED BY (1),
FL FLOAT COMPUTED BY (3.14),
DT DATE COMPUTED BY ('now'),
TM TIME COMPUTED BY ('now'),
C1 CHAR(1) CHARACTER SET WIN1251 COMPUTED BY ('ы'),
C2 CHAR(1) CHARACTER SET WIN1252 COMPUTED BY ('å'),
CU CHAR(1) COMPUTED BY ('∑'),
B1 BLOB SUB_TYPE TEXT SEGMENT SIZE 80 CHARACTER SET WIN1251 COMPUTED BY ('ы'),
B2 BLOB SUB_TYPE TEXT SEGMENT SIZE 80 CHARACTER SET WIN1252 COMPUTED BY ('ä'),
BU BLOB SUB_TYPE TEXT SEGMENT SIZE 80 COMPUTED BY ('∑'),
BB BLOB SUB_TYPE 0 SEGMENT SIZE 80 COMPUTED BY ('∞'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant