• 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
Re: sequential numbering across more instances
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sequential numbering across more instances


  • Subject: Re: sequential numbering across more instances
  • From: Ondřej Čada <email@hidden>
  • Date: Wed, 20 Aug 2008 16:54:04 +0200

Cail,

On Aug 20, 2008, at 3:47 PM, Cail Borrell wrote:

If you change the internal data type of your unique attribute to String

That would be kind of problem, for I am working with a legacy database which already contains lots of rows.


Not that it would be entirely out of question, but it would complicate things considerably :(

you should be able to use a little sql injection when inserting your record.

Sorry, I got lost here. You mean I should catch the generated SQL in EOF just before sent to the database, and replace the value which is sent to the column by the "coalesce(...)+1" expression?


Just set the value of your unique column to something like:
coalesce (select max(<unique column>) from <table name>, cast (1000000 as <unique column data type>)) + 1
and invalidate the eo after insertion.

If not, colour me please dumb and elucidate.

If so... well, I haven't considered this possibility -- good point!

Perhaps I could do the same with an integer column and simpler expression

(select max(<unique column>) from (<table name>))+1

could I not? (Assumed there is at least one non-nil column, which it happens to be there all right -- otherwise I could use the improvements Florijan or Francis suggested.)

In the latest versions of FrontBase triggers are enabled by default.

Good, didn't know that. Thanks! --- 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


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: Ondřej Čada <email@hidden>)
 >Re: sequential numbering across more instances (From: Cail Borrell <email@hidden>)

  • Prev by Date: Re: Single Table inheritance and EM question
  • Next by Date: Re: Single Table inheritance and EM question
  • Previous by thread: Re: sequential numbering across more instances
  • Next by thread: Re: sequential numbering across more instances
  • Index(es):
    • Date
    • Thread