insert

Need help INSERT record(s) MySQL DB

I have an online form which collects member(s) information and stores it into a very long MySQL database. We allow up to 16 members to enroll at a single time and originally structured the DB to allow such. For example: If 1 Member enrolls, his personal information (first name, last name, address, phone, email) are stored on a single r...

Why is it inserting 0's instead of blank spaces into my DB using php?

I have an insert: $sql = 'INSERT into orders SET fax_int_prefix = "'.$_SESSION['fax_int_prefix'].'", fax_prefix = "'.$_SESSION['fax_prefix'].'", fax_first = "'.$_SESSION['fax_first'].'", fax_last = "'.$_SESSION['fax_last']; The value of all of these fields is that they are blank right before the insert. Here is an example of one o...

How to insert null value for numeric field of a datatable in c#?

Consider My dynamically generated datatable contains the following fileds Id,Name,Mob1,Mob2 If my datatable has this it get inserted successfully, Id Name Mob1 Mob2 1 acp 9994564564 9568848526 But when it is like this it gets failed saying, Id Name Mob1 Mob2 1 acp 9994564564 The given value of type String from...

MYSQL Fast Insert dependent on flag from a seperate table

Hi all. For work I'm dealing with a large database (160 million + rows a year, 10 years of data) and have a quandary; A large percentage of the data we upload is null data and I'd like to stop it from being uploaded. The data in question is spatial in nature, so I have one table like so: idLocations (Auto-increment int, PK) X (float) ...

How do I get all the ids of the row created by one multiple row insert statement.

Hi All. I'm new to php. So, please forgive me if this seems like a dumb question. Say i have a MySQL insert statement insert into table (a,b) values (1,2),(3,4),(5,6). table 'table' has a auto increment field called 'id'. how can I retrieve all the ids created by the insert statement above? It will be great if i get an example that u...

postgresql multiple insert with select query

Hi guys, i need to perform a insert query for multiple rows whereby the first column is a numeric and identical value and the second values are queried from another table. something like insert into table (33, select col2 from another_table); can this be accomplished with a single statement? ...

SQL Server create a row in Table B for every row in Table A and put the ID in Table A

I know how to create a row in Table B for every row in Table A: INSERT INTO [dbo].[TableB] SELECT 0, 5, 3, [TableAColumn] FROM [dbo].[TableA] But I need to also put the ID of each new TableB row into a column in TableA, and I can't figure out how to do that. [Edit] I forgot to mention that there are 3 TableB IDs referenced to TableA,...

LINQ to SQL INSERT with one to many relationship

I have two tables - Member and Profile with a one to many relationship. I'm trying to insert into the database using LINQ to SQL but am getting a "The INSERT statement conflicted with the FOREIGN KEY constraint" error. FYI: 1. As this is a practice project to learn LINQ to SQL, I've created my entity classes manually. 2. If I generate t...

Beginner Access VBA SQL INSERT Question

Syntax question: I am using the code below to call a query in Access VBA strSQL = "INSERT INTO tblLoanDetails ([ServerName]) VALUES ('Test') WHERE [ID]=3" Call CurrentDb.Execute(strSQL) And i am getting a runtime error of "3067: Query must contain atleast one table or query." the insert statement string looks like this (Threw the var...

Program occasionally stuck when writing to ldap

hey guys, I have 2 databases for my program : mysql and ldap. All transactions happen to mysql, but i need ldap to connect to ip-phones. There's an option to synchronise the ldap database. So when the ldap is brand new, and mysql contains like 200+ records, it may want to update. But when inserting all those entries, it "freezes". It ne...

sql insert error

This is my Insert Statement INSERT INTO ProductStore (ProductID, StoreID, CreatedOn) (SELECT DISTINCT(ProductId), 1, GETDATE() FROM ProductCategory WHERE EXISTS (SELECT StoreID, EntityID FROM EntityStore WHERE EntityType = 'Category' AND ProductCategory.CategoryID = EntityStore.EntityID AND StoreID = 1)) I am trying to Insert into tab...

'ORA-01031: insufficient privileges' error received when inserting into a View

Under the user name 'MY_ADMIN', I have successfully created a table called 'NOTIFICATIONS' and a view called 'V_NOTIFICATIONS'. On the 'V_NOTIFICATIONS' view I have successfully created a trigger and a package that takes what the user attempts to insert into the view and inserts it into the table. The 'V_NOTIFICATIONS' trigger and packag...

How to produce "merge" of two data sets with select SQL statement (Oracle DBMS)?

Hi: What would be the insert SQL statement to merge data from two tables. For example I have events_source_1 table (columns: event_type_id, event_date) and events_source_2 table (same columns) and events_target table (columns: event_type_id, past_event_date nullalbe, future_event_date nullable). Events_source_1 has past events, Events...

NHibernate will not insert a record

I have an application that is now 4+ years old that is exhibiting some odd behavior on our latest deployment. The application uses nHibernate for all inserts / updates / selects, etc. We are currently using .NET 2.0, and nHibernate 1.2 (I know, we need to upgrade) This deployment is on Windows 2008 Server x64, IIS 7.5 - what I have see...

Inserting data using PHP into mysql when it contains a '

Hi there, I am writing lots of info from an XML file into a database. Everything works fine until I come across a field with the ' in the description, that insertion fails with an error Error 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use ...

MS Word page break inserting in wrong place

I am creating a MS Word document entirely through C# in VS 2008. I am trying to insert a page break, and when the page break is inserted, instead of inserting it and adding a new page at the bottom, it is inserting a break and adding a page at the top. This results in the first page being the last page. Here is the code for inserting ...

How to insert PHP script into HTML the best way?

Hello, I have to insert full path to every single image/css file of my website, because of url_rewriting and I'm looking for the most officiant way to do it. Of course I could do: <img src='<?php echo $full_path; ?>/images/theImg.jpg' alt='alternative text' /> But somewhere I saw people doing it like this, or something: <img src='{...

Can I select a set of rows from a table and directly insert that into a table or the same table in SQL?

Hi all I was just curious if I could do something like - insert into Employee ( Select * from Employee where EmployeeId=1) I just felt the need to do this a lot of times...so just was curious if there was any way to achieve it.. ...

insert ... select with divide operator in select errors?

Hi, the following query CREATE TABLE IF NOT EXISTS XY ( x INT NOT NULL , y FLOAT NULL , PRIMARY KEY(x) ) INSERT INTO XY (x,y) (select 1 as x ,(1/7) as y); errors with Error code 1064, SQL state 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use ne...

Loading large amounts of data to an Oracle SQL Database

Hey all, I was wondering if anyone had any experience with what I am about to embark on. I have several csv files which are all around a GB or so in size and I need to load them into a an oracle database. While most of my work after loading will be read-only I will need to load updates from time to time. Basically I just need a good ...