Page 1 of 1

ADS SQL problem

Posted: Mon Jun 08, 2020 3:55 am
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?

Re: ADS SQL problem

Posted: Wed Jun 10, 2020 12:46 pm
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.

Re: ADS SQL problem

Posted: Fri Jun 12, 2020 12:56 pm
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,

Re: ADS SQL problem

Posted: Mon Jun 15, 2020 6:39 am
by rdonnay
I will look into this and see if I can find a solution for you.

Re: ADS SQL problem

Posted: Mon Jun 15, 2020 9:33 am
by jezda
Thanks advance

Re: ADS SQL problem

Posted: Mon Jun 15, 2020 12:46 pm
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.

Re: ADS SQL problem

Posted: Mon Jun 15, 2020 1:37 pm
by jezda
Ok Roger,thank you very much for your explain...

Lots of greetings and health :D