Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (Oracle)
 Sorry, I have to bring this up to a Topic... IDs..
 Forum Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Fez
Starting Member

USA
25 Posts

Posted - 19 November 2000 :  18:26:41  Show Profile  Visit Fez's Homepage  Send Fez an AOL message
I've searched high and low. There is no system for using VFP to auto generate an ID within the database. The only way it is possible is via a direct call to VFP itself with a VFP compiled object. All connections to VFP databases ignore the trigger requests to update the default value of the ID field.

As for speed, we perform a single lookup at the start of the application, from then on it's a variable increment. I've got mine working over here on another project. It's portable, and super fast.

I assume Greg has done something similar, because VFP does not allow it's stored procedures to run from ADO / OLE-DB / ODBC, or outside of a compiled VFP app for that matter. Even the most basic triggers and default values that I wrote that worked fine under VFP returned .NULL. from the web.

In a perfect world, the more we can offload to the database manager the better off we are, but when something like VFP can't do it, this takes up the slack, and as an added benefit, it'll work on any database.

I don't know much about the work already done on the autonumber in Oracle or VFP, but thus far nobody has posted anything, and it seems everyone was talking about all sorts of extremes including converting those ID's to very long strings.

If those other solutions exist, where can we all find them?

Thanks





Fez
Developer of CouponPages.Com<
Go to Top of Page

h20
Starting Member

39 Posts

Posted - 22 November 2000 :  14:15:50  Show Profile
Good points Doug... there are ways to make this work... however ... I have been thinking a lot about this lately and so I have another idea... time to move on…here it is

userid+numberofposts

so if I am posting my 20th post the id would look like this:

h2020

if you are concerned about this situation:

user=h
posts=2020
id=h2020

and

user=h20
posts=20
id=h2020

simply use this format:

userid+specialCHR+numberofposts

basically the specialCHR would have to be a character valid for both MS and UNIX platforms.. It would also have to be a character that cannot be used in usernames.

we spoke of using a post counter, placed some where in the db... gor mentioned that strict concurrency control would have to be practiced... that is true if your using just one counter field that everyone accesses... but with this idea.. the id can be processed from the individuals user account. only the user’s counter placing the post has to be accessed when he or she is post… much easier to control …

I think it is well worth find a global way to create an id… using a trigger will work for oracle… but what about all of the other DBs out there… will the proposed trigger work for all version of PL/SQL?

I think we should bang on this id issue just a while longer before we move to oracle triggers.


<
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 22 November 2000 :  14:23:34  Show Profile  Visit gor's Homepage
The post count of a user can be changed by the administrator, which could lead to duplicate IDs.


Pierre Gorissen

Even if you're on the right track,
you'll get run over if you just sit there.

Will Rogers<
Go to Top of Page

h20
Starting Member

39 Posts

Posted - 22 November 2000 :  15:44:33  Show Profile
gor... why would you ever want to change the post count?

<
Go to Top of Page

h20
Starting Member

39 Posts

Posted - 22 November 2000 :  15:48:15  Show Profile
if the admin can change the post count and it is going to stay that way.. then add another counter that cannot be changed...

one counter to display the number of post and calculate the forum status...

another counter that counts real posts... that is unless the admin has the ability to add to the post counter... i have no reason why he or she would ever need to do this though.

<
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 22 November 2000 :  16:46:10  Show Profile  Visit gor's Homepage
The postcounter field is a field that can be edited by an administrator, so he/she can add or substract from that field.

There have been some discussions about the postcount. Some said that the postcount should be the actual number of posts of that member in the database, so if I deleted one of your replies, your postcount would be one less.
That is not how it is now, because we say that the postcount is the number of posts you have made so far. Even a deleted post is a post you made.
There have been members who modified their forum so the postcount showed the actual number of posts currently in the database!

An administrator can change the postcount if a member floods the forum to have a higher postcount. (ok, I know why would you bother).

But I also have seen board were the administrators added af few thousand posts to their own postcount because it looked so kewl (for the record: my postcount is real!)

So, though you could say that at the moment it isn't something that would happen daily, it is a field that can be changed by the administrator, and you don't want a situation were an administrator could, by accident mess up the database just because he/she changed a field that can be changed.



Pierre Gorissen

Even if you're on the right track,
you'll get run over if you just sit there.

Will Rogers<
Go to Top of Page

h20
Starting Member

39 Posts

Posted - 22 November 2000 :  21:03:15  Show Profile
so determine how many posts the use has... either by using the current post count field and stop allowing the admin to change it... or finding another way to determine the post count.... what do you think about my id idea stated above...? asuming that we could find an acurate way to determine the post count for each user.

<
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 Forum Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000 Version 3.4.07