将 ABL 过程进展为 SQL 插入
我们有一个软件解决方案,涉及在 Progress 数据库和 SQL 服务器之间同步一些数据。不幸的是,我们内部没有任何进步专家,所以我在这里工作有点盲目,欢迎提供任何建议。
对于已经到位的工作流程,对我们来说非常有效的是能够执行外部调用,从 ABL 过程的“foreach”循环中将一行插入到 SQL 数据库中。
有谁能够指导我找到任何可以帮助我实现这一目标的代码片段或文章吗?
非常感谢,
We have a software solution that involves syncing some data between a Progress database and SQL server. Unfortunately, we do not have any Progress gurus in house, so I'm working kinda blind here and would welcome any advice that is on offer.
For the workflow that is already in place, what would work very well for us is the ability to do an external call to insert a row into an SQL database from an within ABL procedure's 'for each' loop.
Is anyone able to direct me to any code snippets or articles that might help me achieve this?
Many thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您的 SQL 数据库是 MS SQL Server,您可能需要查看 OpenEdge DataServer for Microsoft SQL Server (web.progress.com/en/openedge/dataserver-microsoft.html,documentation.progress.com/output/OpenEdge102b/pdfs/dmsql/dmsql.pdf)。
DataServer 为您提供对非Progress 数据库的ABL 访问,因此您可以使用标准Progress 语句,例如CREATE 来添加新记录或FOR EACH 来检索查询结果。
OpenEdge DataServers 还适用于 Oracle(使用 Oracle 调用接口)、DB2 和 Sybase(使用 ODBC)。 MS SQL Server 的 DataServer 在后台也使用 ODBC。 web.progress.com/docs/datasheets/openedge/openedge_dataservers.pdf
In case your SQL database is MS SQL Server, you might want to have a look at OpenEdge DataServer for Microsoft SQL Server (web.progress.com/en/openedge/dataserver-microsoft.html, documentation.progress.com/output/OpenEdge102b/pdfs/dmsql/dmsql.pdf).
The DataServer provides you with ABL access to a non-Progress database so you can use standard Progress statements, e.g. CREATE to add new records or FOR EACH to retrieve query results.
OpenEdge DataServers are also available for Oracle (using Oracle Call Interface), DB2 and Sybase (using ODBC). The DataServer for MS SQL Server uses ODBC behind the scenes as well. web.progress.com/docs/datasheets/openedge/openedge_dataservers.pdf
您不需要数据服务器,与 ADODB 的连接在 ABL 中工作正常,您甚至可以使用命令对象调用存储过程,您连接的用户必须被授予 SQL Server 上的 EXEC 权限才能执行此操作。
You dont need the dataserver, connection with ADODB works fine in ABL, you can even call stored-procedures with the command object, the user you connect with will have to be granted EXEC rigths on the SQL-Server to do that.
我不是进步大师,但我确实在这方面做了一些工作一段时间。 AFAIK 没有办法让 ABL 代码连接到非 Progress 数据库(Progress Corp. 利用的整个供应商锁定策略的一部分)。
您最好的选择可能是让 ABL 代码将记录序列化为 XML,并使用类似 ActiveMQ (甚至是普通套接字或命名管道/FIFO,具体取决于您的设置)将它们发送到用更强大的语言编写的程序来执行 SQL 插入。
I'm not a Progress guru, but I did do some work in it for awhile. AFAIK there is no way to have ABL code connect to a non-Progress database (part of that whole vendor lock-in strategy Progress Corp. leverages).
Your best bet is probably to have the ABL code serialize the records to XML, and use something like ActiveMQ (or even a plain socket or named pipe/FIFO depending on your setup) to send them to a program written in a more capable language to do the SQL insert.