views:

49

answers:

2

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 impact 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

+1  A: 

Hi Michel,

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                         
Vincent Malgrat
Yes we could but as we are migrating a big application this would have a very big impact on the code.
Michel
A: 

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?

APC
We are migrating an application from Oracle 9i to Oracle 10g.This difference in typing impacted our application so I thought this could be configurable somewhere in Oracle.However as Gary pointed out, the difference seems to come from the cursor sharing parameter.Thanks
Michel