Home > database >  PB how to remote database in certain fields stored into a local dw
PB how to remote database in certain fields stored into a local dw

Time:09-25

I set up a DW in PB, the need to connect to a remote database tables, when I was in DW entered a field value equals the distance a field in a database table, the relevant field values from the remote database tables, assign values to the DW, and saved, how can I write code, thank you

CodePudding user response:

Write code in dw itemchanged events:
 if dwo. Name='used to input column then 
//assume that the listed as the char type
String ls, ls_other1 ls_other2, ls_other3
//the contents of this entry
Ls=data
//access remote database related field values in the table
Select a, b, c into: ls_other1, ls_other2, : ls_other3 from t where d=: ls using the sqlca.
If the sqlca. Sqlcode=1 then
Messagebox (', 'unable to retrieve the related data)
Return
End the if
//assign values to the related field in the dw
Setitem (row, 'other1 ls_other1)
Setitem (row, 'other2 ls_other2)
Setitem (row, 'other2 ls_other2)
//to save the content of the dw
Accepttext ()
If the update ()=1 then
Commit the using the sqlca;
The else
The rollback using sqlca;
End the if

End the if

CodePudding user response:

Help bumps!!!!!!!!!!

CodePudding user response:

http://topic.csdn.net/u/20111013/10/b08e4573-a054-4a09-8ee5-1bb9059e7203.html? 65574
  • Related