insert

MySQL Multi-Insert? MySQL DB integrity after failed INSERT

Is it possible to insert a row into multiple tables at once? If you do several tables related by an ID; what is the best way to ensure integrity is maintained in case an INSERT fails? ...

how to inject a string in an html fragment

I would like to insert a read more html bit at a certain position in an html fragment - say after the 10th word. I will then, via javacript, hide the text after the "read more" and only show it on click. The javascript part is ok. As to the php part... It seemed simple at first - but the problem is that tags mess up the word count and...

Insert and select from a table/array in oracle

Hi everyone, I have a pretty big sql statement which returns a list of id's. I need this id-list as base for other statements. Like this: open crs_result1 for ' select * from ... where id in ( select <ids> from <base_statement> ) '; open crs_result2 for ' select * from ... where id in ( select <ids> from <base_statement> ) '; open crs_...

How to insert record to an association table with PRADO ActiveRecord?

Hi! I have 2 many-to-many tables and 1 association table for them: 1. Student StudentID (PK) 2. NextOfKin NextOfKin (PK) 3. StudentNextOfKin StudentID, NextOfKinID (PK) FK StudentID References Student(StudentID) FK NextOfKinID References NextOfKin(NextOfKinID) With the following codes, i am able to create a new NextOfKin record in D...

Flex 4 RichTextEditor Insert Image Functionality

Hello! How can I make it so that the RichTextEditor from Flex can add images? I'm not talking about the upload process, but rather then way I can insert images into the textarea. Thanks! ...

Android: Insert text into EditText at current position

I want to insert a constant string into an EditText by the press of a button. The string should be inserted at the current position in the EditText. If I use EditText.append the text gets inserted at the end of the EditText. How can I do that? I couldn't find a suitable method. ...

std::inserter with set - insert to begin() or end()?

I have some code that looks like this: std::set<int> s1, s2, out; // ... s1 and s2 are populated ... std::set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(), std::inserter(out, out.end())); I've read inserts can be done in amortized constant time if the value being inserted to the...

app explosion with conflicting sql primary key

I have a table in a database where the _id column is the primary key. If I try to do an insert into this table using an _id that already exists, my application crashes. How can I do this? Is there a specific kind of Exception I can eat? I've tried SQLiteException to no avail. ...

Is there a faster way to read from a file and insert into SQLite.

Afternoon everyone. I'm not that familiar with SQLite so I haven't messed with all of the settings of the database. I'm rather familiar with SQL Server, Oracle and even some Access and mySQL. Well, currently, I'm taking a file with 110,000+ records and reading the file line by line, parsing the data and running an insert statement to ...

For insert-performance consideration, should a clustered index on a timestamp be ascending or descending?

I just realized I have a clustered index on a Timestamp in descending order. I'm thinking about switching it to ascending, so that as new, ever-increasing timestamps are inserted, they are added to the end of the table. As it stands now, I suspect it has to add rows to the beginning of the table, and I wonder how SQL Server handles tha...

Progress mysql synchronisation

The situation: 1 Progess DB server running on Unix 1 MySQL DB server running on Ubuntu The Progress database has to be synced every night with the MySQL DB. We figured this could be done via a PHP sync script. The script connects to Progress via an ODBC driver, fetches the table and the php scripts runs through every row and formats th...

axapta table insert / update

hi folks, and once again an axapta-question ( running on ax 2009 and sql-server 2008 r2 ): which is exactly the point of time, when inserted or updated datasets are stored in the regarding database? the aim is to call a stored procedure on the sql-server which transfers data from the ax-tables ( eg inventtable ) to another ( not genera...

How to do a massive insert

I have an application in which I have to insert in a database, with SQL Server 2008, in groups of N tuples and all the tuples have to be inserted to be a success insert, my question is how I insert these tuples and in the case that someone of this fail, I do a rollback to eliminate all the tuples than was inserted correctly. Thanks ...

How would I know when to insert, delete or update based off a C# list?

Let's say that I have three tables "Person", "Area", and "Person_Area". Each person can work in many areas and each area can have many people in them. "person_Area" is a bridge table that contains person_id and area_id In my code I have two asp list boxes located on a person form. List box one contains all available areas and list b...

How to fast fill MS Sql 2005 wit data in c#

I crate temporary table in c# (one column, type int), later I want to put ~40 000 values inside (it will be constantly changing). What is the fastest way of doing it ? ...

How to insert an object to a map structure by a certain field?

Hello, i have an object - Employee, and i want to know how to insert this object to a map structure sorted by char* lastName field. Thanx. My map need to contain pointers to Employee objects not the objects themselves. the key is the last name of the employee, the map need to be sorted by the employees last name, should i use multimap? ...

MySQL Insert syntax error - Cant find it!

There's gotta be something small I keep missing here, but I can't find it for the life of me. $insert = mysql_query("INSERT INTO USERS (`FBID`, `FIRST_NAME`, `LAST_NAME`, `GENDER`) VALUES ('$fbid', '$firstName', '$lastName', '$gender')"); The error is: Error: You have an error in your SQL syntax; check the manual that correspon...

SQLite - INSERT IF NOT EXISTS ELSE UPDATE ??

Hi. I've found a few "would be" solutions for the classic "How do I insert a new record or update one if it already exists" but I cannot get any of them to work in SQLite. I have a table defined as follows: CREATE TABLE Book ID INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(60) UNIQUE, TypeID INTEGER, Level INTEGER, Seen INT...

Fastest data structure for inserting/sorting

I need a data structure that can insert elements and sort itself as quickly as possible. I will be inserting a lot more than sorting. Deleting is not much of a concern and nethier is space. My specific implementation will additionally store nodes in an array, so lookup will be O(1), i.e. you don't have to worry about it. ...

Scripting large tables to .sql file

Don't ask me why, but I have to migrate a database from 2008 to 2005. This is not an issue of itself, but I have a very large table. When I script the tables contents (using Generate Scripts), the .sql file made is over 4gb. This is more memory than the server has available in RAM. Is there anyway to generate insert commands that split...