如何从SQL数据库更新字段

时间:2021-11-22 07:25:03

I have a lotus notes application that has a document with a Number, and a description field.

我有一个Lotus Notes应用程序,它有一个带有Number的文档和一个描述字段。

Users reserve a series of numbers at which point documents are created. They then fill in the description and a few other things.

用户保留一系列数字,在此处创建文档。然后他们填写描述和其他一些东西。

Once this is done they go into another, application (Qpulse; not a notes application) that stores its data in an SQL database. They will create documents in that system with matching numbers.

完成后,他们会进入另一个应用程序(Qpulse;而不是注释应用程序),将其数据存储在SQL数据库中。他们将在该系统中创建具有匹配数字的文档。

Once the documents are created in that system (Qpulse) i'd like update the description field in notes.

一旦在该系统中创建文档(Qpulse),我想更新注释中的描述字段。

How i've done it in the past is to have a notes agent running that does a query, looping through the results finding and updating notes documents.

我过去的工作原理是运行一个注释代理来执行查询,循环查找结果并更新注释文档。

Is there a better way of doing this? It would be nice to have it automatically updating.

有更好的方法吗?让它自动更新会很高兴。

2 个解决方案

#1


1  

Using an agent like you have already is IMHO the simplest solution.

使用像你这样的代理商是恕我直言最简单的解决方案。

Another thought comes to mind, though, if you have the database running on a domino server. It could be fairly simple to POST the update to the database using HTTP. You'd still have to write some code within Notes (an agent to receive the POST), but it might be simpler to make an HTTP call after the Qpulse application is updated.

但是,如果您在多米诺骨牌服务器上运行数据库,则会想到另一个想法。使用HTTP将更新发布到数据库可能相当简单。您仍然需要在Notes(接收POST的代理)中编写一些代码,但在更新Qpulse应用程序后进行HTTP调用可能更简单。

You would send over some unique identifier (that Number field I suppose?) and the description in the POST, the agent would receive it via the DocumentContext object, and could find and update the document. This process would be initiated by some trigger on the Qpulse side.

你会发送一些唯一的标识符(我猜想那个数字字段?)和POST中的描述,代理会通过DocumentContext对象接收它,并且可以找到并更新文档。这个过程将由Qpulse侧的一些触发器启动。

This isn't simple, but it does avoid writing lots of code outside of Notes, and avoids trying to connect to Notes as a datasource externally.

这并不简单,但它确实避免在Notes之外编写大量代码,并避免尝试从外部连接到Notes作为数据源。

#2


1  

Trying to integrate with relational database systems is a relatively common problem. But a meaningful and straight forward example seems elusive. I would recommend trying JDBC. There are a few tutorials out there. Perhaps this or this will help get you started.

尝试与关系数据库系统集成是一个相对常见的问题。但是一个有意义且直截了当的例子似乎难以捉摸。我建议尝试JDBC。那里有一些教程。也许这或那将有助于你开始。

You could try the Lotus Connectors LotusScript Extension Classes. There is API help documentation in you Domino Designer client. I have also found this IBM Lotus Connectivity Redbook useful, despite it being 10 years old.

您可以尝试Lotus Connectors LotusScript扩展类。 Domino Designer客户端中有API帮助文档。我还发现这个IBM Lotus Connectivity Redbook很有用,尽管它已有10年历史了。

#1


1  

Using an agent like you have already is IMHO the simplest solution.

使用像你这样的代理商是恕我直言最简单的解决方案。

Another thought comes to mind, though, if you have the database running on a domino server. It could be fairly simple to POST the update to the database using HTTP. You'd still have to write some code within Notes (an agent to receive the POST), but it might be simpler to make an HTTP call after the Qpulse application is updated.

但是,如果您在多米诺骨牌服务器上运行数据库,则会想到另一个想法。使用HTTP将更新发布到数据库可能相当简单。您仍然需要在Notes(接收POST的代理)中编写一些代码,但在更新Qpulse应用程序后进行HTTP调用可能更简单。

You would send over some unique identifier (that Number field I suppose?) and the description in the POST, the agent would receive it via the DocumentContext object, and could find and update the document. This process would be initiated by some trigger on the Qpulse side.

你会发送一些唯一的标识符(我猜想那个数字字段?)和POST中的描述,代理会通过DocumentContext对象接收它,并且可以找到并更新文档。这个过程将由Qpulse侧的一些触发器启动。

This isn't simple, but it does avoid writing lots of code outside of Notes, and avoids trying to connect to Notes as a datasource externally.

这并不简单,但它确实避免在Notes之外编写大量代码,并避免尝试从外部连接到Notes作为数据源。

#2


1  

Trying to integrate with relational database systems is a relatively common problem. But a meaningful and straight forward example seems elusive. I would recommend trying JDBC. There are a few tutorials out there. Perhaps this or this will help get you started.

尝试与关系数据库系统集成是一个相对常见的问题。但是一个有意义且直截了当的例子似乎难以捉摸。我建议尝试JDBC。那里有一些教程。也许这或那将有助于你开始。

You could try the Lotus Connectors LotusScript Extension Classes. There is API help documentation in you Domino Designer client. I have also found this IBM Lotus Connectivity Redbook useful, despite it being 10 years old.

您可以尝试Lotus Connectors LotusScript扩展类。 Domino Designer客户端中有API帮助文档。我还发现这个IBM Lotus Connectivity Redbook很有用,尽管它已有10年历史了。