Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

a simpler way...?

 
   Database Help (Home) -> Paradox RSS
Next:  can we delete .patch_storage  
Author Message
Kenneth

External


Since: Feb 12, 2008
Posts: 26



(Msg. 1) Posted: Fri Nov 07, 2008 1:59 pm
Post subject: a simpler way...?
Archived from groups: comp>databases>paradox (more info?)

Howdy,

Using P9 with XP...

I need to have a field in an MRO number entries in sequence.
That is, the first entry gets a "1" and the second gets a
"2" etc.

I don't want to use a autoincrement type because the field
is part of a key.

I could run a query, get a cMax, and increment by one, but
is there a simpler way to do the deed?

Many thanks,
--
Kenneth

If you email... Please remove the "SPAMLESS."

 >> Stay informed about: a simpler way...? 
Back to top
Login to vote
Tom Krieg

External


Since: Jun 28, 2008
Posts: 6



(Msg. 2) Posted: Fri Nov 07, 2008 8:25 pm
Post subject: Re: a simpler way...? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Does the incremental part of the key revert back to 1 when the other
part changes? I.e. when the other part of the key changes to 4322, does
the sequence revert back to 43221, 43222, etc?

If that's the case, I would suggest a table with a record for every
generated key (4321, 4322 etc) being the primary key with a field
containing the last incremental number used for that main number.

Kenneth wrote:
>
> The value in the field in question is part of the key. The
> other part of the key is generated using code that is sound.
> (It takes a value from a table reserved for the purpose,
> adds one to that value, uses it as the first part of the
> key, and then puts the value back into the table.)
>
> I am trying to learn of the best way to assign the value of
> the field to a "1" or "2" etc. (so that the key generated
> would look something like 43211, 43212, 43213, 43214 etc.
> where the last digit is the one from the field I have
> described.
>
> Might you have ideas about that specific need?
>
> Many thanks,


--
Tom Krieg

---------------
http://www.krieg.com.au
Please use the contact page to contact me via email

 >> Stay informed about: a simpler way...? 
Back to top
Login to vote
Robert Wiltshire

External


Since: Jul 26, 2008
Posts: 9



(Msg. 3) Posted: Fri Nov 07, 2008 8:51 pm
Post subject: Re: a simpler way...? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Kenneth,

You mentioned that you were editing with a MRO,
and I understand that,
but I am not sure I understand the whole picture yet.

Is this a header / detail kind of relationship,
similar to an invoice with many lines,
or a production item with inventory items needed for production ?

Do you go thru a process where you have to pick the
header or master record,
and then you add the detail lines ?

If you do figure out a way that adds the 1,2,3, etc,
and then you renumber them later,
will the original key be located elsewhere and need to be changed ?

Do you do the data entry right in the original table ?
or do you keep empty tables ( or create temporary tables) for data entry,
and then "post" it to main table when user hits save ?

In some situations,
I have created empty temporary tables on the fly,
using the create like syntax,
but I do not key this table.
I then allow users to data entry into the temporary table,
if they hit cancel , I just empty temp table, or delete it,
and then if they hit save, then the fun begins.

If adding new item, then all rows need to be added elsewhere.
If editing an item, then I delete all items matching the header ,
and then add all the detail records.

For these detail records,
when the user clicks save,
I end the edit mode,
and then simply run a tcursor scan/endscan on that temp entry table,
to add sequencing number,
then close tcursor,
and then do table add or insert query as necessary
to move these records into approriate table.

Keying the temp data entry tables for me introduced headaches,
and since I was editing in an empty table,
I really didnt need it.
I just had proper code in my save routine.

I think this is better way if you are doing client / server also.
Sort of like creating little batches, that must deal with the server.

Not sure if that makes sense or is applicable in your case.

Still doing any linux,web, or mysql stuff ?
IIRC from other posts, you were doing some fun things with that.


Good luck
Robert Wiltshire
 >> Stay informed about: a simpler way...? 
Back to top
Login to vote
Kenneth

External


Since: Feb 12, 2008
Posts: 26



(Msg. 4) Posted: Fri Nov 07, 2008 9:11 pm
Post subject: Re: a simpler way...? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sat, 08 Nov 2008 11:35:39 +1100, Tom Krieg <"Please use
the website contact form"> wrote:

>Does the incremental part of the key revert back to 1 when the other
>part changes? I.e. when the other part of the key changes to 4322, does
>the sequence revert back to 43221, 43222, etc?
>
>If that's the case, I would suggest a table with a record for every
>generated key (4321, 4322 etc) being the primary key with a field
>containing the last incremental number used for that main number.

Hi again,

Yes, the incremental part was to revert back to "1."

As it happens, I have another approach that has solved my
problem, but I am still curious about your suggestion above.

But, with regret, I do not understand your suggestion as
written.

Could you please describe the idea in that closing paragraph
another way?

Many thanks,
--
Kenneth

If you email... Please remove the "SPAMLESS."
 >> Stay informed about: a simpler way...? 
Back to top
Login to vote
Kenneth

External


Since: Feb 12, 2008
Posts: 26



(Msg. 5) Posted: Fri Nov 07, 2008 9:12 pm
Post subject: Re: a simpler way...? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 7 Nov 2008 20:51:50 -0500, "Robert Wiltshire"
wrote:

>Still doing any linux,web, or mysql stuff ?
>IIRC from other posts, you were doing some fun things with that.

Hi Robert,

I thank you for your comments, but suspect you are confusing
me with someone else.

All the best,
--
Kenneth

If you email... Please remove the "SPAMLESS."
 >> Stay informed about: a simpler way...? 
Back to top
Login to vote
Tom Krieg

External


Since: Jun 28, 2008
Posts: 6



(Msg. 6) Posted: Fri Nov 07, 2008 10:25 pm
Post subject: Re: a simpler way...? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Let's split the number into 2 parts, the "fixed" part (i.e. 4321, 4322
etc) and the "increment" part (1,2,3,4).

