Subject | Re: [ib-support] Token unknown |
---|---|
Author | Tim Ledgerwood |
Post date | 2003-04-29T10:08:15Z |
Point taken - thanks. I have a situation where I need some tables to be
emptied and data re - imported, so I have written something that does the
deletions from the tables.
Data is read, decoded and inserted from a text file, and while I have no
absolute need for the generators to be reset in this instance, I just like
everything to be neat and tidy.
However, I do have an instance in one of my applications where there is a
master - detail relationship between two tables. I need each "set" of
detail records to have numbering starting at 0. I would like to use a
generator to do it - at the moment, it's done in code.
At 04:57 AM 4/29/2003 -0500, you wrote:
emptied and data re - imported, so I have written something that does the
deletions from the tables.
Data is read, decoded and inserted from a text file, and while I have no
absolute need for the generators to be reset in this instance, I just like
everything to be neat and tidy.
However, I do have an instance in one of my applications where there is a
master - detail relationship between two tables. I need each "set" of
detail records to have numbering starting at 0. I would like to use a
generator to do it - at the moment, it's done in code.
At 04:57 AM 4/29/2003 -0500, you wrote:
> > At 02:59 AM 29/04/2003 -0500, you wrote:[Non-text portions of this message have been removed]
> > > > Thanks Helen. Any ideas as to how I could do this?
> > > >
> > >
> > >You could try something like this:
> > >
> > >xTmp = gen_id(GEN_MSGS, -gen_id(GEN_MSGS));
> > >xTmp = gen_id(GEN_MSGIMPORTS, -gen_id(GEN_MSGIMPORTS));
> > >xTmp = gen_id(GEN_TXNERROR, -gen_id(GEN_TXNERROR));
> > >
> > >where xTmp is just an integer variable. Not sure if this executes fast
> > >enough in a multi-user environment, though.
> >
> > Hmmm.
> > It would have to be
> > xTmp = gen_id(GEN_MSGS, -gen_id(GEN_MSGS, 0));
>
>I knew I was forgetting something. <g>
>
> >
> > It's one of those things - "Just because you can, doesn't mean you should"
> > - like telling your three-y-o to ride his tricycle around the swimming
>pool.
> >
> > Since you'd have to ensure absolutely that such code would only ever be
> > executed whilst sysdba or owner was logged in with exclusive access, you
> > might as well do it the proper way - with a script.
> >
>
>Agreed, however, it's just one of those tricks you can use if it becomes
>absolutely necessary. I agree with you, however, it's something that should
>be done outside the context of a normal database program operation.
>
>Woody (TMW)
>
>"Start every day off with a smile and get it over with."
>-- W. C. Fields
>
>
>
>
>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/
>
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.474 / Virus Database: 272 - Release Date: 4/18/2003