NetTalk Central

Author Topic: SQL browse problem  (Read 7165 times)

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
SQL browse problem
« on: September 07, 2021, 01:39:02 PM »
Hi, Bruce,

I'm going to see if you can help me with this in this week's NT webinar.

I've been converting an app from 11.x to 12.25.  I've resolved most of the issues but still have one that's flummoxing me.

Some of the sort headers I've customized, others are just the field value.  They all work fine in the 11.x app. 

But with the 12.25 version, I click on a header and it sorts correctly.  But then clicking the Next button gives a "no records" message and an empty browse.

Attached is a wizarded app that illustrates the problem.  There's also a script to create a test MSSQL database and table with data for the test app.

Looking forward to Thursday  :D

Cheers,

Jane

GordonF

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: SQL browse problem
« Reply #1 on: September 07, 2021, 10:29:30 PM »
Hi Jane,

I'm not sure if this helps but I had this problem with a SQL browse that I used as a lookup, in my case the problem was that I'd specified an order in the calling field and also correctly in the actual lookup. It was an error on my part but it caused the next button to show no record, removing the order from the lookup calling field resolved the issue.

I hope this helps.

Gordon

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: SQL browse problem
« Reply #2 on: September 08, 2021, 05:01:42 AM »
Hi Jane, it worked perfect for me in NT 12.23 and NT 12.25

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: SQL browse problem
« Reply #3 on: September 08, 2021, 07:14:00 AM »
Hi Jane, it worked perfect for me in NT 12.23 and NT 12.25
Well... why does it love you and hate me ??

 ???

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: SQL browse problem
« Reply #4 on: September 09, 2021, 06:38:19 AM »
Jane for me work sorting all columns asc and desc, next and previous, what version of clarion you use? i use 11.13630

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: SQL browse problem
« Reply #5 on: September 09, 2021, 06:48:40 AM »
I'm using 11.0.13401

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: SQL browse problem
« Reply #6 on: September 09, 2021, 10:09:22 AM »
Resolved.  :)

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: SQL browse problem
« Reply #7 on: September 09, 2021, 04:25:58 PM »
what was the problem?

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: SQL browse problem
« Reply #8 on: September 09, 2021, 05:02:05 PM »
Bruce was kind enough to take a look at today's NetTalk webinar.

He found that a call to p_web.RestoreValue is needed to reset loc:vordernumber to the correct value at the beginning of the SetVorder routine in the browse procedures.

Otherwise the browses use the correct sort order when you click the header but then revert to the default loc:vordernumber for subsequent pages and choke and die.

This is a side effect of some of the new stuff he's been building involving the change to using &View for ThisView.

So one line of code in each browse and now they work fine.   :)




GordonF

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: SQL browse problem
« Reply #9 on: September 13, 2021, 05:32:24 AM »
Hi Bruce,

Is this likely to have been the cause of the problem I mentioned in the first reply to this post, it sounds similar?

Gordon

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: SQL browse problem
« Reply #10 on: September 13, 2021, 10:09:12 PM »
possibly.

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: SQL browse problem
« Reply #11 on: September 14, 2021, 06:47:31 AM »
Hi Bruce,

Is this likely to have been the cause of the problem I mentioned in the first reply to this post, it sounds similar?

Gordon

Gordon,

If you want to try the fix Bruce gave me... in browses having the problem search for a line like

Code: [Select]
loc:vordernumber    = p_web.RestoreValue('BrowseHoldingTank_sort_' & loc:RandomBrowseId,net:DontEvaluate)
In 12.25 it is in the GenerateBrowse routine.
(The BROWSENAME_sort_ part of the line will be specific to your browse.  )

Then copy that line exactly and paste it into the first embed in the SetVorder routine.





GordonF

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: SQL browse problem
« Reply #12 on: September 15, 2021, 11:51:58 PM »
Thanks Jane I'll try that and report back.

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: SQL browse problem
« Reply #13 on: September 22, 2021, 09:36:09 AM »
Fixed in 12.26.