1. John Brown
  2. PowerBuilder
  3. Friday, 3 November 2023 15:26 PM UTC

 

PB version 2017 r3 build 1880

 

I'm doing maintenance on a window and hitting an item that has me a puzzled.

I haven't worked with a stored procedure based datawindow in almost 10 years, so apology if this is a stupid question.

 

I have a main datawindow with multiple dddw columns.

 

User selects dddw 1, based on a view.

In the itemchanged event, that value, plus other values are used to retrieve dddw 2, based on a stored procedure.

 

If the user selects a value in dddw 1 only once, dddw 2 retrieves correctly.

But for example, if the user realizes they chose the wrong item in dddw 1, and selects a new value, then the retrieve for dddw2 fails.

 

I've tried resetting dddw 2 ( the one based on the stored procedure, etc. ), but nothing is working. Running it through the debugger, the correct values are being passed for the 2nd retrieve, but I still get -1 as a result.

 

Thanks for any help,

John

Arnd Schmidt Accepted Answer Pending Moderation
  1. Friday, 3 November 2023 15:59 PM UTC
  2. PowerBuilder
  3. # 1

Helping to fix unknown code is hard :-(

But I bet you should start to do a fresh getchild() to get a valid reference to the dddw before calling a new retrieve().

hth

Arnd

 

 

 

Comment
  1. John Brown
  2. Tuesday, 7 November 2023 12:16 PM UTC
I added this in before the retrieve and it still behaves the same. Thanks for the suggestion!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 3 November 2023 15:55 PM UTC
  2. PowerBuilder
  3. # 2

Hi John;

   Can you tell us ...

  1. What do you mean exactly by "fails"?
  2. Have you traced (stepped though) the code in the IDE's debugger?
  3. Have you run an SQL trace (ie: SQLCA.DBMS "xxx"  => SQLCA.DBMS "TRACE xxx")?

Regards ... Chris

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 7 November 2023 13:06 PM UTC
Are you calling the SP via: in-line SQL; DataWindow or RPC?
  1. Helpful
  1. John Brown
  2. Tuesday, 7 November 2023 14:13 PM UTC
I figured it out. I'm an idiot ... The two columns are very similarly named. I was resetting the wrong one. Embarrassing.



But all the suggestions here helped me look a little closer at the two columns and that's when I figured out it was the wrong one. ( this code is super old and they had no coding / naming standards for anything tables, windows, variables, etc. So it's easy to get lost in their spaghetti. )



THANKS FOR THE HELP, CHRIS!
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 7 November 2023 18:44 PM UTC
Hi John ... glad that you finally found out what the issue was!

How many cups of coffee did that take? ;-)
  1. Helpful
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.