Sql Server到Oracle PL SQL转换

时间:2014-07-03 07:59:56

标签: sql-server oracle plsql sql-server-2008-r2 oracle-sqldeveloper

这个sqlserver代码在Oracle中的样子如何?

set @Date= (select Convert(nvarchar(30), (select YEAR(Getdate()))) + 
            Convert(nvarchar(10), (SELECT RIGHT('00' + @month, 2))) + 
            Convert(nvarchar(10), (SELECT RIGHT('00' + @day, 2))));

1 个答案:

答案 0 :(得分:1)

some_var := to_char(sysdate,'yyyy-mm-dd');

有关to_char()功能的更多详细信息,请参见手册:
 http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions200.htm#SQLRF06129