|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
PostgreSQL Help
Hey guys,
Wasn't sure if this belonged in any of the DB sections (I know there is an SQL, but this is different I think). So if somebody could let me know for future reference then great I am trying to do a simple store procedure to add a colum and 2 rows of data to a DB. DB Name: TestDatabase Schema: TestSchema Table: TestTable ALTER TABLE TestTable ADD COLUMN Numbers VARCHAR(30); INSERT INTO TestTable VALUES (1, 2); At the minute it is to just have numbers in it. From what I have done for myself can anybody let me know if it will create a column called 'Numbers' and add a row with '1' and then a second with '2' as the data? Cheers guys, Davie
__________________
If I have helped please click the scales ![]() Aye big mawn, I'm frum Norn Iron heigh |
|
#2
|
||||
|
||||
|
Quote:
If I am understanding you correctly, you will need a separate insert statement for each record Code:
INSERT INTO TestTable VALUES (1); INSERT INTO TestTable VALUES (2); Your syntax to add a column seems correct. Not a 100% thought since it is PostgreSQL
__________________
I would rather know than not know at all... ![]() |
|
#3
|
||||
|
||||
|
There is a specific PostgreSQL forum over at Dev Shed [ASP Free's
sister site] where you might be better off posting... ![]()
__________________
Support requests via PM will be ignored! |
|
#4
|
|||
|
|||
|
Why not just grab postgresql and install your own copy to fool around on? It's open source and free.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#5
|
||||
|
||||
|
also, the field is not numeric so you have to
wrap the value with quotes: Code:
INSERT INTO TestTable VALUES ('1');
the database, smart as it may be, won't change the field type just because its name. |
|
#6
|
||||
|
||||
|
Cheers guys.
I do indeed have a copy of Postgres here, it's just I haven't really used it before so not sure what I am doing lol. |
|
#7
|
||||
|
||||
|
After some twiddling about I managed to get it to insert data into the rows
![]() INSERT INTO "TestSchema"."TestTable" ("Numbers", "Description", "Data") VALUES ('AUP1', null, null); Thanks again guys! |
|
#8
|
||||
|
||||
|
cheers, glad you got it sorted!
![]() |
![]() |
| Viewing: ASP Free Forums > Other > ASP Free Lounge > PostgreSQL Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|