Results 1 to 3 of 3
Jan 20, 2005, 12:06 #1
not sure if this insert query is compatible
I'm sure this isn't the best idea but I use Access2000 linked to my postgresl 7.4 database to help me create my queries quickly. Then I move the query and make it work for Dreamweaver MX 2004/PHP. I'm trying to create an append query that will dump multiple records into a table. I'm not sure if this sql is compatible with my setup but here it is:
INSERT INTO tbl95 ( col13, col2, col27, col28, col30, col31, col32, col33, col34 )
SELECT view1.col23, view1.col2, view1.physician, view1.totaltopay, view1.col4, view1.col5, view1.col6, view1.col7, view1.col8
I'm also trying to get it so that col35 would be a sequential number starting from a parameter is set. ie. the user enters 122, then the records that are added would enter into col35 the number 122, then on the next record it would add 123, then next record 124, etc. Is this all possible?
Jan 20, 2005, 12:37 #2
- Join Date
- Jul 2002
- Toronto, Canada
- 49 Post(s)
- 1 Thread(s)
your INSERT statement is fine, it is standard sql so postgresql should have no problem with it
as far as autoincrements go, they are different in postgresql (i think they use sequences or serials) so you would have to experiment with it
i don't have postgresql or i would experiment with it for you, not having anything else better to do today...
Jan 20, 2005, 13:16 #3
I looked at the autonumber fields for my primary keys in the postgres tables and the database lists the default on the primary key as such(for the primary key col1 in tbl95):
Is there anyway to use this to increments the numbers in the records I'm inserting using this from the users initial number they enter?