Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 10 total
Thread Next/Last autoinc
Sat, Jan 2 2010 9:08 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

I'm sure its my galsses but is there anywhere in EDBManager to view the next/last/current autoinc value (and yes I know its no longer called an autoinc Smiley

Roy Lambert
Sat, Jan 2 2010 12:39 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I'm sure its my galsses but is there anywhere in EDBManager to view the
next/last/current autoinc value (and yes I know its no longer called an
autoinc Smiley >>

No, not at this time.

--
Tim Young
Elevate Software
www.elevatesoft.com

Sun, Jan 3 2010 5:06 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

><< I'm sure its my galsses but is there anywhere in EDBManager to view the
>next/last/current autoinc value (and yes I know its no longer called an
>autoinc Smiley >>
>
>No, not at this time.

At least its not me this time, its really not there Smiley Can you add it into the heap of suggestions please.

Roy Lambert
Sun, Jan 3 2010 5:42 AMPermanent Link

Fons Neelen
Hi Tim,

> No, not at this time.

According to the manual this data is in the TableColumns table, but
using a simple select statement in EDB Manager I get

ElevateDB Error #700 An error was found in the statement at line 1 and
column XX (ElevateDB Error #401 The table or view TableColumns does not
exist in the schema Default)

where XX changes according to the used select statement. The
TableColumns doesn't seem to exist in either my database or the
configuration database.

SELECT ALL * FROM Configuration.Users

does work as expected, but

SELECT ALL * FROM Configuration.TableColumns

does not.

It is probably my fault, but just as Roy I am interested in obtaining
this information.

Thanks in advance.

Best regards,
Fons
Sun, Jan 3 2010 6:27 AMPermanent Link

Uli Becker
Fons,

 > SELECT ALL * FROM Configuration.TableColumns

The desired information is in the Information Schema:

SELECT ALL * FROM Information.TableColumns

Regards Uli
Sun, Jan 3 2010 7:34 AMPermanent Link

Fons Neelen
Hi Uli,

> The desired information is in the Information Schema:

Thanks. I never accessed the Information schema before.

Best regards,
Fons
Thu, Feb 1 2024 2:52 AMPermanent Link

gripsware

gripsware datentechnik gmbh

Hi,

I couldn't find any more related thread than this.

I also want to implement a reset option for an autoinc field.

"AutoID" INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 0, INCREMENT BY 1)

I know the RESTART option. Max(AutoID) isn't the way, because after deleting the last record(s), the autinc is still increasing internally.

So I would like to know what would be the next autoinc value.
Thu, Feb 1 2024 2:17 PMPermanent Link

Terry Swiers

I use the following to reset AutoInc values as needed.

SCRIPT (IN TableName VarChar, IN FieldName VarChar)
BEGIN
DECLARE NextAutoInc Integer;

EXECUTE IMMEDIATE 'select Coalesce(Max("' + FieldName + '"), 0) into ? from "' + TableName + '"' using NextAutoInc;
SET NextAutoInc = NextAutoInc;

EXECUTE IMMEDIATE '
ALTER TABLE "' + TableName + '" ALTER COLUMN "' + FieldName + '" RESTART WITH ' + Cast(NextAutoInc, VarChar);
END
Fri, Feb 2 2024 2:26 AMPermanent Link

gripsware

gripsware datentechnik gmbh

Thanks for you input.
Maybe I was a little bit unclear Smile

The final execution for the reset/restart of the seed isn't my problem.

What I want is, getting the next autoinc if i would insert a new record.
But without really add a new one.

For example:
1 record1
2 record2
3 record3
4 record4
...
...delete record4
...add new record
>>>
1 record1
2 record2
3 record3
5 record5

Is it possible to obtain this last autoinc?
Fri, Feb 2 2024 1:10 PMPermanent Link

Terry Swiers


> Is it possible to obtain this last autoinc?

Not that I am aware of as it's not exposed anywhere in EDB.  And I wouldn't trust any external method of retrieving it directly from the saved tables as the EDB caching may prevent you from seeing the current information in the table if it hasn't been flushed to the drive.
Image