• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Help with triggers/FrontBase (was: sequential numbering across more instances)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with triggers/FrontBase (was: sequential numbering across more instances)


  • Subject: Help with triggers/FrontBase (was: sequential numbering across more instances)
  • From: Ondřej Čada <email@hidden>
  • Date: Wed, 20 Aug 2008 14:40:02 +0200

Hello,

On Aug 16, 2008, at 3:52 AM, Ondřej Čada wrote:

Actually, the fun begins sooner I've supposed. Probably I just have my dumb day today or should go to catch a Z or two, or should just learn SQL thoroughly :), but I can't create a simplest trigger in FrontBase :( Can someone please point me out to my mistake?

Well, I have found the culprit: since with FB the default is FOR EACH STATEMENT, one must set explicitly FOR EACH ROW to make REFERENCING work.


Though, solving that, I am stuck with another problem. For reference, the following insert trigger works perfectly for me (to set the next available number to ORDERNUMBER whenever a row is inserted; OID is the PK, am working in extra table TEST for the moment):

CREATE TRIGGER test_insert AFTER INSERT ON TEST REFERENCING NEW x FOR EACH ROW BEGIN update test set ordernumber=(SELECT MAX(ordernumber) FROM test)+1 where oid=x.oid AND ordernumber=-1; END

On the other hand, the (more or less same) update trigger

CREATE TRIGGER test_update AFTER UPDATE ON TEST REFERENCING NEW x FOR EACH ROW BEGIN update test set ordernumber=(SELECT MAX(ordernumber) FROM test)+1 where oid=x.oid AND ordernumber=-1; END

causes an error

Exception 049. Expected TIME not found.

I'd be pretty grateful for any insight and/or advice how to solve the problem.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Help with triggers/FrontBase (was: sequential numbering across more instances)
      • From: Florijan Stamenkovic <email@hidden>
References: 
 >sequential numbering across more instances (From: Ondřej Čada <email@hidden>)
 >Re: sequential numbering across more instances (From: Florijan Stamenkovic <email@hidden>)
 >Re: sequential numbering across more instances (From: Ondřej Čada <email@hidden>)
 >Re: sequential numbering across more instances (From: Chuck Hill <email@hidden>)
 >Re: sequential numbering across more instances (From: Guido Neitzer <email@hidden>)
 >Re: sequential numbering across more instances (From: Chuck Hill <email@hidden>)
 >Re: sequential numbering across more instances (From: Ondřej Čada <email@hidden>)
 >Re: sequential numbering across more instances (From: Chuck Hill <email@hidden>)
 >Re: sequential numbering across more instances (From: Mike Schrag <email@hidden>)
 >Re: sequential numbering across more instances (From: Chuck Hill <email@hidden>)
 >Re: sequential numbering across more instances (From: Alan Ward <email@hidden>)
 >Re: sequential numbering across more instances (From: Chuck Hill <email@hidden>)
 >Re: sequential numbering across more instances (From: Ondřej Čada <email@hidden>)

  • Prev by Date: Re: Protected access modifiers handled differently at runtime in XCode and Eclipse?
  • Next by Date: Re: sequential numbering across more instances
  • Previous by thread: Re: sequential numbering across more instances
  • Next by thread: Re: Help with triggers/FrontBase (was: sequential numbering across more instances)
  • Index(es):
    • Date
    • Thread