473,394 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

generic insert into table

please CC me, I am on digest
---------------------------------
I have the following code from an application that is 'mysql_centric'. I
want to make it generic across all databases, if it's possible,
especially postgres :-)

mysql version:
INSERT INTO calendar_setting SET setting='colorEvent',value='#C2DCD5';

There is no data in this table at this time.
Isn't this the same as:
INSERT INTO calendar_setting( 'colorEvent' ) VALUES ( '#C2DCD5');

would this work on all db's?

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #1
6 1814
On 7-6-2004 23:29, Dennis Gearon wrote:
please CC me, I am on digest
---------------------------------
I have the following code from an application that is 'mysql_centric'. I
want to make it generic across all databases, if it's possible,
especially postgres :-)

mysql version:
INSERT INTO calendar_setting SET setting='colorEvent',value='#C2DCD5';

There is no data in this table at this time.
Isn't this the same as:
INSERT INTO calendar_setting( 'colorEvent' ) VALUES ( '#C2DCD5');

would this work on all db's?


Afaik your first example is equal to:
INSERT INTO calendar_setting( setting, value) VALUES ('colorEvent',
'#C2DCD5');

Your first example isn't really SQL-standard and you'd perhaps better
try using SQL-standard stuff as much as possible on MySQL aswell. The
INSERT ... SET-version of INSERT wouldn't be my version to use.

Best regards,

Arjen
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2
On 7-6-2004 23:29, Dennis Gearon wrote:
please CC me, I am on digest
---------------------------------
I have the following code from an application that is 'mysql_centric'. I
want to make it generic across all databases, if it's possible,
especially postgres :-)

mysql version:
INSERT INTO calendar_setting SET setting='colorEvent',value='#C2DCD5';

There is no data in this table at this time.
Isn't this the same as:
INSERT INTO calendar_setting( 'colorEvent' ) VALUES ( '#C2DCD5');

would this work on all db's?


Afaik your first example is equal to:
INSERT INTO calendar_setting( setting, value) VALUES ('colorEvent',
'#C2DCD5');

Your first example isn't really SQL-standard and you'd perhaps better
try using SQL-standard stuff as much as possible on MySQL aswell. The
INSERT ... SET-version of INSERT wouldn't be my version to use.

Best regards,

Arjen
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #3
On Mon, Jun 07, 2004 at 02:29:33PM -0700, Dennis Gearon wrote:
I have the following code from an application that is 'mysql_centric'. I
want to make it generic across all databases, if it's possible,
especially postgres :-)

mysql version:
INSERT INTO calendar_setting SET setting='colorEvent',value='#C2DCD5';


That would be

INSERT into calendar_setting (setting, value)
VALUES ('colorEvent', '#C2DCD5');

This is the standard syntax, which is not quite the same thing as
saying it will work on all DBs - it will certainly work on both
Postgres and MySQL.

Richard

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #4
On Mon, Jun 07, 2004 at 02:29:33PM -0700, Dennis Gearon wrote:
I have the following code from an application that is 'mysql_centric'. I
want to make it generic across all databases, if it's possible,
especially postgres :-)

mysql version:
INSERT INTO calendar_setting SET setting='colorEvent',value='#C2DCD5';


That would be

INSERT into calendar_setting (setting, value)
VALUES ('colorEvent', '#C2DCD5');

This is the standard syntax, which is not quite the same thing as
saying it will work on all DBs - it will certainly work on both
Postgres and MySQL.

Richard

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #5
On Mon, 2004-06-07 at 15:29, Dennis Gearon wrote:
please CC me, I am on digest
---------------------------------
I have the following code from an application that is 'mysql_centric'. I
want to make it generic across all databases, if it's possible,
especially postgres :-)

mysql version:
INSERT INTO calendar_setting SET setting='colorEvent',value='#C2DCD5';
For SQL 92, that's not supported syntax. I don't recall if something
like it got tossed into the latest SQL 03 standard or not.
There is no data in this table at this time.
Isn't this the same as:
INSERT INTO calendar_setting( 'colorEvent' ) VALUES ( '#C2DCD5');
That's the syntax the SQL 92 spec says to use.
would this work on all db's?


Probably not. It's non-standard in the old spec, I don't know about the
new one. If it got in the newest spec then it could probably get
committed pretty easily.


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #6
On Mon, 2004-06-07 at 15:29, Dennis Gearon wrote:
please CC me, I am on digest
---------------------------------
I have the following code from an application that is 'mysql_centric'. I
want to make it generic across all databases, if it's possible,
especially postgres :-)

mysql version:
INSERT INTO calendar_setting SET setting='colorEvent',value='#C2DCD5';
For SQL 92, that's not supported syntax. I don't recall if something
like it got tossed into the latest SQL 03 standard or not.
There is no data in this table at this time.
Isn't this the same as:
INSERT INTO calendar_setting( 'colorEvent' ) VALUES ( '#C2DCD5');
That's the syntax the SQL 92 spec says to use.
would this work on all db's?


Probably not. It's non-standard in the old spec, I don't know about the
new one. If it got in the newest spec then it could probably get
committed pretty easily.


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
1
by: Dotnet Gruven | last post by:
I've posted this in the adonet group, however it was suggested I might have better luck here.... ============================================================= I'm trying to use a typed dataset and...
0
by: Dennis Gearon | last post by:
please CC me, I am on digest --------------------------------- I have the following code from an application that is 'mysql_centric'. I want to make it generic across all databases, if it's...
1
by: tparks69 | last post by:
I get the error: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Insert' that has parameters: last_name, first_name, email, role_id, user_id, modified_by, modified_date...
0
by: Dennis | last post by:
I created a table adapter on an xsd that uses 4 basic stored procedures for select, update, insert, delete. Then I created an aspx page with an object data source that uses the table adapter and a...
3
by: markww | last post by:
Hi, I have a wrapper around some 3rd party database library function. The pseudo code looks like the following - it is meant to open a table in a database, extract values from a table, then copy...
0
by: Srini | last post by:
Hello, I have a Generic List of values which is bound to a GridView List<AppointmentattendeesList = new List<Appointment>(); List<AppointmentOldattendeesList = new List<Appointment>();...
10
by: fig000 | last post by:
HI, I'm new to generics. I've written a simple class to which I'm passing a generic list. I'm able to pass the list and even pass the type of the list so I can use it to traverse it. It's a...
0
by: Cirene | last post by:
Using Visual Studio I created a DataSet using the GUI (XSD file). Trying to use a tiered methodology I called the functions from my BLL. Namespace Zzz.BusinessLogicLayer #Region "DAL Access"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.