Hello
not work because dolphin delete extra space using Function AllTrim
the field LAST_NAME all content start with one SPACE,
example: " polkan"
when TDolphin use the Method Save, does convert the data to UPDATE statement ( but delete the first space ), now the field FIRST_NAME is "" TDolphin convert it to NULL (maybe a little bug)
for this case the best way is use the statement UPDATE directly...
now if you create a primary key, TDolphin locate the value for primary key and will make the SAVE successful
look the next sample with a copy of lanu2 ( lanu2_copy)
#include "tdolphin.ch"
PROCEDURE Main()
LOCAL oServer := NIL
LOCAL cText := ""
local chost:="dolphintest2.sitasoft.net"
local cuser:="test2_dolphin"
local cpsw:="123456"
local cflags:=0
local cport:=3306
local cdbname:="tdolphin_test"
local oQry
CONNECT oServer HOST chost ;
USER cUser ;
PASSWORD cpsw ;
PORT cPort ;
DATABASE cDBName
oServer:bDebug = {| c | logfile( "debug.txt", { c } ) }
oQry = oServer:Query( "SELECT id, account, last_name, first_name,balance FROM lanu2_copy" )
do while !oQry:Eof()
if oQry:account="dog"
oQry:FieldPut("account" , "sobaka" )
oQry:FieldPut("balance" , 3.14 )
oQry:Save()
endif
oQry:Skip()
enddo
oServer:End()
RETURN