insert

How do I Prevent FormView from clearing user's entered Values after Insert Method has fired?

I have been struggling with getting FormViews to work the way Microsoft expects me to for about a day and have figure a bunch of great stuff out. I can catch e.Exception and e.ReturnValue in the ObjectDataSource.Inserting Event Handler and I can even cheat and check other properties of the Object in the ObjectDataSource.ObjectDisposing ...

Inner join in Insert query ?

I wanna do something like this: insert into TableA (val1,val2) values ("value",(select top 1 tableB.X from tableB where tableB.Y=@Y)) I get this error: Subqueries are not allowed in this context. Only scalar expressions are allowed How to stop that error? ...

NHibernate Insert Ignore

Hello, I need use Insert Ignore for my table, which have Unique index on several fields. How can i do it? Thank you ...

How to add a where clause in a MySQL Insert statement?

This doesn't work: INSERT INTO users (username, password) VALUES ("Jack","123") WHERE id='1'; Any ideas how to narrow insertion to a particular row by id? ...

Identifying who makes a lot of INSERT requests in MySQL

Hello. Recently, I noticed that my MySQL server processes a lot of INSERT's. How can I detect user or DB on which is this activivty?? insert 33 k 97.96 k 44.21% ...

MySQL: How to handle regular high volume of inserts/updates?

Hi, I have table where I track various statistics about site usage. Once a week, I plan to use these statistics and information from other tables to calculate various key indicators for use in multiple reports. This is in order not to have compute the complex data each time a report is accessed. These indicators will be stored in a sepa...

Is a simple MySql Database possible?

Steps: I want a registered user to be able to insert values into a table. Those values would only be able to be seen or edited by the user. (a few rows) I have a registration/login page and insert form page complete and they can add do their respective jobs. Here's the problem and i realize it probably a super simple answer: How d...

Mysql: simulatenous insertion

Hello, I have a problem when using foreign keys and primary keys in MySQL datable. Now I have two tables p1,p2. create table p1( id int(10) not null auto_increment, type_id int(10) default 1, name varchar(20), primary key(id, type_id) ); create table p2( id int(10) not null, type_id int(10) not null, ...

Problem with inserting using linq-to-entities

Hi I'm having trouble solving this error. Any help on the problem would be much appreciated, thanks! Error message: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries. Whenever I try to add a Lapt...

Insert 2 Variables into a C++ STL Multimap

Hello all, I'm having some trouble trying to read in a file that consists of two columns. The first column is a document ID # (int) and the second (separated by whitespace) is the word itself (string). What I'm doing is reading it into a vector, then going through the vector and using even/odd mod, assigning the respective variables thei...

UITableView insertRowAtIndexPaths then scrollToRowAtIndexPath draws cell twice

Hi I'm inserting a new cell into my table that I know will not be visible (I know it's off the bottom of the screen), so I then call scrollToRowAtIndexPath, e.g. [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:myIndexPath] withRowAnimation:UITableViewRowAnimationBottom]; [tableView scrollToRowAtIndexPath:myIndexPath atScroll...

Is 20K reads going to make INSERTing into my table slow? How about a foreign key failure?

It's taking 10 - 11 seconds sometimes to INSERT into my table which has under a dozen records. I'm getting the following in my database's InnoDB status: 0.29 inserts/s, 0.03 updates/s, 0.09 deletes/s, 20365.73 reads/s. 20.37K reads/s Seems like a lot--do you agree? I'm not sure the 20K reads is all the same table, but it's quite poss...

Is there a way to conditionally use default column values in an INSERT..SELECT statement?

I've got code similar to the following in a stored procedure that inserts a row into a table, I'd like to set the last column (FieldD) to @prmSomeValue unless it is null, otherwise just use the default value defined for that column. IF (@prmSomeValue IS NULL) INSERT INTO MyTable (fieldA,FieldB,FieldC) SELECT A,B,C FRO...

Will using the php function "insert into" create new columns if they aren't already defined, or return an error?

I'd like to use a foreach loop to insert a _POST associative array into a database using INSERT INTO. What I need to know, is if my _POST data contains keys that don't match the columns of my database, will INSERT INTO simply create these columns in the database? if not, will it return an error and not update my database at all? or wil...

Inserting html code in a mysql table

Hi everyone... I use joomla to manage a website... and i am developing a stand alone php application that will insert and modify data into the tables that are used by joomla to store the html of webpages that it dynamically creates... The way it works is i use a joomla component to create content and the html code of these articles ar...

SQL Server Hanging after Insert Into Select

Thanks for taking a look at this. The issue has to do with the following sql query. Basically it recursively finds all pages underneath a certain page(master page), and then applies the master page's categories(looked up in the xref_pages_categories) to all of those pages. Upon running the insert, querying the table for data that shoul...

Can i insert Bytecode inside my source code?

Can i write bytecode inside a method of a class so that the compiler bypasses that part since it is already compiled. Something similar to writing assembly programs in C language using "asm"... ...

Mysql query select case when true insert

does anybody know how to do this syntax below in mysql? without Stored Procedure and in single query only SELECT CASE WHEN COUNT(v.value) = 0 THEN ( INSERT INTO tbl_v (fid, uid, VALUE) SELECT fid, 1 AS uid, 'xxxxxx' AS VALUE FROM tbl_f WHERE category = 'categoryname' AND NAME = 'somevalue' )WHEN v.value <> 'test' THEN ( 'u...

Cannot Insert into MySQL DB Value of Radio Button as String

Language: OO PHP 5+ DB: MySQL I am trying to insert data from a form using radio buttons by getting their value and then inserting into a MySQL database. I can insert anything on the form that uses a textfield to collect data, but when I try to insert the value of a radio button the insert just leaves the corresponding db field blank. I...

PHP mysterious extra DB insertions

I decided that I would like to track the searches that users are making on my site, so I created a MySQL table called 'Searches' with a few simple fields, and a model (class) to facilitate the insertion and management of the saved searches. The model function that saves the search is: public function create() { $q = $this->db->quer...