oracle中这些不同的sql表相当于什么

发布于 2024-10-22 12:58:22 字数 599 浏览 6 评论 0原文

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 转换为 oracle 语法?

谢谢!

SQL tables:

sys.types
sysobjects
syscolumns
sysindexes
INFORMATION_SCHEMA.COLUMNS

Can you also help me convert this to oracle syntax

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

are there any tools out there that can easily convert sql-to-oracle syntax?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

美男兮 2024-10-29 12:58:22
sysobjects  <-> USER_OBJECTS
syscolumns  <-> USER_TAB_COLUMNS
sysindexes <-> USER_INDEXES

您可以使用 ALL/DBA 而不是 USER,具体取决于您想要搜索的范围(以及您在数据库中的角色)

请参阅 参考了解更多信息。

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

sysobjects  <-> USER_OBJECTS
syscolumns  <-> USER_TAB_COLUMNS
sysindexes <-> USER_INDEXES

you can use ALL/DBA instead of USER depending on the scope you like to search in (and your Role in the Database)

See the Reference for more Info.

And Check: Oracle Functions Pl/SQL for the conversion

甜妞爱困 2024-10-29 12:58:22

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

顺便说一句,用于转换 SQL 语法 -> ; Oracle语法,你必须首先进行这个比较。

This will definately help you out. It's free.

Btw, for converting your SQL syntax-> Oracle syntax, you must first, go through this comparison.

旧城烟雨 2024-10-29 12:58:22
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;
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;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文