[Gambas-user] Conditional edit of a database table

Shane buster6seven at ...626...
Sat Jun 18 02:54:31 CEST 2016


Are you looking for something like
hConn.Find("clients", "firstname LIKE &1 OR lastname LIKE &1 OR phone 
like &1 OR street_name LIKE &1 OR suburb LIKE &1", "%" & s & "%")
except with AND'S


On 17/06/16 06:45, willy at ...3474... wrote:
> On 2016-06-16 22:05, Benoît Minisini wrote:
>> Le 16/06/2016 21:10, willy at ...3474... a écrit :
>>> On 2016-06-13 16:45, willy at ...3474... wrote:
>>>> Hi all,
>>>>
>>>> I have been editing tables successfully using something like:
>>>>
>>>> rResult = hConn.Edit("error", "id=&1", iId)
>>>>
>>>> This comes in handy when wanting to edit a record with a certain id
>>>> and
>>>> works just fine for simple cases.
>>>> But I have a table where the fields id and company (in table error)
>>>> together form the primary key.
>>>>
>>>> My question: Is it possible to edit a record based on these two
>>>> requirements using db.edit function?
>>>>
>>>> Something like below doesn't seem to work:
>>>>
>>>> rResult = hConn.Edit("error", "id=&1 AND company=&2", iId, sCompany)
>>>>
>>>> and documentation (http://gambaswiki.org/wiki/comp/gb.db/db/edit)
>>>> isn't
>>>> really helpful.
>>>>
>>>> Thanks,
>>>>
>>>> gbWilly
>>> Anyone a sensible answer?
>>>
>>> gbWilly
>>>
>> It should work. Please post a project with the code that does not work
>> as expected.
>>
>> Regards,
> Well, as usual it is part of a bigger application.
> So, I'll try to make a small example and post it when ready.
>
> Thanks for the response,
>
> gbWilly
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports. http://sdm.link/zohomanageengine
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list