My suggestion is to create a table with 2 fields, "Fixed" and "Last
Increment", where "fixed" is the primary key.

When you create a new key, create a new record in this table and set the
increment to 1. When you create another record for the same "fixed"
part, just qlocate the appropriate record using a tcursor and add 1 to
the increment.

Kenneth wrote:
> On Sat, 08 Nov 2008 11:35:39 +1100, Tom Krieg <"Please use
> the website contact form"> wrote:
>
>> Does the incremental part of the key revert back to 1 when the other
>> part changes? I.e. when the other part of the key changes to 4322, does
>> the sequence revert back to 43221, 43222, etc?
>>
>> If that's the case, I would suggest a table with a record for every
>> generated key (4321, 4322 etc) being the primary key with a field
>> containing the last incremental number used for that main number.
>
> Hi again,
>
> Yes, the incremental part was to revert back to "1."
>
> As it happens, I have another approach that has solved my
> problem, but I am still curious about your suggestion above.
>
> But, with regret, I do not understand your suggestion as
> written.
>
> Could you please describe the idea in that closing paragraph
> another way?
>
> Many thanks,


--
Tom Krieg

---------------
http://www.krieg.com.au
Please use the contact page to contact me via email
 >> Stay informed about: a simpler way...? 
Back to top
Login to vote
Kenneth

External


Since: Feb 12, 2008
Posts: 26



(Msg. 7) Posted: Fri Nov 07, 2008 10:25 pm
Post subject: Re: a simpler way...? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sat, 08 Nov 2008 13:30:20 +1100, Tom Krieg <"Please use
the website contact form"> wrote:

>Let's split the number into 2 parts, the "fixed" part (i.e. 4321, 4322
>etc) and the "increment" part (1,2,3,4).
>
>My suggestion is to create a table with 2 fields, "Fixed" and "Last
>Increment", where "fixed" is the primary key.
>
>When you create a new key, create a new record in this table and set the
>increment to 1. When you create another record for the same "fixed"
>part, just qlocate the appropriate record using a tcursor and add 1 to
>the increment.
>

Hi again,

Many thanks...

All the best,
--
Kenneth

If you email... Please remove the "SPAMLESS."
 >> Stay informed about: a simpler way...? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
write to paradox via web - I have a client that uses software developed in delphi. It uses paradox database files. Can these be written to from the web? I am familiar with php/mysql...is there a similar capability with delphi/paradox?

which program? - Hi to all, I'm sorry 'cause I'm not sure this is the correct ng...so my apologies in advance if I'm in the wrong place. My customer show me a floppy disk with old files (about 1998-1999) and told me that there are her accounting data to back life. With...

forcing lck files location - Is there method to force lck files location. I create query on fly with Delphi but there is a problem with lock files. It tries to create it to system32 folder but because user does not have rights to that folder , creating query fails. So, how can I..

Network performance and hardware issues - Hi! Our clients have run our Paradox based apps in small network configurations with only about 10-15 runtime clients at max. Recently we have had inquiries from a bigger company that wants to run our app in an network of over 100 clients, is this..

I can't to open table(s) on InterBase's server - I have a computer with OS WindowsXP Professional version 2002 with SP2 and I have next problem with Paradox 10 v.11.0.0.302. I can't to open a table(s) on InterBase's server, but I can to open a local table(s). Dialog window of Database Login for..
   Database Help (Home) -> Paradox All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]