ADS SQL problem

This forum is for eXpress++ general support.
Post Reply
Message
Author
jezda
Posts: 14
Joined: Thu Mar 28, 2019 4:41 am

ADS SQL problem

#1 Post by jezda »

I have tested Donay's Datadict.prg using ADS SQL with eXpress++ and everything is ok...
I was modify BROWSE object for Editing ceels:

@ 1,0 DCBROWSE oBrowse ALIAS cAlias SIZE 100, 20 ;
EDIT xbeBRW_ItemSelected; ;//added;
PRESENTATION DC_BrowPres() ;
FONT '9.Lucida Console'

I found a problem

For SQL commands: SELECT * FROM CUSTOMER .... ORDER BY.... WHERE... etc. everything is ok... I can Edit ceels

For SQL commands which contains: LIKE .... filtering is ok, but I can't Edit ceels... I'm getting a message:
Record has been locked by another user. Retry?

What is problem?
Attachments
Screenshot_1.png
Screenshot_1.png (81.78 KiB) Viewed 9056 times
Screenshot_2.png
Screenshot_2.png (112.84 KiB) Viewed 9056 times
Screenshot_3.png
Screenshot_3.png (213.25 KiB) Viewed 9056 times

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: ADS SQL problem

#2 Post by rdonnay »

This is because the LIKE clause may return a STATIC cursor, which is not writable.

Which version of eXpress++ are you using?
The most current version has a utility called SqlQuery.
It is much advanced over that little utility you are using and can give some more info.
The eXpress train is coming - and it has more cars.

jezda
Posts: 14
Joined: Thu Mar 28, 2019 4:41 am

Re: ADS SQL problem

#3 Post by jezda »

Hi Roger,

I looked your utility SqlQuery... It is very nice but as you say: "I'm too old to learn how to fly a plane".
I want something simpler... I want to add only a few line of SQL code for resolving proglems of SET FILTER TO.... (in large database) or SEARCH large database....
Dbseek() working very fast but you must have an index.... SQL comands for example: SELECT * FROM xxxx WHERE yyy LIKE '%abc%' is simply beter...
I don't want much to change my code...

I am using Express++ ver. 266

Best regards,

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: ADS SQL problem

#4 Post by rdonnay »

I will look into this and see if I can find a solution for you.
The eXpress train is coming - and it has more cars.

jezda
Posts: 14
Joined: Thu Mar 28, 2019 4:41 am

Re: ADS SQL problem

#5 Post by jezda »

Thanks advance

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: ADS SQL problem

#6 Post by rdonnay »

When I looked in my code to see how I did updates in SQLQuery, I remembered that I had to use a SQL UPDATE whenever I had a static cursor, therefore it WAS possible to do a record update.

In order to do this, however, I always edited a RECORD OBJECT, rather than trying to edit the record directly.

When you edit a record object, you are only editing what is in memory, and then writing out the object to the database using DC_DbGather().

If you are trying to do cell-editing, then that will not be possible.
The eXpress train is coming - and it has more cars.

jezda
Posts: 14
Joined: Thu Mar 28, 2019 4:41 am

Re: ADS SQL problem

#7 Post by jezda »

Ok Roger,thank you very much for your explain...

Lots of greetings and health :D

Post Reply