SQL 语法帮助

发布于 2024-09-28 22:05:08 字数 615 浏览 4 评论 0原文

我不太擅长 sql,我试图理解我以前从未见过的 sql 语句。我们正在使用 Oracle 和 IBatis 框架,因此这可能特定于其中之一。我不太确定。

SELECT 
....
,....
,....
, PKG_LABEL.GET_LABEL_NAME('UOM',T100.CASE_DIM_UOM_CODE) AS caseDimensionsUOM
, PKG_LABEL.GET_LABEL_NAME('UOM',T100.ITEM_DIM_UOM_CODE) AS itemDimensionsUOM
, PKG_LABEL.GET_LABEL_NAME('UOM',T100.CASE_WEIGHT_UOM_CODE) AS caseWeightUOM
, PKG_LABEL.GET_LABEL_NAME('UOM',T100.PALLET_WEIGHT_UOM_CODE) AS unitNetWeightUOM

FROM 

[..snipped..]

乍一看,我以为 PKG_LABEL 只是一个表别名,但它似乎正在调用一个函数。我对存储过程没有太多经验,所以我想知道它是否是一个。

我会在谷歌中查找它,但我不知道它到底是什么,所以我不知道该使用什么搜索词。

简短的解释和一些链接就可以了。

I am not very good with sqls and I am trying to understand an sql statement which I haven't seen before. We're using Oracle and the IBatis framework so this might be specific to one of those. I am not really sure.

SELECT 
....
,....
,....
, PKG_LABEL.GET_LABEL_NAME('UOM',T100.CASE_DIM_UOM_CODE) AS caseDimensionsUOM
, PKG_LABEL.GET_LABEL_NAME('UOM',T100.ITEM_DIM_UOM_CODE) AS itemDimensionsUOM
, PKG_LABEL.GET_LABEL_NAME('UOM',T100.CASE_WEIGHT_UOM_CODE) AS caseWeightUOM
, PKG_LABEL.GET_LABEL_NAME('UOM',T100.PALLET_WEIGHT_UOM_CODE) AS unitNetWeightUOM

FROM 

[..snipped..]

At first glance I thought the PKG_LABEL was merely a table alias but it seems that it is calling a function. I haven't had much experience with stored procedures so I am wondering if it is one.

I would have looked this up in Google but I don't know what it exactly is so I don't know what search term to use.

A brief explanation and some links will be okay.

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

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

发布评论

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

评论(4

孤者何惧 2024-10-05 22:05:08

我对 iBatis 不太了解,但是这里的 PKG_LABEL 可能是数据库中的一个“包”。
要查看是否存在具有该名称的包,您可以运行此查询

SELECT * FROM user_objects
    WHERE    object_type = 'PACKAGE' AND object_name = 'PKG_LABEL';

您可以了解包 此处

I don't know much about iBatis, but PKG_LABEL here could be a 'package' in the database.
To see if a package with that name exists, you can run this query

SELECT * FROM user_objects
    WHERE    object_type = 'PACKAGE' AND object_name = 'PKG_LABEL';

You can get to know about packages here

蓝海 2024-10-05 22:05:08

PKG_LABEL可能指的是一个包。

这是一组(相关)函数/过程的预言机名称。

PKG_LABEL probably refers to a package.

Thats the oracle name for a group of (related) functions/procedures.

扛刀软妹 2024-10-05 22:05:08

在您的架构中尝试查找名为 PKG_LABEL 的包。

在它的主体中,您应该找到一个名为 GET_LABEL_NAME 的函数,查看它的代码以了解它的作用......

Look in your schema a try to find a package names PKG_LABEL.

In its body, you should find a function named GET_LABEL_NAME , take a look at its code to know what it does...

怀念你的温柔 2024-10-05 22:05:08

PKG_LABEL 是一个 PL/SQL ,它是 PL/SQL 函数和程序。 GET_LABEL_NAME 是该包中的一个函数,它将对其参数执行一些逻辑并返回一个值(在本例中可能是一个字符串)。

PKG_LABEL is a PL/SQL package, which is a collection of PL/SQL functions and procedures. GET_LABEL_NAME is a function within that package, which will perform some logic on its arguments and return a value (probably a character string in this case).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文