insert

Ignore Postgresql batch insert errors

Assume this simple SQL query: INSERT INTO table (col1,col2) VALUES (val1,val2),(val3,val4),(val5,val6); Lets say val3 is invalid value for col1. This would cause psql to abort whole INSERT command - it would not insert (val1,val2) nor (val5,val6) either. Is it possible to make postgresql ignore this error so it does not insert (val3...

jQuery inserting element .before() and .after() does not work as expected, what am I doing wrong?

I am trying to dynamically surround sets of IMG and A tags with a div tag but am unable to make it work. my html: <img class="myClass-1" src="img5" /> <a class="myClass-2" href="url"></a> my script: $('img.myClass-1').each(function(){ $(this).before('<div style="position: relative;">'); $(this).next().after('</div>'); ...

SQL Server, can't insert null into primary key field?

I'm about ready to rip my hair out on this one. I'm fairly new to MS SQL, and haven't seen a similar post anywhere. When I try to do a statement like this: INSERT INTO qcRawMatTestCharacteristic VALUES(NULL, 1,1,1,1,1,1,1,'','','', GETDATE(), 1) I get the following: Cannot insert the value NULL into column 'iRawMatTestCharacte...

Command to get identity of newly inserted record in Interbase 2007

In Interbase (I'm using 2007, I don't know if it matters) is there a command to get the identity of a newly-inserted record, similar to SCOPE_IDENTITY() in SQL Server? ...

hot to date indide paramter in xml

Hi Guys, i made this code for inserting data to an system mail that know to work with xml file. the problem is that i try to create some javascript code for getting the current date of day, and then put it inside the filed date, but without success. i know hot create the date in javascript, my problem is in thx xml file, i mean how ca...

Get SQL Insert to work when PK is supplied or NOT.

Hi All I have the following stored procedure: ALTER Procedure dbo.APPL_ServerEnvironmentInsert ( @ServerEnvironmentName varchar(50), @ServerEnvironmentDescription varchar(1000), @UserCreatedId uniqueidentifier, @ServerEnvironmentId uniqueidentifier OUTPUT ) WITH RECOMPILE AS -- Stores the ServerEnvironmentId. DE...

Inserting html with jquery doesn't work

I'm building a simple shoutbox. Here's the html : <div id="shoutbox"> <form method="post" id="form" class="shoutbox-form"> <table> <tr> <td><label>User</label></td> <td><input class="text user" id="nick" type="text" MAXLENGTH="25" /></td> </tr> <tr> ...

Help to Simplify SQL Insert which uses NEWSEQUNETIALID() column default

Hi All I have the following insert stored procedure: CREATE Procedure dbo.APPL_ServerEnvironmentInsert ( @ServerEnvironmentName varchar(50), @ServerEnvironmentDescription varchar(1000), @UserCreatedId uniqueidentifier, @ServerEnvironmentId uniqueidentifier OUTPUT ) WITH RECOMPILE AS -- Stores the ServerEnvironmentId...

Zend Framwork Database Insert Issue

Hi, I'm starting out using the Zend Framework and have created a suitable model which saves data back to a database table. The issue I am having is that the sql statement is trying to insert '?' as the value for each column in the database. I have created the following save function which passes an array of data to the DBtable adapter...

How do I insert a new record into a nested child GridView in ASP.NET & VB?

I have a 2 tiered nested GridView in ASP.NET and I'm trying to insert a new record into the child GridView. I am able to Add/Remove/Edit records in the parent table but the child table is connected to my SQL database through the code-behind, so I am unable to use the SqlDataSource control like with the parent table. I have searched aro...

prevent insert while select query, hibernate

Hi, new to hibernate. I have a problem that when i am trying to run select query say "from Foo where Foo.some_id=2" (with hibernate template) then hibernate is also tries to insert the records in a table 'Foo2' that has a one-2-one association with the Foo table Bean Foo class Foo{ int id; .... Foo2 foo2; } Foo.hbm.xml ... <one...

How to insert values into an MYSQL-Table by using Select-Statements

Okay, This one is pretty simmilar to my last one, but I don't get it...! I am trying the following: Insert into table b (Select column_1 from table_a where ID = 1), (Select column_2 from table_a where ID = 1), 0, (Select column_3 from table_a where ID = 1); But I always get a syntax-error...! I think it's quite logical what I...

ASP.Net master/detail w/Databinding to DataSource objects - multi-insert with all-or-nothing principals

My goal is to allow the user to enter order header and detail data and have it all save with a single button click, in one transaction so the save is all or nothing. For example: Tables: OrderHeader: Id, CustomerId, Comments, OrderDate, OrderLine Id, OrderId FK => OrderHeader Produ...

Android 2.1 Insert contact problem

Hi! I am working on a contact import for Android 2.1. The following snippet is wokring: Intent in=new Intent(Intent.ACTION_INSERT, ContactsContract.Contacts.CONTENT_URI); in.putExtra(Insert.NAME, "Mark Maier"); in.putExtra(Insert.PHONE, "1234567"); in.putExtra(Insert.PHONE_TYPE, CommonDataKinds.Phone.TYPE_FAX_WORK); startActivity(in); ...

Get Id after an INSERT in SQL Server in a multithread enviromment ?

How can I get id after an INSERT in SQL Server ? For my insert, I use context.ExecuteStoreCommand() Warning: I have a multi-threaded application which inserts "at the same time" some data in the same table. ...

oracle trigger not recognizing insert

I am working on a system using Oracle DB. An ETL tool (ODI) put the following trigger on a table to enable changed data capture (CDC). create or replace trigger SCHEMA.T$TABLE_NAME after insert or update or delete on SCHEMA.TABLE_NAME for each row declare V_FLAG VARCHAR(1); V_ROW_ID VARCHAR2(60); begin if updating then ...

Bug in Programming Interviews Exposed: Linked Lists

Hello, I was going through the Programming Interviews Exposed book. There's a code given for inserting an element at the front of linked lists. bool insertInFront( IntElement **head, int data ){ IntElement *newElem = new IntElement; if( !newElem ) return false; newElem->data = data; *head = newElem; return true; } ...

How can I insert a custom field and the fields value via mysql

Hello guys, Alright here is the problem... we have posts that are missing a custom field. We just recently received the values for that field. Is there a way via phpmyadmin to insert in to the table post_meta a custom field named "translation" and then the value for each post already published? I am trying to avoid having to go back t...

Generate script Insert in .net

Hi all, I have problem when trying generate script insert with specific condition. So far I am already trying this step. Add references Microsoft.SqlServer.ConnectionInfo and Microsoft.SqlServer.Smo Add reference in code Microsoft.SqlServer.Management.Smo Add this to script. var srv = new Server(@"localhost\SQLEXPRESS"); var db ...

mysql insert command with a where clause

im trying to insert data into a particular row in the database, but i mysql is saying this is an error: INSERT INTO user (rep, course) VALUES('5', 'computer science') WHERE user='2' ...