|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to insert date from function date() in firebird date field
hello
how can i insert da Data() in date field ? i got ecxeption - cannot translete charachters between charachters sets?! |
|
#2
|
|||
|
|||
|
Post the DDL of your table
Post the exact statement you executed Post the exact error message you got |
|
#3
|
|||
|
|||
|
CREATE TABLE EVENT_LOG (
ID INTEGER NOT NULL, EVENT_TEXT VARCHAR(500), DATA DATE, "TIME" TIME ); DM->Cfg_Event_log_SP->ExecProc(); DM->Cfg_Event_log_Qry->Close(); DM->Cfg_Event_log_Qry->SQL->Clear(); AnsiString sql = "INSERT INTO EVENT_LOG VALUES ('"+DM->Cfg_Event_log_SP->ParamByName("ID")->AsString+"', 'bla','"+Date()+"','"+Time()+"')" ; DM->Cfg_Event_log_Qry->SQL->Add(sql); DM->Cfg_Event_log_Qry->Prepare(); DM->Cfg_Event_log_Qry->ExecSQL(); DM->IBTransaction1->CommitRetaining(); erro: arithmetic exception,numeric overflow, or string truncation Cannot translate character between charachter set. |
|
#4
|
|||
|
|||
|
I can't see the SQL Statement you execute, you only posted the C++ code that generates the statement.
First step in debugging problems like that: Print the statement that get's executed and make sure that is working correct. So please supply the real statement that get's executed (e.g. doing a printf() or something similar). I bet that you then will see the error for yourself. I have no idea what Date() is doing, but apparently it returns something that is not compatible with the SQL statement you execute. |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > How to insert date from function date() in firebird date field |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|