从FieldA取值,发送到db函数,将值返回给FieldB [英] Take value from FieldA, send to db function, return value to FieldB

查看:57
本文介绍了从FieldA取值,发送到db函数,将值返回给FieldB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Maximo中有一个工作指令.工作订单应用程序具有自定义字段:

I have a work order in Maximo. The work order application has custom fields:

FieldA ='你好'

FieldB

我想从FieldA中获取值并将其传递给Oracle数据库中的函数:

I want to take the value from FieldA and pass it to a function in the Oracle database:

CREATE OR REPLACE function hello_world(var1 in varchar2) return varchar2  
    is
        hw varchar2(15);
    begin
        if var1 = 'Hello'  then 
            hw := var1 || ', World!';
        end if;
        return hw;
    end;
/

我希望FieldB显示该函数返回的值:

And I want FieldB to display the value that was returned by the function:

FieldB = hello_world(FieldA) >>> Hello, World!

我该怎么做?

(版本7.6.1.1;台式机/经典)

(Version 7.6.1.1; desktop/classic)

推荐答案

我将在FieldA上创建一个带有属性启动点的自动化脚本.该脚本将必须使用对数据库管理器的引用和用户的连接键来直接连接到数据库,然后使用一些标准的java.sql调用来创建一条语句,执行该语句并提取结果.然后将结果放入FieldB.

I would create an Automation Script with an Attribute Launch Point on FieldA. The script will have to use a reference to the database manager and the user's connection key to connect directly to the database, and then use some standard java.sql calls to create a statement, execute it, and extract the results. Then it would put the results in FieldB.

要执行所有操作,请 Java 8 JavaDocs 在Maximo内部提供的自动化脚本帮助之上.

To do all that, it will help to have the Maximo business objects JavaDocs and the Java 8 JavaDocs on hand, on top of the Automation Scripting help available from within Maximo.

如果您需要某人为您进行编码,建议您雇用一名顾问. :-)

If you need someone to do that coding for you, I suggest hiring a consultant. :-)

所有这些,您应该尽可能使用自动化脚本来执行数据库功能.直言不讳,您要执行的操作不被视为好习惯.因此,请确保在脚本注释中包含不遵循良好做法的理由.

And all that said, you should just use the automation script to do what you have the database function doing, if at all possible. To be more blunt, what you are wanting to do is not considered good practice. So, make sure to include in your script's comments your justification for not following good practice.

这篇关于从FieldA取值,发送到db函数,将值返回给FieldB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