1. James Medick
  2. PowerBuilder
  3. Saturday, 1 January 2022 21:23 PM UTC

PB Version 2019 R# Build 2703

MySQL 5.7.24

 

When changing one column in a compound key of the parent table, PB deletes all the children in the child table.  This happens regardless of using Insert / Delete or Update on the Update Rows option.  At the database level, the key change works perfectly using referential integrity - Cascade rules.  Changing the key of the parent changes all of the keys for the children.

Is this a PB restriction?

 

Accepted Answer
James Medick Accepted Answer Pending Moderation
  1. Sunday, 2 January 2022 16:32 PM UTC
  2. PowerBuilder
  3. # Permalink

It appears that it is a situation that occurs when the key column is defined as "Year".  Although the DB would Cascade the change appropriately, PB would block the change, deleting the child table rows instead of Delete and Insert, or simply change.  All rows in the child were deleted.  Changing the column type to SmallInt(4) fixed the problem.

Thanks for the help.

Jim

Comment
  1. Chris Pollach @Appeon
  2. Sunday, 2 January 2022 16:53 PM UTC
Thanks for the update Jim!

Sounds like a MySQL quirk.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Sunday, 2 January 2022 06:02 AM UTC
  2. PowerBuilder
  3. # 1

James -

It might be a "feature" of your application's framework, if one is being used. For example, is your app built upon the PFC (PowerBuilder Foundation Class) libraries?

Using MySQL as the database, may I assume your app connects via ODBC? If your temporarily enables database activity tracing in the Transaction object, the resultant trace file (it is a clear-text file) may give you (and us) some additional information.

To enable this trace, change the assignment of the DBMS property of the Transaction object:

Before: SQLCA.DBMS = "ODB"
After: SQLCA.DBMS = "TRACE ODB"

Please let us know what you find

Regards, John

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Saturday, 1 January 2022 21:39 PM UTC
  2. PowerBuilder
  3. # 2

Hi James;

  PB never performs a Cascade delete. This would be a feature (or maybe a bug in this case) of your DBMS.

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.