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

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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 January 19th, 2011, 06:33 AM
E_Pluribus_Unum E_Pluribus_Unum is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 25 E_Pluribus_Unum User rank is Corporal (100 - 500 Reputation Level)E_Pluribus_Unum User rank is Corporal (100 - 500 Reputation Level)E_Pluribus_Unum User rank is Corporal (100 - 500 Reputation Level)E_Pluribus_Unum User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 h 33 m 29 sec
Reputation Power: 0
Firebird 2.5 UTF8 database, WIN1250 client problem (firebird bug?)

Hi!

I've got two tables, and one of them has a trigger, which insert or update data to the other table in case of inserting.

The followong SQL gives error when I connect with WIN1250, but works fine with UTF8. If I'm not mistaken the client side charset sould not affect the result.

(The FB tracker is down... Any info about that?)


Code:
INSERT INTO sz_felirat_szall (id, nyelv_kod, mezonev, ertek)
VALUES (2065664, '00', 'LEV_SKOMP', 'Szállítói tartozásunk kiegyenlítése')


Error :
"arithmetic exception, numeric overflow, or string truncation.
string right truncation.
At trigger 'INSERTSZ_FELIRAT_SZALL' line: 17, col: 3."


Code:
CREATE TABLE SZ_FELIRAT (
    NYELV_KOD         XVAR2N /* XVAR2N = VARCHAR(2) NOT NULL */,
    ...
    LEV_SKOMP         XVAR40 /* XVAR40 = VARCHAR(40) */,
    ...
);

CREATE TABLE SZ_FELIRAT_SZALL (
    ID         XIDN /* XIDN = INTEGER NOT NULL */,
    NYELV_KOD  XVAR2N DEFAULT '00' /* XVAR2N = VARCHAR(2) NOT NULL */,
    MEZONEV    XVAR30N /* XVAR30N = VARCHAR(30) NOT NULL */,
    ERTEK      XVAR100N /* XVAR100N = VARCHAR(100) NOT NULL */
);

CREATE OR ALTER TRIGGER insertsz_felirat_szall FOR sz_felirat_szall
ACTIVE BEFORE INSERT POSITION 0
AS
DECLARE VARIABLE ins VARCHAR(300);
DECLARE VARIABLE db INTEGER DEFAULT 0;
BEGIN
  IF (NEW.id IS NULL) THEN NEW.id = GEN_ID(xid_gen, 1);
  IF (NEW.nyelv_kod IS NULL) THEN NEW.nyelv_kod = '00';
  SELECT
      COUNT(1)
  FROM sz_felirat
  WHERE nyelv_kod = NEW.nyelv_kod
  INTO :db;
  IF (db = 0) THEN INSERT INTO sz_felirat (nyelv_kod)
    VALUES (NEW.nyelv_kod);
  ins = 'update sz_felirat set ' || NEW.mezonev || '=''' || REPLACE(NEW.ertek, '''', '''''') || ''' where nyelv_kod = ''' || NEW.nyelv_kod || ''' and coalesce(' || NEW.mezonev || ', '''') = ''''';
  EXECUTE STATEMENT ins;
END

Reply With Quote
  #2  
Old January 20th, 2011, 07:07 AM
E_Pluribus_Unum E_Pluribus_Unum is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 25 E_Pluribus_Unum User rank is Corporal (100 - 500 Reputation Level)E_Pluribus_Unum User rank is Corporal (100 - 500 Reputation Level)E_Pluribus_Unum User rank is Corporal (100 - 500 Reputation Level)E_Pluribus_Unum User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 h 33 m 29 sec
Reputation Power: 0

Reply With Quote
  #3  
Old January 25th, 2011, 01:21 PM
rapgame rapgame is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 74 rapgame User rank is Private First Class (20 - 50 Reputation Level)rapgame User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 14 h 12 m 41 sec
Reputation Power: 4
This Firebird tracker appears to be offline...

http://tracker.firebirdsql.org

Why?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Firebird 2.5 UTF8 database, WIN1250 client problem (firebird bug?)

Developer Shed Advertisers and Affiliates



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

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


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap