• 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: Cail Borrell <email@hidden>
  • Date: Wed, 20 Aug 2008 19:31:44 +0200

Hi Chuck,

It should work.

The thing is that formatValueForAttribute in the plugin formats values according to the
external data type. ie the database data type.


In the case of a NUMERIC there are checks on the object type received
and if it is a String object it will just be passed through. Hence no quotes ;-)


-Cail




On 20/08/2008, at 18.40, Chuck Hill wrote:

Hi Cail,


On Aug 20, 2008, at 6:47 AM, Cail Borrell wrote:

Hi Ondra,

If you change the internal data type of your unique attribute to String
you should be able to use a little sql injection when inserting your record.


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

That won't work, will it? The FB plugin will wrap it in quotes so this will get inserted as a literal value. Or am I missing some aspect of your suggestion?


Chuck




and invalidate the eo after insertion.

Looks like the best solution; the only drawback in my case is that FrontBase needs to be launched with a special option to support triggers: I can very much see the "why does it not work" problems at client's, caused by wrong setup here :)

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

-Cail

On 16/08/2008, at 03.03, Ondřej Čada wrote:

Alan,

On Aug 16, 2008, at 2:47 AM, Alan Ward wrote:

That would do it, yes. Have EOF insert the record with a null value in the column

Actually, rather with some specific non-null placeholder, for there are records which have valid NULL there.


and use a trigger (after insert) to assign the value from a sequence.

... if and only if there is the placeholder.

Be aware though that you should not lock on that column or else you'll run into optimistic locking failures if you subsequently update any other column before refetching the (now modified) EO.

Yup, that Chuck has pointed out to me at the very beginning, when triggers were mentioned the first time.


Looks like the best solution; the only drawback in my case is that FrontBase needs to be launched with a special option to support triggers: I can very much see the "why does it not work" problems at client's, caused by wrong setup here :)

Still, all the other solutions look more complex/more error-prone.

Best,
---
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

_______________________________________________ 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


-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects








_______________________________________________ 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>)
 >Re: sequential numbering across more instances (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Immortal sessions in production
  • Next by Date: Re: Immortal sessions in production
  • Previous by thread: Re: sequential numbering across more instances
  • Next by thread: Re: sequential numbering across more instances
  • Index(es):
    • Date
    • Thread