bulk

Sybase JConnect: ENABLE_BULK_LOAD usage

我怕爱的太早我们不能终老 提交于 2019-11-29 02:39:58
Can anyone out there provide an example of bulk inserts via JConnect (with ENABLE_BULK_LOAD ) to Sybase ASE? I've scoured the internet and found nothing. I got in touch with one of the engineers at Sybase and they provided me a code sample. So, I get to answer my own question. Basically here is a rundown, as the code sample is pretty large... This assumes a lot of pre initialized variables, but otherwise it would be a few hundred lines. Anyone interested should get the idea. This can yield up to 22K insertions a second in a perfect world (as per Sybase anyway). SybDriver sybDriver = (SybDriver

Is there a bulk email plugin for Rails apps?

风流意气都作罢 提交于 2019-11-29 01:29:50
问题 Does anyone know of a plugin or something that can be used to send bulk emails for a Rails app? Specifically, I'd like to be able to pass an HTML email file to a rake task or something and have it emailed out to everyone who has signed up to my site and checked the "please send me info about XXX" box. I wrote kind of a hacked-together version for myself, but I'd like something that throttles itself somewhat smartly and can pick up where it left off if interrupted. Update : I eventually broke

Override django's model delete method for bulk deletion

心不动则不痛 提交于 2019-11-28 06:56:09
I'm overriding Django's model delete method in order to delete orphan files in the disk for image fields, something like this: class Image(models.Model): img = models.ImageField(upload_to=get_image_path) ... def delete(self, *args, **kwargs): self.img.delete() super(Image, self).delete(*args, **kwargs) This works fine when I delete single objects from the admin, but when I select multiple objects and delete them, this doesn't seem to get called. I have been googling for a while but haven't hit the right keywords to get the answer for this, nor the official documentation seems to talk about

Oracle: Bulk Collect performance

耗尽温柔 提交于 2019-11-28 06:06:12
Can you help me to understand this phrase? Without the bulk bind, PL/SQL sends a SQL statement to the SQL engine for each record that is inserted, updated, or deleted leading to context switches that hurt performance. Justin Cave Within Oracle, there is a SQL virtual machine (VM) and a PL/SQL VM. When you need to move from one VM to the other VM, you incur the cost of a context shift. Individually, those context shifts are relatively quick, but when you're doing row-by-row processing, they can add up to account for a significant fraction of the time your code is spending. When you use bulk

How to send a multiple emails at a time in cakephp

二次信任 提交于 2019-11-28 04:42:29
问题 I need to send multiple emails at a time, can any one have example? or any idea ? I need to send mail to all my site users at a time (Mail content is same for all) Currently i using following code in a for loop $this->Email->from = '<no-reply@noreply.com>'; $this->Email->to = $email; $this->Email->subject = $subject ; $this->Email->sendAs = 'html'; 回答1: I think you have 2 possibilities: foreach Let's assume you have a function mail_users within your UsersController function mail_users(

Add multiple users to multiple groups from one import csv

只谈情不闲聊 提交于 2019-11-28 04:36:40
问题 I have a csv with 2 columns, one column is AD group names and one is user account names. I am trying to read the csv and import the users into their corresponding group. Here is what i have to so far. It's saying both arguments(identity,member) are null, which makes no sense since the headers are correctly specified. import-module activedirectory $list = import-csv "C:\Scripts\Import Bulk Users into bulk groups\bulkgroups3.csv" Foreach($user in $list){ add-adgroupmember -identity $_.Group

Sybase JConnect: ENABLE_BULK_LOAD usage

白昼怎懂夜的黑 提交于 2019-11-27 21:57:16
问题 Can anyone out there provide an example of bulk inserts via JConnect (with ENABLE_BULK_LOAD ) to Sybase ASE? I've scoured the internet and found nothing. 回答1: I got in touch with one of the engineers at Sybase and they provided me a code sample. So, I get to answer my own question. Basically here is a rundown, as the code sample is pretty large... This assumes a lot of pre initialized variables, but otherwise it would be a few hundred lines. Anyone interested should get the idea. This can

MySQL bulk INSERT or UPDATE

时光总嘲笑我的痴心妄想 提交于 2019-11-27 07:26:34
Is there any way of performing in bulk a query like INSERT OR UPDATE on the MySQL server? INSERT IGNORE ... won't work, because if the field already exists, it will simply ignore it and not insert anything. REPLACE ... won't work, because if the field already exists, it will first DELETE it and then INSERT it again, rather than updating it. INSERT ... ON DUPLICATE KEY UPDATE will work, but it can't be used in bulk. So I'd like to know if there's any command like INSERT ... ON DUPLICATE KEY UPDATE that can be issued in bulk (more than one row at the same time). You can insert/update multiple

Override django's model delete method for bulk deletion

戏子无情 提交于 2019-11-27 01:37:33
问题 I'm overriding Django's model delete method in order to delete orphan files in the disk for image fields, something like this: class Image(models.Model): img = models.ImageField(upload_to=get_image_path) ... def delete(self, *args, **kwargs): self.img.delete() super(Image, self).delete(*args, **kwargs) This works fine when I delete single objects from the admin, but when I select multiple objects and delete them, this doesn't seem to get called. I have been googling for a while but haven't

Bulk update mysql with where statement

烈酒焚心 提交于 2019-11-27 01:22:39
问题 How to update mysql data in bulk ? How to define something like this : UPDATE `table` WHERE `column1` = somevalues SET `column2` = othervalues with somevalues like : VALUES ('160009'), ('160010'), ('160011'); and othervalues : VALUES ('val1'), ('val2'), ('val3'); maybe it's impossible with mysql ? a php script ? 回答1: The easiest solution in your case is to use ON DUPLICATE KEY UPDATE construction. It works really fast, and does the job in easy way. INSERT into `table` (id, fruit) VALUES (1,