I'm working on a delphi appllication,I'm using this
with TOracleQuery.Create(nil) do begin Session := OracleSession1; Close ; SQL.Clear ; Iresults := SQL.Add('select (max(user_id)+1) as max_user_id '); SQL.Add('from scs_users');
if tblUser.RecordCount <= 0 then begin if edtSCSUser.Text <> '' then begin TblUser.Insert; TblUser.FieldByName('USER_NAME').AsString := UpperCase((edtSCSUser.Text)); TblUser.FieldByName('USER_LEVEL').AsString := Trim(cmbSCSAccess.Value); TblUser.FieldByName('password').AsString := DoEncrypt('AMCOAL1','PWD'); TblUser.FieldByName('password_date').AsDateTime := Now; TblUser.FieldByName('USER_ID').AsInteger := Iresults; TblUser.FieldByName('SCS_ACCESS').AsString := Trim(cmbSCS.Text); TblUser.FieldByName('DH_ACCESS').AsString := Trim(cmbDH.Text); TblUser.Post; messagedlg('SCS User '+ trim(edtSCSUser.Text)+ 'created successfully', mtInformation, [mbok], 0) ; end
but the query results are not being updated correctly in the users table, when I run the query in the sqlplus I return correct results but when I try to do the same on the delphi program its not returning the correct result.The system increment the user_id value each time a new user is being created so now I'm trying to carry out the same functionality using the delphi application please assist
-reply by Nomsa




