Sybase PowerBuilder 管道问题

发布于 2024-12-03 03:24:17 字数 412 浏览 3 评论 0原文

我对 PowerBuilder 很陌生。我有一个关于使用管道从一个表到另一个表的数据传输的问题。 源表有一个附加字段,可以说“传输”。最初该列的值为 0。数据从源表传输到目标表后,我需要将源表的“传输”列更新为 1。我无法弄清楚,是否需要创建一个新管道来再次更新源表?或者有什么办法? 我正在使用以下管道。我将不胜感激任何帮助。

lp_Create.DataObject  =  "p_create_tableA"
li_rc  =   lp_Create.Start(lt_Source,  sqlca,  dw_errors)
If  li_rc  <>  1  Then
    MessageBox("Some error","Error  return  code:  "  +  string(li_rc))
End  if   

I am very new to PowerBuilder. I have a question regarding the data transfer from one table to another using Pipeline.
The source table has one addition field, lets say 'transfer'. Initially this column has value 0. After the data has been transferred from source table to destination table, I need to update the source table's column 'transfer' to 1. I am unable to figure out, do i need to create a new pipeline to update the source table again? or what is the way?
I am using following for pipeline. I will appreciate any help.

lp_Create.DataObject  =  "p_create_tableA"
li_rc  =   lp_Create.Start(lt_Source,  sqlca,  dw_errors)
If  li_rc  <>  1  Then
    MessageBox("Some error","Error  return  code:  "  +  string(li_rc))
End  if   

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月棠 2024-12-10 03:24:17

一般来说,管道并不是为“源”表创建不从某处复制的值。通常,您需要一个 DataStore。但是,如果您拥有对该表的独占访问权限(没有其他用户,没有其他进程或触发器),这将是 PowerBuilder 中为数不多的情况之一,我建议使用嵌入式 SQL 语句,例如:

UPDATE <table> SET transfer = 1

如果您 < em>没有对源表的独占访问权限(并且其他人/其他东西可以在管道之后但更新传输标志之前向其中写入新记录),那么这就是另一个问题,这可能是如果你是新手,那么不值得进入PowerBuilder,这不是你的情况。

祝你好运,

特里。

Generally speaking, the pipeline isn't about creating values for your "source" table that aren't being copied from somewhere. Usually, you'd want a DataStore for that. However, if you've got exclusive access to the table (no other users, no other processes or triggers), this would be one of the few cases in PowerBuilder where I'd recommend an embedded SQL statement with something like:

UPDATE <table> SET transfer = 1

If you don't have exclusive access to the source table (and someone/something else can be writing new records to it after your pipeline but before you update the transfer flag), then it's a whole other problem, which probably isn't worth going into if you're new to PowerBuilder and this isn't your situation.

Good luck,

Terry.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文