Re: [SQL] Export Access 97 to PostgreSQL

2008-03-27 Thread Shavonne Marietta Wijesinghe

Thanks. I tried the following command

COPY REGIONI FROM 
'C:/Inetpub/wwwroot2/FORMWebSite1/database/FormAjax/REGIONI.copy' WITH 
DELIMITER '\t';


But i get this error

ERROR:  relation "regioni" does not exist

Here is a sample of my file (fields seperated with a tab)

1360077,00 848351,00 2,00 2,00 4,00 "Trentino-alto adige"
1842400,00 1132202,00 3,00 3,00 5,00 "Veneto"
7859928000,00 746082,90 4,00 4,00 6,00 "Friuli-venezia giulia"

What can the problem be?

Shavonne 



--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Export Access 97 to PostgreSQL

2008-03-27 Thread Ivan Sergio Borgonovo
On Thu, 27 Mar 2008 10:03:57 +0100
"Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]>
wrote:

> Thanks. I tried the following command
> 
> COPY REGIONI FROM 
> 'C:/Inetpub/wwwroot2/FORMWebSite1/database/FormAjax/REGIONI.copy'
> WITH DELIMITER '\t';
> 
> But i get this error
> 
> ERROR:  relation "regioni" does not exist

You've to create the REGIONI table.
You may (or may not) get into trouble with locale. I noticed you're
using , as a decimal separator.
So if you're still encountering problems... that could be the second
thing to look at.

> Here is a sample of my file (fields seperated with a tab)

> 1360077,00 848351,00 2,00 2,00 4,00 "Trentino-alto adige"
> 1842400,00 1132202,00 3,00 3,00 5,00 "Veneto"
> 7859928000,00 746082,90 4,00 4,00 6,00 "Friuli-venezia giulia"

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it


-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Export Access 97 to PostgreSQL

2008-03-27 Thread Shavonne Marietta Wijesinghe

Strange coz i created the table. Why doesn't it seem to find it??

CREATE TABLE "REGIONI"
(
 "AREA" int4,
 "PERIMETER" int4,
 "REGIONI_" int4,
 "REGIONI_ID" int4,
 "COD_REG" int4,
 "REGIONE" text
) 
WITHOUT OIDS;


--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Export Access 97 to PostgreSQL

2008-03-27 Thread Marcin Stępnicki
On Thu, Mar 27, 2008 at 11:06 AM, Shavonne Marietta Wijesinghe
<[EMAIL PROTECTED]> wrote:

> COPY REGIONI FROM
(...)
> Strange coz i created the table. Why doesn't it seem to find it??
>
>  CREATE TABLE "REGIONI"

You need to quote the name in your COPY command as well.

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Export Access 97 to PostgreSQL

2008-03-27 Thread Shavonne Marietta Wijesinghe

Thanks.. So it was a uppercase problem ;)

Shavonne.

--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Export Access 97 to PostgreSQL

2008-03-27 Thread Roberto Spier

Shavonne Marietta Wijesinghe escreveu:

Hello
 
I have a db in MS Access 97 and now i have to import the data in 
PostgreSQL. I can create the table structure in PostgreSql but in what 
format can i export the table from Access so Postgresql can read it?
 
Thanks
 
Shavonne
Export the data, instead! You'd connect (link) to the postgreSQL 
database from within access mdb, then run an acc's INSERT INTO  query.


hth

--
 Spier
 



--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


[SQL] link to Jsp

2008-03-27 Thread Shavonne Marietta Wijesinghe
Hello

I'm trying to connect to my postgresql db from a JSP page but my db is on one 
computer and the jsp in another.. 

Has anyone done something like this before??

 private synchronized Connection getConnection() throws ClassNotFoundException,
  SQLException {
final String DRIVER = "org.postgresql.Driver";
final String URL = "jdbc:postgresql:FormAjax";
final String USERNAME = "postgres";
final String PASSWORD = "form";
  
Class.forName(DRIVER);
  
return DriverManager.getConnection(URL, USERNAME, PASSWORD);
 }

Thanks

Shavonne Wijesinghe


Re: [SQL] Finding all References to a Primary Key

2008-03-27 Thread Erik Jones


On Mar 26, 2008, at 1:19 PM, Matthew T. O'Connor wrote:
I'm sorry if this is has been discussed, but I tried to find the  
answer in the archives and failed, so...


How do I find all the rows in other tables that reference a specific  
row in another table?  I'm only trying to find rows that are in  
tables where there is a Foreign Key referencing the primary key of  
the table in question.


Example:
Table People has a primary key of people_id
There are say 20 tables that have foreign keys referencing  
people.people_id
How do I find all the rows in all of those 20 tables that reference  
a particular person in the people table?


pg_catalog.pg_constraint has that info.

Erik Jones

DBA | Emma®
[EMAIL PROTECTED]
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com




--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] link to Jsp

2008-03-27 Thread Craig Ringer
Shavonne Marietta Wijesinghe wrote:
> Hello
> 
> I'm trying to connect to my postgresql db from a JSP page but my db is on one 
> computer and the jsp in another.. 
> 
> Has anyone done something like this before??
> 
>  private synchronized Connection getConnection() throws 
> ClassNotFoundException,
>   SQLException {
> final String DRIVER = "org.postgresql.Driver";
> final String URL = "jdbc:postgresql:FormAjax";

Read the documentation for the PostgreSQL JDBC layer, particularly the
part about the JDBC URL. I quote:


The JDBC URL

In JDBC all url's begin with jdbc:protocol: This is the standard. After
this is driver specific, and no two drivers are the same.

So our url? It's one of the following:

jdbc:postgresql:database
jdbc:postgresql://host/database
jdbc:postgresql://host:port/database

where database is the database to connect to, host the server to connect
to, and port the port number.

If left out, host defaults to localhost (not 127.0.0.1 see applets!) and
port to 5432 (configurable at build time).
---

--
Craig Ringer

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


[SQL] returning on inserts

2008-03-27 Thread chester c young
insert into t1( c1 )
select c1 from t2
returning t1.c1, t2.c2;

ERROR: missing FROM-clause entry for table "t2"

is there any way to make this work?


  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql