CopyCat / CopyTiger Forums  

Go Back   CopyCat / CopyTiger Forums > CopyTiger > General information
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-08-09, 07:02 AM
foncci foncci is offline
Junior Member
 
Join Date: Aug 2009
Posts: 1
Default Questions before buy

Hi:

I’m very interested into buy a license of your replicator. I have a 6 drugstores and I need to replicate some information. I use FIB 2.1.2 and Delphi 6. All my primary keys are ID of BigInt type.

I downloaded your demo and I’m working with it right now but I cannot do every thing I need.

This is my 1st time replicating and I need to ask you some questions because of my Business rules:

1- I want to pay all credit invoices in my main drugstore. That ´s why I need to replicate invoices from others drugstores but I need to change “status” to “replicate” for the daily report.

2- The ID of the replicated invoices could exist in the main drugstore and that ID is not important because it is a movement table. Is there a way to generate the ID again in the main drugstore for replicated invoices?

3- There are some cases like customers where I need to replicate using not only the primary key else a secondary index like security social number. For example I created a client in a Drugstore1 and I create the same client in the main Drugstore. When I try to replicate that client I receive a violation error because although IDs aren’t equal the SSI are the same. Is there a way in which the replicator can search over a secondary key and if found it, just change the ID to the Master ID?

If you can supply me the information and I buy you product tomorrow, how many time to receive licenses?

Regards,

Al
Reply With Quote
  #2  
Old 07-08-09, 03:55 PM
PaulBreneman PaulBreneman is offline
Super Moderator
 
Join Date: Mar 2007
Location: Columbus, Ohio, USA
Posts: 23
Default

Hello Al,

I'd like to help you but first I need a little more information.

You posted your message in the CopyTiger section of the forum but you mention that you are using Delphi 6 and FIB which sounds more like CopyCat? Please reply and let me know which setup program you downloaded:
CCEvalSetup.exe
CCDemoSetup.exe
CopyTiger_Setup.exe
__________________
Regards,
Paul Breneman
http://www.TurboControl.com/
http://www.dbReplication.com/
Reply With Quote
  #3  
Old 17-08-09, 10:53 AM
admin admin is offline
Administrator
 
Join Date: Mar 2007
Posts: 195
Default

Hello Al,

Sorry for the delay in responding to your questions : we have been closed for the last two weeks.

I think you will find CopyCat to be quite appropriate for your needs, in that it allows a lot of personalisation. So, you can quite easily add your own business logic to the replication process through the use of the TCcReplicator events.

So, to answer your questions :

1- If I understand correctly, there is a field (status) which needs to be set to "Replicated" every time an invoice is replicated, is that right? This can be done by implementing the OnRowReplicated event as executing a query to set the field to the value you want after replicating. Simply use a TCcQuery object connected to your database connection.

2- Yes, you can generate a new key that will be calculated in the main store's database and will be applied locally. What you need to do is set the PRIMARY_KEY_SYNC field in the RPL$TABLES table to an SQL expression to be executed on the server and that will return a valid ID, and then recreating the triggers for your table (if you're using the example projects, this can be done using the BasicConfig example). For example, you could set PRIMARY_KEY_SYNC to "gen_id(gen_invoices, 1)", which would mean that when the row needs to be replicated, CopyCat will automatically execute that SQL expression and update the (local) primary key to the value that was returned. So the above expression would return the following generator value for the gen_invoices generator on the server. The primary key will then be given that value automatically, and then the row will be replicated.

3- If I understand correctly, the main drugstore should have the list of all the clients, but the others should only have their own, is that right? If so, it's true that I can see the problem you could have with the same client being put in twice. The question is, if a client is added to a remote drugstore but is already present in the local drugstore, what should be done? Should the information from the main store be kept, or the information from the remote store?

That is a question for you to consider so you make the right choices for your business logic. As far as the technical side is concerned, there's no problem. You can do what you suggested by implementing the OnRowBeforeReplicate event of the TCcReplicator component. This event is fired just before a row is replicated. In that event, you can execute a query on the main drugstore database (using a TCcQuery) to check if the SS number is already in use. If it is, get the client code and execute another query, this time on the other drugstore, to update the primary key to set it to the client code from the main drugstore database. You can then throw an exception (or call Abort), if you don't want the row to be replicated.

I hope that answers all your questions. You seem to have been in a hurry to get an answer, in which case, I hope I haven't disappointed you. But now that we have returned from holidays, you can expect to get your licenses the same day your order or the next day (except on week-ends). Feel free to ask if you have any more questions or if my answer is not clear enough.
__________________
Best regards,
Jonathan Neve
_______________
CopyCat - advanced Delphi components for database replication, supporting CodeGear Interbase, FirebirdSQL and MS SQL Server!
CopyTiger - the ultimate database replication solution for CodeGear Interbase, FirebirdSQL and MS SQL Server!
_______________
More information : http://www.microtec.fr/copycat
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +2. The time now is 08:42 AM.


Powered by vBulletin Version 3.5.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.