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 August 31st, 2005, 09:04 PM
2Fast4YouBR 2Fast4YouBR is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 5 2Fast4YouBR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 12 m 42 sec
Reputation Power: 0
Unhappy Trigger - What´s wrong - concatenate values, HOW????

I am using IbExpert, this is what I am typing, but I keep receiving the same error message all time:

AS
declare variable changes varchar(8000);
begin

if (old."id" <> new."id") then changes = :changes + 'ID: ' + old."id" + ' / ' + new."id";
if (old."nome" <> new."nome") then changes = :changes + 'NOME: ' + old."nome" + ' / ' + new."nome";


INSERT INTO "HistoryTest"
values
(old."id", old."nome", 'now', 'I', :changes);

end

ERROR -->
Unsuccessful execution caused by a system error that precludes
successful execution of subsequent statements.
Dynamic SQL Error.
expression evaluation not supported.

Another question, how do I get the system time? in MS Sql would be, GetDate()

Thanks a lot

Patrick

Reply With Quote
  #2  
Old September 1st, 2005, 09:59 AM
fikret fikret is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 111 fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 5 h 32 m 19 sec
Reputation Power: 8
Quote:
Originally Posted by 2Fast4YouBR
Another question, how do I get the system time? in MS Sql would be, GetDate()

Thanks a lot

Patrick


try current_timestamp.


--
Best regards,
Fikret Hasovic http://fikret.fbtalk.net

* Firebird Foundation Committee member.
- Join today at http://www.firebirdsql.org/ff/foundation
* JEDI VCS contributor
http://jedivcs.sourceforge.net/
* Firebird and Fyracle news
http://www.fyracle.org

Reply With Quote
  #3  
Old September 2nd, 2005, 12:04 AM
badukist badukist is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 62 badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 3 m 18 sec
Reputation Power: 7
Send a message via Yahoo to badukist
Use || for concatenation

if (old."id" <> new."id") then changes = :changes || 'ID: ' || old."id" || ' / ' + new."id";
if (old."nome" <> new."nome") then changes = :changes || 'NOME: ' || old."nome" || ' / ' || new."nome";

Reply With Quote
  #4  
Old September 3rd, 2005, 05:31 PM
2Fast4YouBR 2Fast4YouBR is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 5 2Fast4YouBR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 12 m 42 sec
Reputation Power: 0
Unhappy Error continues

I changed to:

AS
declare changes varchar(1000) ;
begin

if (old."id" <> new."id") then changes = :changes + 'ID: ' || old."id" || ' \ ' || new."id";
if (old."nome" <> new."nome") then changes = :changes + 'NOME: ' || old."nome" || ' \ ' || new."nome";

INSERT into "HistoryTest"
values
(old."id", old."nome", 'now', 'U', :changes);
end

But I still get error:

"Unsuccessful execution caused by a system error that precludes
successful execution of subsequent statements.
Dynamic SQL Error.
expression evaluation not supported."

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Trigger - What´s wrong???


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT