SQL 语法帮助
我不太擅长 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我对 iBatis 不太了解,但是这里的 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
You can get to know about packages here
PKG_LABEL可能指的是一个包。
这是一组(相关)函数/过程的预言机名称。
PKG_LABEL probably refers to a package.
Thats the oracle name for a group of (related) functions/procedures.
在您的架构中尝试查找名为 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...
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).