Board index » delphi » using oracle 817 and want to commit the changes but I couldn't succeed

using oracle 817 and want to commit the changes but I couldn't succeed

Quote
> I want to commit the changes I made but I couldn't succeed Coud you help me?

Hm - I'm not sure what you _realy_ want to do:

In Button1.click you are starting a transaction (which you should create
  before!!!) and commiting it at once. This does realy nothing!
Transactions are used to make a couple of changes to a DB and ensure
that ALL OR NONE of them are made persistent on the DB.
(Search Delphi help for "Transactions"->"Managing transactions")

In Button2.click you have  SQLClientDataSet1.ApplyUpdates(-1); this is
all you need to "apply" the changes in your ClientDataSet to the
underlying DB (Transactions are not needed to create by your self [in
most cases]).
If don't see your modified data in your DB then the changes could not be
applied. You can check this by adding a OnReconcileError procedure:

procedure TForm1.SQLClientDataSet1ReconcileError(
   DataSet: TCustomClientDataSet; E: EReconcileError;
   UpdateKind: TUpdateKind; var Action: TReconcileAction);
begin
e.Message
end;

Hope this helps,

Olaf

 

Re:using oracle 817 and want to commit the changes but I couldn't succeed


Quote
> now i just use the code:
> SQLClientDataSet1.ApplyUpdates(-1);
> when I click to a button,
> but it always returns the error ORA-01722

Hi Burc,
this is a decimal separator problem.  On Windows you have to set:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE]
"NLS_NUMERIC_CHARACTERS"=".,"

(Assuming that "," is your decimal separator, the "."  has to be at the
first position)

On Linux do:
export NLS_NUMERIC_CHARACTERS=.,

Hope this helps
Olaf

Re:using oracle 817 and want to commit the changes but I couldn't succeed


Thanks Olaf but I still have the same problem
in HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE there wasnt NLS_NUMERIC_CHARACTERS so
I added it then i restarted my computer and recompile it and rerun the
application but i still have the same error ORA-01722 invalid number, it
also happens when i try to update a record's field which has a string type
of value, defined as varchar(80).
Do you still have a solution?
Thanks in advance
Burc
Quote
> Hi Burc,
> this is a decimal separator problem.  On Windows you have to set:

> Windows Registry Editor Version 5.00
> [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE]
> "NLS_NUMERIC_CHARACTERS"=".,"

> (Assuming that "," is your decimal separator, the "."  has to be at the
> first position)

> On Linux do:
> export NLS_NUMERIC_CHARACTERS=.,

> Hope this helps
> Olaf

Re:using oracle 817 and want to commit the changes but I couldn't succeed


Hi Burc,

Please check if you have HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0 (1,2,3...)
like entries, if so then try adding NLS_NUMERIC_CHARACTERS there. (Rebooting
wasn't nessecary in our cases).

Another possibility is to set this at runtime as first action:
alter session set NLS_NUMERIC_CHARACTER ='.,'
This way you don't have to change your 1001 clients ;-)

You get the Invalid Number Error even when you only chnged a string field.
This is because apply sends the complete record (which includes a number)
back to the DB. This is controled by UpdateMode=upWhereAll.

Olaf

Re:using oracle 817 and want to commit the changes but I couldn't succeed


Thank you for your help Olaf the problem is solved.
Bur?.

Other Threads