SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Database Buffer

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Database Buffer
Author Message
Loril



Joined: 21 Feb 2007
Posts: 82

Post Database Buffer Reply with quote
Hi,

What is the maximum size of the database buffer? I was running a database query and it returned an out of memory error. Thanks.
Thu Jun 21, 2007 3:49 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7955

Post Reply with quote
The amount of free virtual memory available on your machine or 2GB whatever is reached first.

My guess your database query is incorrect. Try running it in SQL editor and checking how many records it returns. If it returns more then a few thousands records you are definitely doing something wrong. Either the query is wrong, bad WHERE part or the job goal.
Fri Jun 22, 2007 1:56 am View user's profile Send private message
Loril



Joined: 21 Feb 2007
Posts: 82

Post Reply with quote
I was basically trying to transfer tables from one database to another, using the DatabaseSave command to create csv files and subsequently importing the records to the target database. After further reading of the help files, I think the DatabasePipe command might be a better choice.

I've just tested the command and received the primary key violation error from the target database. I followed the help file and made sure my destination table has a primary key so I am not exactly sure why that error occurred. Is there something else I am missing? Thanks!
Fri Jun 22, 2007 3:11 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7955

Post Reply with quote
The problem is that you are inserting non-unique data that violates your primary key. You should either correct the primary key definition and add additional columns to make the key really unique or clean up the source data and remove duplicates.
Fri Jun 22, 2007 7:08 pm View user's profile Send private message
Loril



Joined: 21 Feb 2007
Posts: 82

Post Reply with quote
I think I know what is the issue. After I truncated the records in my target table, then the DatabasePipe command worked. It seems the command is not deleting the records from the target table, which I thought it should have done when the INSERT method is used. Perhaps I am misunderstanding the help file, but this is how I thought the DatabasePipe, insert method, works:

1. Run the sql query in the source database and get the recordset.
2. Delete the records from the target database where the primary key of the recordset from step 1 equals to the primary key of the target db.
3. Insert the recordset from step 1 into the target db.

Is that the correct process? If not, please let me know where I misunderstood. Thanks.
Fri Jun 22, 2007 7:40 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7955

Post Reply with quote
I am not sure what the help page for DatabasePipe says is actually accurate. I think with "INSERT" method DatabasePipe only generates INSERTs, with "UPDATE" only generates UPDATEs. To make sure the destination table is clean, you can put DatabaseExecute( "TRUNCATE TABLE mytable", rows ) before DatabasePipe call. If you need to replace only the existing rows, but do not delete everything, use an intermediate table to pump the source data, then execute a couple of additional SQL statements to complete the data synchronization, for example DELETE FROM my_table WHERE EXISTS (SELECT * FROM staging_table WHERE staging_table.key = my_table.key) and after that INSERT INTO my_table SELECT * FROM staging_table.
Sat Jun 23, 2007 10:47 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.