LOCAL lnHandle
lnHandle=SQLCONNECT([jcsserver],[soft],[123])
lcSql=[select * from vtasks]
lnSucces = SQLEXEC(lnHandle,lcSql,[cursorprg])
IF lnSucces < 0
	MESSAGEBOX("Eroare la select")
ELSE
	SELECT cursorprg
	BROWSE
ENDIF

*!*	lcDescriere=[descriere]
*!*	lcData = TTOC(DATEtime(),1)
*!*	lnEstimareInitiala = 5
*!*	lcSql=[insert into tasks(descriere,dataora_inceput,estimare_initiala) values(']+lcDescriere+[',to_date(']+lcData+[','YYYYMMDDHH24miss'),] + ALLTRIM(STR(lnEstimareInitiala)) + [)]
*!*	lnSucces = SQLEXEC(lnHandle,lcSql)
*!*	IF lnSucces < 0
*!*		MESSAGEBOX("Eroare la insert")
*!*	ELSE
*!*		MESSAGEBOX("A fost adaugata inregistrarea!")
*!*	ENDIF

lcDescriere2=[descriere modificata]
lnIdTask = 1
lnEstimareCurenta = 5.15
lcSql = [update tasks set descriere = '] + lcDescriere2 + [',estimare_curenta =] + ALLTRIM(STR(lnEstimareCurenta,14,2)) + [ where id_task = ] + ALLTRIM(STR(lnIdTask))
lnSucces = SQLEXEC(lnHandle,lcSql)
IF lnSucces < 0
	MESSAGEBOX("Eroare la update")
ELSE
	MESSAGEBOX("A fost modificata inregistrarea!")
ENDIF
SQLDISCONNECT(lnHandle)