1. Michał Misijuk
  2. PowerBuilder
  3. Wednesday, 23 October 2019 08:26 AM UTC

Hello,

I've created a datawindow (dw_data) with select consisting on 2 tables like:


Select 
          tab1.symbol,
          tab1.desc,
          tab2.id,
          tab2.fk1,
          tab2.fk2,
          tab2.status,
          etc...
From tab1,

         tab2
where tab1.id=tab2.id


On datawindow visible are only kolumns from tab1, and rest is used on update properties:

Unique Key Column(s): tab2.id
Updatable Columns: tab2.fk1, tab2.fk2, etc...

There is a button "Add" which add row into dw and sets columns:
tab1.symbol,
tab1.desc,
tab2.id,
tab2.fk1,

and then im trying to save it to database,everything looks fine but datastore::setchanges throws me -3 which is column mismatch.
I've done many dw, i've got many errors but this got me really stuck.

Does anyone have an idea?
Thanks!

 

Accepted Answer
Michael Kramer Accepted Answer Pending Moderation
  1. Wednesday, 23 October 2019 09:03 AM UTC
  2. PowerBuilder
  3. # Permalink

To understand your setup:

  • You have DW control (dw_data) containing a DW object (EX: d_my2tables)
  • You have DataStore object (EX: ids_backend) also containing same DW object
  • You obtain changes using dw_data.GetChanges( )
  • You try to insert changes using ids_backend.SetChanges( )
  • AND that SetChanges fails even though dw_data and ids_backend contain same DW object

Is that your setup?

/Michael

Comment
  1. Michał Misijuk
  2. Wednesday, 23 October 2019 09:21 AM UTC
"dw_data and ids_backend contain same DW object" Here was mismatch. Not to writing too much - my big mistake :)

Thank You Very much!!!!
  1. Helpful
  1. Michael Kramer
  2. Wednesday, 23 October 2019 10:15 AM UTC
Happy to solve the issue quickly - MicK was QuicK
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.