开发者

Configuring implicit typing rules for Oracle

开发者 https://www.devze.com 2022-12-20 03:19 出处:网络
Is it possible to configure the implicit typing rule in Oracle Server (at least version 10g) ? If not a link to the documentation of the rules and how Oracle parameters impa开发者_StackOverflow中文版c

Is it possible to configure the implicit typing rule in Oracle Server (at least version 10g) ? If not a link to the documentation of the rules and how Oracle parameters impa开发者_StackOverflow中文版ct the rules would be great.

For exemple when executing this query :

SELECT '' AS A FROM DUAL

Oracle will report that column A has VARCHAR(0) type on Oracle 10g and VARCHAR(32) on Oracle 9i.

Thanks


you can be explicit, it will work with all versions of Oracle:

SQL> CREATE VIEW test AS SELECT CAST(NULL AS VARCHAR2(32)) var32 FROM DUAL;

View created

SQL> desc test
Name  Type         Nullable Default Comments 
----- ------------ -------- ------- -------- 
VAR32 VARCHAR2(32) Y                         


As Gary says, the default datatype is CHAR....

SQL> create view v23 as select '' a from dual
  2  /

View created

SQL> desc a
Name               Null?    Type
------------------ -------- --------------- 
A                           CHAR             

What problem are you trying to solve?

0

精彩评论

暂无评论...
验证码 换一张
取 消