开发者

Issue with to_char in sqlplus

开发者 https://www.devze.com 2023-03-24 05:38 出处:网络
When I try to use a query like below it does not give me any o开发者_运维百科utput . its oracle 8i client connecting to 10g database.

When I try to use a query like below it does not give me any o开发者_运维百科utput . its oracle 8i client connecting to 10g database.

SQL> SELECT (to_char(sysdate,'MM/DD/YYYY HH24:MI:SS')) from dual;

(TO_CHAR(SYSDATE,'M
-------------------


SQL>

Also, a query without the to_char function works without any issues. When I use the same command in another 8i client connecting to 10g, its working fine. I compared the SQL session settings and they look same.

any inputs on this is highly appreciated.


Check the dates and crc checksums on the client executables. I'd suspect one is an old version with a bug. You don't give the underlying platforms of the different clients, so it may be a bug that was/is present in (for example) Windows but not *nix

Do you use an 'odd' character set on the client. There could be some unwanted character set conversion.

Why are you using an 8i client ?

An upgrade to a new client (eg the Database Express Edition client) might be appropriate.

What do you get if you try to select a straight VARCHAR2 variable (eg SELECT DUMMY FROM DUAL)

PS. Community wiki so anyone can add suggestions and code snippets


try

SELECT to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') as formmated_date from dual;
0

精彩评论

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