Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread INSERTORUPDATE ?
Fri, Jun 2 2006 12:47 PMPermanent Link

"Johnnie Norsworthy"
(I don't think I ever posted this, but I keep going back to it in my head so
I thought I'd mention it)

I would like to be able to use a SQL statement to insert a new record or
update an existing record based on a unique indexed key value.

Right now I have a lot of:
if Table.Locate() then
Table.Edit
else
Table.Append

It would be great if there was an SQL way to do that:

INSERTORUPDATE INTO TableName (FieldNames) VALUES (FieldValues) WHERE
Table.KeyField=Key

or something similar.

If that is already possible, I'd love to know how to do it so I can just use
a single SQL statement for adding new records or updating existing ones. I
am not an SQL guru, so it just might be possible.

Thanks,

-Johnnie

Sat, Jun 3 2006 4:38 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Johnnie,

I would like to second this suggestion

Chris Holland


Johnnie Norsworthy wrote:
> (I don't think I ever posted this, but I keep going back to it in my head so
> I thought I'd mention it)
>
> I would like to be able to use a SQL statement to insert a new record or
> update an existing record based on a unique indexed key value.
>
> Right now I have a lot of:
> if Table.Locate() then
>  Table.Edit
> else
>  Table.Append
>
> It would be great if there was an SQL way to do that:
>
> INSERTORUPDATE INTO TableName (FieldNames) VALUES (FieldValues) WHERE
> Table.KeyField=Key
>
> or something similar.
>
> If that is already possible, I'd love to know how to do it so I can just use
> a single SQL statement for adding new records or updating existing ones. I
> am not an SQL guru, so it just might be possible.
>
> Thanks,
>
> -Johnnie
>
>
Mon, Jun 5 2006 9:28 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Johnnie,

<< I would like to be able to use a SQL statement to insert a new record or
update an existing record based on a unique indexed key value. >>

Thanks - this one has been on the list for a month or so already.  I can't
remember who asked for it originally, though, without digging through the
enhancements. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Jun 5 2006 12:10 PMPermanent Link

John AJ Marknette

Avatar

Team Elevate Team Elevate

Tim Young [Elevate Software] wrote:
>
> Thanks - this one has been on the list for a month or so already.  I
> can't remember who asked for it originally, though, without digging
> through the enhancements. Smiley

I asked for that a few years back, but ended up doing an update and
checking the results and if rows affected where 0 I'd turn around and
do the insert. Not as optimal as I'd like but hey it works. Nice to see
your gonna add that feature. Can't wait.


-AJ Marknette
Mon, Jun 5 2006 4:42 PMPermanent Link

"Johnnie Norsworthy"
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:DFD18034-33F2-44D1-B14A-14347B30F64F@news.elevatesoft.com...
> Johnnie,
>
> << I would like to be able to use a SQL statement to insert a new record
> or update an existing record based on a unique indexed key value. >>
>
> Thanks - this one has been on the list for a month or so already.  I can't
> remember who asked for it originally, though, without digging through the
> enhancements. Smiley

Great! I've been wanting something like this for a LONG time.

-Johnnie

Tue, Jun 6 2006 1:32 AMPermanent Link

"Iztok Lajovic"
Tim,

>
> << I would like to be able to use a SQL statement to insert a new record
> or update an existing record based on a unique indexed key value. >>
>
> Thanks - this one has been on the list for a month or so already.  I can't
> remember who asked for it originally, though, without digging through the
> enhancements. Smiley
>

I hope that corresponding function or procedure for table access is on the
list too

Iztok Lajovic

Image