insert

What's the best moment to commit to the DB a row inserted to the DataGridView control?

What's the best moment to commit to the DB a row inserted to the DataGridView control? ...

sql stored procedure in visual studio 2008

I want to write stored procedure in visual studio that as a parameter recieves the name of project and runs in database TT and copies data from TT.dbo.LCTemp (where the LC is the name of the project recieved as a parameter) table to "TT.dbo.Points" table. both tables have 3 columns: PT_ID, Projectname and DateCreated I think I have writ...

mysqli and inner join

hello i have problems with this script, i select from 2 tabels but i dont know how to bind the result i get this error Fatal error: Call to a member function bind_result() on a non-object this is my code http://pastebin.com/5sShTSMC Thanks ...

Comparison to insert into query is better

Which one of below query has better performance? What's the upside/downside for both query? I want to discuss the scenario for inserting 1000 rows and 100k rows Thanks. 1st INSERT INTO table_name (col1,col2) VALUES (value1, value2); INSERT INTO table_name (col1,col2) VALUES (value3, value4); 2nd INSERT INTO table_name SELECT (col1,c...

IStatelessSession insert object with many-to-one

Hello guys. I've got common mapping <class name="NotSyncPrice, Portal.Core" table='Not_sync_price'> <id name="Id" unsaved-value="0"> <column name="id" not-null="true"/> <generator class="native"/> </id> <many-to-one name="City" class="Clients.Core.Domains.City, Clients.Core" column="city_id" cascade="none"></many-to-one...

How call stored procedure to insert value in a table

Hi Please provide me sample code for inserting values in a table using stored procedure in NHibernate. Regards Jcreddy ...

In SQL Server, how can I insert data into a table that has just one column which is of identity type?

In SQL Server, how can I insert data into a table that has just one column which is of identity type? Such as insert into the following table t. How can I write the insert statement? CREATE TABLE t ( id INT IDENTITY(1, 1) PRIMARY KEY ) Great thanks. ...

Insert using stored procedure from nhibernate

Hi I am using the following code snippets to insert values using stored procedure. the code is executing successfully but no record is inserted in DB. Please suggest with simple example. **---- stored procedure--------** Create PROCEDURE [dbo].[SampleInsert] @id int, @name varchar(50) AS BEGIN insert into test (id, name) val...

Inserting records in Mysql with INSERT IGNORE and NULL values

I have a partitioned table InnoDB with several fields. I'm trying to avoid duplicates on insert. Let's say: Field1 int null Field2 int null Field3 int null Field4 int null Field5 int null I have created a UNIQUE index on those fields. I try to insert some records with NULL values and then try to reinsert them with IGNORE feature on ...

MySQL Inserting into locked aliased table

I am trying to insert data into a InnoDB MySQL table which is locked using an alias and I cannot for the life of me get it to work! The following works: LOCK TABLES Problems p1 WRITE, Problems p2 WRITE, Server READ; SELECT * FROM Problems p1; UNLOCK TABLES; But try and do an insert and it doesn't work (it claims there is a syntax err...

complicated inserts

I have to do something like this insert into object (name, value, first_node) values ('some_name', 123, 0) @id = mysql_last_insert_id() insert nodes (name, object_id) values ('node_name',@id) @id2 = mysql_last_insert_id() update object set first_node=@id2 where id=@id Is it possible to make it simpler? What if I want to insert more pa...

insert value of one col to another on inserting

hi, i want to insert value of one col to another on inserting new row in sql. how do i? there is any way to do this by default value(constraint)? ...

Add new row in a databound form with a Oracle Sequence as the primary key

I am connecting C# with Oracle 11g. I have a DataTable which i fill using an Oracle Data Adapter. OracleDataAdapter da; DataTable dt = new DataTable(); da = new OracleDataAdapter("SELECT * FROM Author", con); da.Fill(dt); I have few text boxes that I have databound to various rows in the data table. txtAuthorID.DataBindings.Add("Tex...

MySQL INSERT IGNORE not working

Here's my table with some sample data a_id | b_id ------------ 1 225 2 494 3 589 When I run this query INSERT IGNORE INTO table_name (a_id, b_id) VALUES ('4', '230') ('2', '494') It inserts both those rows when it's supposed to ignore the second value pair (2, 494) No indexes defined, neither of those columns are pr...

SQL Query for inserting multi column values in to single column

I have Table "MultiCol" as below Name LibraryID RegisterID EngineerID Rahul 1002 4521 4854 Ajay 5072 3151 4833 Vimal 4532 4531 4354 I want to insert the Rahul's all IDs in the "SingleCol" table(shown below) which is having only one Column named "IDS" So I want the Result as shown below Table "Single...

Inserting new argument to table through search form of another table

In my database I have a form for searching products (fields : id, name, manufacturer_id[set to display manufacturer's name], category_id, price). I would like to have the ability of adding manufacturers through this form. So I've created vba script but it does not work. Still when I enter new name it gives me prompt to "Select element fr...

dynamically insert new rows in the table (JavaScript) ?

<script type="text/javascript" language="javascript"> function addNewRow() { var table = document.getElementById("table1"); var tr = table.insertRow(); var td = tr.insertCell(); td.innerHTML= "a"; td = tr.insertCell(); td.innerHTML= "b"; td = tr.insertCell(); td.innerHTML= "c"; td = tr.insertCell(...

PHP connecting Oracle and mySQL

I' trying to get some data from Oracle via ODBC to mySQL database. And then Insert some lines in mySQL database. I manage to list the lines from ORACLE but fail to Insert into mySQL. $time_start = microtime(true); set_time_limit(10000); //ligação ODBC ORACLE $connect = odbc_connect("acatex32", "acatex", "acatex"); $query = "select b...

Mysql insert into 2 tables

I want to make a insert into 2 tables visits: visit_id int | card_id int registration: registration_id int | type enum('in','out') | timestamp int | visit_id int i want something like: INSERT INTO `visits` as v ,`registration` as v (v.`visit_id`,v.`card_id`,r.`registration_id`, r.`type`, r.`timestamp`, r.`visit_id`) VALUES (NU...

Inserting THEAD element into embedded HTML using jQuery

I'm trying to use jQuery to insert HTML into a table element. I've been messing variations of the selector (below) with no luck. Can someone help me? My Selector: $j('#ctl00_body_gridData_dom').children('table:first').append("<thead><tr><td colspan='6'>&nbsp;</td><td align='center' colspan='7'>EM SPECS</td><td align='center' colspan=...