Sybase PowerBuilder 管道问题
我对 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般来说,管道并不是为“源”表创建不从某处复制的值。通常,您需要一个 DataStore。但是,如果您拥有对该表的独占访问权限(没有其他用户,没有其他进程或触发器),这将是 PowerBuilder 中为数不多的情况之一,我建议使用嵌入式 SQL 语句,例如:
如果您 < 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:
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.