Subject | Re: [ib-support] Re: Duplication records |
---|---|
Author | Lucas Franzen |
Post date | 2001-07-08T09:53:15Z |
Lee,
Your Insert statement looks like:
INSERT INTO PIM EMP,DATE.START,...
which is invalid.
Insert statements have to look like:
INSERT INTO TABLE ( FIELDLIST ) ...
So add the parenthesises around your fieldlist.
As you said EMP is an unknown token. It is since there is a "(" expected
...
Luc.
Leeway schrieb:
Your Insert statement looks like:
INSERT INTO PIM EMP,DATE.START,...
which is invalid.
Insert statements have to look like:
INSERT INTO TABLE ( FIELDLIST ) ...
So add the parenthesises around your fieldlist.
As you said EMP is an unknown token. It is since there is a "(" expected
...
Luc.
Leeway schrieb:
>
> svein,
> I tried this but got errors in the prepare.
> 'Token unknown EMP'
> What is wrong with this statement ?
> The where statement on its own works.
>
> QTIB_Pim.SQL.Clear;
> QTIB_Pim.SQL.Add('insert into PIM EMP,DATE_START,DATE_END,PIMAGE');
> QTIB_Pim.SQL.Add('select EMP,DATE_START + :DaysToMove,DATE_END
> + :DaysToMove,PIMAGE from PIM');
> QTIB_Pim.SQL.Add('where DATE_START >= ' + Date_Start_String + ' and
> DATE_START <= ' + Date_End_String);
> QTIB_Pim.SQL.Add('parambyname(:daystomove).AsInteger := 2;');
> QTIB_Pim.Prepare;
> QTIB_Pim.Execute;
>
> Thanks aforehand
> Lee
>
> --- In ib-support@y..., Svein Erling Tysvær
> <svein.erling.tysvaer@k...> wrote:
> > Hi Lee,
> >
> > INSERT INTO PIM (listoffieldstoinsert)
> > SELECT somefields, DATE_START + :DaysToMove, morefields
> > FROM PIM
> > WHERE keyfield = :SomeValue
> > Prepare the statement, set the parameters
> > (ParamByName(:DaysToMove).AsInteger:=something;) and execute the
> statement.
> >
> > Simple and easy,
> > Set
> >
> > >In a database I got appointments with a timestamp field.
> > >How can I duplicate a specific appointment to another date ?
> > >So suppose I got a appointment on 2001/01/01 and I want to
> duplicate
> > >this appointment to 2001/02/01 how do I write a sql command for
> this ?
> > >The appointment fields are the same, only the timestamp field is
> > >different.
> > >I know how to move :
> > >('update PIM set DATE_START = DATE_START + ' + IntTostr
> (Days_To_Move)
> > >+ ' where DATE_START = ' + Date_Start_String);
> > >But what is the syntax for duplicating a record?
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/