我可以在Oracle中使用UTILS吗? [英] Can I use UTILS in Oracle?
问题描述
我想问一下我是否可以在Oracle中使用以下内容:
I want to ask if I can use the following in Oracle:
UTILS.CONVERT_TO_VARCHAR2
例如:
SELECT insertData,
UTILS.CONVERT_TO_VARCHAR2(insertData,10,p_style=>104) insert_short
FROM students
如果无法使用UTILS
软件包,那么我可以使用哪种替代方法?
If it is not possible to use UTILS
package, so which alternative I can use?
推荐答案
基本上是.我的猜测是,您已经使用了一些SQL Server T-SQL,并通过Oracle SQL Developer转换器(工具-迁移-临时编辑器)运行了它,这是另一面的事情.如果您在草稿编辑器中单击左侧第二个图标,则SQL Developer将为您生成UTILS程序包-这是一个棕色程序包,从外观上看,它捆绑了红色字符串.
Basically, yes. My guess is that you've taken some SQL Server T-SQL and run it through the Oracle SQL Developer Translator (Tools - Migration - Scratch Editor) and this is what came out the other side. UTILS is a package which SQL Developer will generate for you if you click on the second icon from the left in the scratch editor - it's a brown package tied up with red string by the looks of it.
这会生成一堆PL/SQL-在其中搜索CONVERT_TO_VARCHAR2(有多个重载),并且有您可以使用的代码.当然,您还需要熟悉GET_FORMAT_FROM_STYLE.
This generates a bunch of PL/SQL - Search in it for CONVERT_TO_VARCHAR2 (there are several overloads) and there is the code you can use however you want. You will of course also need to familiarise yourself with GET_FORMAT_FROM_STYLE.
顺便说一句,我看不到草稿编辑器如何创建软件包规范,因此您似乎需要手工完成.
这篇关于我可以在Oracle中使用UTILS吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!