× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



fyi, I don't think * can be used with other fields in a select statement.

it's either * by itself or list all fields with your constants.

On Mon, Mar 24, 2008 at 10:59 AM, rick baird <rick.baird@xxxxxxxxx> wrote:
Brian,

Try this:

INSERT INTO archives
(select '1', style, static, combined, <timestamp>
from LIVETABLE)

without the 'select' as the first argument of your insert values, it
thinks you're inserting a single row - and the embedded select inside
that single row is confusing it.



On Mon, Mar 24, 2008 at 10:55 AM, Brian Piotrowski
<bpiotrowski@xxxxxxxxxxxxxxx> wrote:
> Good Morning All,
>
> I'm having a brain cramp this morning and hope that someone can give me a hand with an SQL statement. I have done it in the past, but the for the life of me can't remember how I did it.
>
> I have two tables that has a set of fields in it. At the end of the day, I want to run a routine that will move said data to an archives table and append some additional data to it - a plant code and a timestamp.
>
> So my LIVETABLE table structure is:
> - style
> - static
> - combined
>
> And my ARCHIVES table is defined as:
> - plantcode
> - style
> - static
> - combined
> - insert_date
>
> So in effect, when I move the data from the live table to the archives table, I want to do something like this:
>
> INSERT INTO archives ('1', select * from LIVETABLE, <timestamp>)
>
> Where the first field is a static column and the last will be a timestamp.
>
> Any ideas?
>
> Thanks!
>
> /b;
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-
> Brian Piotrowski
> Assistant Mgr. - I.T.
> Simcoe Parts Service, Inc.
> Ph: 705-435-7814 x343
> Fx: 705-435-6746
> -=-=-=-=-=-=-=-=-=-=-=-=-=-
>
> ________________________________
> This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
> --
> This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
> To post a message email: MIDRANGE-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/midrange-l
> or email: MIDRANGE-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/midrange-l.
>
>


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.