Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 21st, 2009, 05:22 PM
JoseMourinho JoseMourinho is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 57 JoseMourinho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 6 h 8 m 55 sec
Reputation Power: 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?!

Reply With Quote
  #2  
Old May 21st, 2009, 05:28 PM
shammat shammat is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 1,532 shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 3 Days 16 h 34 m 21 sec
Reputation Power: 209
Post the DDL of your table
Post the exact statement you executed
Post the exact error message you got

Reply With Quote
  #3  
Old May 21st, 2009, 05:38 PM
JoseMourinho JoseMourinho is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 57 JoseMourinho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 6 h 8 m 55 sec
Reputation Power: 1
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.

Reply With Quote
  #4  
Old May 21st, 2009, 05:50 PM
shammat shammat is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 1,532 shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 3 Days 16 h 34 m 21 sec
Reputation Power: 209
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > How to insert date from function date() in firebird date field


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
Stay green...Green IT