SQL 表:
sys.types sysobjects syscolumns sysindexes INFORMATION_SCHEMA.COLUMNS
你能不能帮我把它转换成 oracle 语法
DECLARE @tableUpdateCount tinyint
set @tableUpdateCount = 0
/*
* CALCDETL.ALIAS - 1
*/
if exists (select * from syscolumns where id = (select id from sysobjects where name = 'ABC' and type = 'U') and name = 'ALIAS' and xusertype = (select user_type_id from sys.types where name = 'nvarchar') and prec = 20)
begin
set @tableUpdateCount = @tableUpdateCount + 1
print ' '
print '1. ABC.ALIAS exists'
end
Run Code Online (Sandbox Code Playgroud)
是否有任何工具可以轻松地将 sql-to-oracle 语法转换?
谢谢!
sysobjects <-> USER_OBJECTS
syscolumns <-> USER_TAB_COLUMNS
sysindexes <-> USER_INDEXES
Run Code Online (Sandbox Code Playgroud)
您可以使用 ALL/DBA 而不是 USER,具体取决于您想搜索的范围(以及您在数据库中的角色)
有关更多信息,请参阅参考资料。
并检查:Oracle Functions Pl/SQL的转换