[OT] SQL question

jbv at souslelogo.com jbv at souslelogo.com
Mon Nov 11 08:35:26 EST 2013


Hi Malte,

I'm not familiar with postGreSQL and therefore I was thinking : instead
of trying to put everything in a single query because of concurring
connections to the DB, why don't you store (temporarily) and process
the requests one after another in some sort of FIFO buffer (or reject
the incoming requests that are already in the buffer) ?

jbv

> Hi all,
>
> I am tearing my hair out on an SQL query. Before I lose my marbles I'd
> better ask here:
>
> given are 2 tables
>
> table1
>
> ID,UUID,first_number
>
>
> table 2
>
> ID,UUID,running_number
> I need to do an INSERT into table 2.
>
> running_number should always be the last inserted running_number +1, if
> datasets for UUID are already present in table 2, otherwise, if no data is
> present for UUID,  it should be table1s first_number +1 for the given
> UUID.
>
> Anybody can help me to put this into a single query? (reason I need it in
> one query is, that there might be concurring connections to the DB and I
> want to lock the table first on postGreSQL)
>
> All the best,
>
> Malte
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>





More information about the use-livecode mailing list