【问题标题】:what are the equivalent of these various sql table in oracleoracle中这些各种sql表的等价物是什么
【发布时间】:2011-03-14 11:16:40
【问题描述】:

SQL 表:

sys.types 系统对象 系统列 系统索引 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

是否有任何工具可以轻松地将 sql-to-oracle 语法转换?

谢谢!

【问题讨论】:

    标签: sql oracle syntax


    【解决方案1】:
    sysobjects  <-> USER_OBJECTS
    syscolumns  <-> USER_TAB_COLUMNS
    sysindexes <-> USER_INDEXES
    

    您可以使用 ALL/DBA 代替 USER,具体取决于您希望搜索的范围(以及您在数据库中的角色)

    请参阅Reference 了解更多信息。

    并检查:Oracle Functions Pl/SQL 进行转换

    【讨论】:

      【解决方案2】:

      这肯定会帮助你。它是免费的。

      顺便说一句,要转换您的SQL syntax-&gt; Oracle syntax,您必须首先进行此比较。

      【讨论】:

      • 能否请您指向oracle 的sql 开发人员迁移工作台的正确下载链接?当我单击上面的链接时,它会将我重定向到主页。谢谢
      • 尽管可以,但仅链接的答案通常没有帮助。在此处复制相关信息并将链接添加为人们的附加信息。
      【解决方案3】:
      set ServerOutPut on;
      
      DECLARE
           tableUpdateCount number(1) := 0;
           Id number(5);
      /* 
      * CALCDETL.ALIAS - 1
      */
      Begin
      select id into Id 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);
      
          tableUpdateCount := tableUpdateCount + 1; 
          dbms_outPut.Put_line('');
          dbms_outPut.Put_line('1.  ABC.ALIAS exists'); 
      Exception
          when No_Data_found then
                dbms_outPut.Put_line('ABC.ALIAS not found');
      End;
      

      【讨论】:

        猜你喜欢
        • 2010-12-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-10-03
        • 2011-01-20
        • 2010-09-29
        • 1970-01-01
        相关资源
        最近更新 更多