我可以在 Powerbuilder 中调用 sp_send_dbmail 吗?
DECLARE sp_send_dbmail PROCEDURE FOR sp_send_dbmail
@profile_name = :ls_Null,
@recipients = :ls_To,
@copy_recipients = :ls_Null,
@blind_copy_recipients = :ls_Null,
@subject = :ls_Null,
@body = :ls_Body,
@importance = :ls_Importance,
@rtn = :li_Rtn OUTPUT;
EXECUTE sp_send_dbmail;
DECLARE sp_send_dbmail PROCEDURE FOR sp_send_dbmail
@profile_name = :ls_Null,
@recipients = :ls_To,
@copy_recipients = :ls_Null,
@blind_copy_recipients = :ls_Null,
@subject = :ls_Null,
@body = :ls_Body,
@importance = :ls_Importance,
@rtn = :li_Rtn OUTPUT;
EXECUTE sp_send_dbmail;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道为什么不,调用存储过程传统上不是 PowerBuilder 的问题。
从我所看到的来看,该代码似乎很好。
执行后检查 SQLCA.SQLCode 和 SQLCA.SQLErrText 以确定是否存在错误。你可以使用类似的东西:
I'm not sure why not, calling stored procs isn't traditionally a problem with PowerBuilder.
That code seems fine from what I can see of it.
After the execute check for SQLCA.SQLCode and SQLCA.SQLErrText to determine if there is an error. You can use something like:
在您的交易对象上声明本地外部函数。打开您的自定义事务对象,然后转到“本地外部函数”选项卡。
定义您的过程或 package.procedure 调用,如以下示例所示:
使用子例程或函数名称后定义的名称调用代码中的过程:
这假设您在应用程序对象中定义并设置为 SQLCA 的非可视事务对象。如果没有自定义事务对象,您就无法定义这样的外部函数。完成的方法是创建一个标准的非可视类型事务,然后在自定义变量中的应用程序对象中将 SQLCA 替换为 n_tr_transaction。
Declare Local External Functions on your transaction object. Open your custom transaction object, then go to Local External Functions tab.
Define your procedure or package.procedure calls like some of these examples:
To call the procedures in code using the name defined after subroutine OR function name:
This assumes you have a non-visual transaction object defined and set as the SQLCA in your application object. Without a custom transaction object you cannot define external functions like this. The way you accomplish, is create a standard non-visual of type transaction, then in your application object in custom variables replace SQLCA with your n_tr_transaction.