Tutorial by Examples: bulk

for a large number of files which may need to be operated on in a similar process and with well structured file names. firstly a vector of the file names to be accessed must be created, there are multiple options for this: Creating the vector manually with paste0() files <- paste0("f...
Let's assume that we want to remove 2 upvotes from all the articles of the author with id 51. Doing this only with Python would execute N queries (N being the number of articles in the queryset): for article in Article.objects.filter(author_id=51): article.upvotes -= 2 article.save() ...
If you do row-by-row processing in Salesforce, you'll probably reach the governor limit quickly. This is especially true with triggers and things that fire when you don't expect them. One documented method of escaping the governor limit is bulkification. Note: The following information is based on ...
Here is an example of inserting large chunks of data at once. All the data you want to insert is gathered inside of a ContentValues array. @Override public int bulkInsert(Uri uri, ContentValues[] values) { int count = 0; String table = null; int uriType = IChatContract.MessageColu...
Usually the case when one wants to change a field type to another, for instance the original collection may have "numerical" or "date" fields saved as strings: { "name": "Alice", "salary": "57871", "dob": "198...
This sample uses a ToDataReader method described here Creating a Generic List DataReader for SqlBulkCopy. This can also be done using non-async methods. public class Widget { public int WidgetId {get;set;} public string Name {get;set;} public int Quantity {get;set;} } public as...
This sample uses a ToDataReader method described here Creating a Generic List DataReader for SqlBulkCopy. This can also be done using async methods. public class Widget { public int WidgetId {get;set;} public string Name {get;set;} public int Quantity {get;set;} } public void A...
local collections are not allowed in select statements. Hence the first step is to create a schema level collection. If the collection is not schema level and being used in SELECT statements then it would cause "PLS-00642: local collection types not allowed in SQL statements" CREATE OR R...
When updating multiple rows with different values it is much quicker to use a bulk update. UPDATE people SET name = (CASE id WHEN 1 THEN 'Karl' WHEN 2 THEN 'Tom' WHEN 3 THEN 'Mary' END) WHERE id IN (1,2,3); By bulk updating only one query can be sent to the ser...
You can customize parsing rules using different options in WITH clause: BULK INSERT People FROM 'f:\orders\people.csv' WITH ( CODEPAGE = '65001', FIELDTERMINATOR =',', ROWTERMINATOR ='\n' ); In this example, CODEPAGE specifies that a source file in UTF-8 f...
BULK INSERT command can be used to import file into SQL Server: BULK INSERT People FROM 'f:\orders\people.csv' BULK INSERT command will map columns in files with columns in target table.
You can read content of file using OPENROWSET(BULK) function and store content in some table: INSERT INTO myTable(content) SELECT BulkColumn FROM OPENROWSET(BULK N'C:\Text1.txt', SINGLE_BLOB) AS Document; SINGLE_BLOB option will read entire content from a file as single cell. ...
Yu can define format of the file that will be imported using FORMATFILE option: INSERT INTO mytable SELECT a.* FROM OPENROWSET(BULK 'c:\test\values.txt', FORMATFILE = 'c:\test\values.fmt') AS a; The format file, format_file.fmt, describes the columns in values.txt: 9.0 2 1 SQ...
You can use OPENROWSET to read content of file and pass it to some other function that will parse results. The following example shows hot to read entire content of JSON file using OPENROWSET(BULK) and then provide BulkColumn to OPENJSON function that will parse JSON and return columns: SELECT boo...
This example demonstrate how to dynamically insert data into MySQL using Python Scrapy. You do not need to edit pipelines.py file for any project. This example can be used for all your project. Just yield you_data_dictionary from your Spider and inside pipelines.py a query will be created automat...

Page 1 of 1