reset password
Author Message
alomo
Posts: 70
Posted 00:40 Oct 01, 2009 |

What would be the proper settings in Eclipse to execute SQL files?

cysun
Posts: 2935
Posted 07:54 Oct 01, 2009 |

1. Open the Data Source Explorer view (it's under the Connectivity category).

2. Right click on Databases and create a new Connection Profile.

3. Open an SQL script file.

4. Select the connection profile.

5. Run the script.

alomo
Posts: 70
Posted 08:38 Oct 01, 2009 |

That's exactly what I did. I was running it on the localhost and it runs with many errors. Below is a history file after running the csns-create.sql script (see ERROR in lines 1040, 1059, 1071, 1086, and 1098 of the history file).

At the same time, this script successfully runs when in the pgAdmin.

 

Attachments:
Last edited by alomo at 08:40 Oct 01, 2009.
cysun
Posts: 2935
Posted 10:12 Oct 01, 2009 |
alomo wrote:

That's exactly what I did. I was running it on the localhost and it runs with many errors. Below is a history file after running the csns-create.sql script (see ERROR in lines 1040, 1059, 1071, 1086, and 1098 of the history file).

At the same time, this script successfully runs when in the pgAdmin.

 

csns-create.sql has a couple of stored procedures that use PL/pgSQL. I guess Eclipse doesn't recognize it.

alomo
Posts: 70
Posted 11:06 Oct 01, 2009 |
cysun wrote:
alomo wrote:

That's exactly what I did. I was running it on the localhost and it runs with many errors. Below is a history file after running the csns-create.sql script (see ERROR in lines 1040, 1059, 1071, 1086, and 1098 of the history file).

At the same time, this script successfully runs when in the pgAdmin.

 

csns-create.sql has a couple of stored procedures that use PL/pgSQL. I guess Eclipse doesn't recognize it.

 

Although the errors occurred at the end of the script, only the first table (roles) was created.

 

cysun
Posts: 2935
Posted 12:19 Oct 01, 2009 |
alomo wrote:
cysun wrote:
alomo wrote:

That's exactly what I did. I was running it on the localhost and it runs with many errors. Below is a history file after running the csns-create.sql script (see ERROR in lines 1040, 1059, 1071, 1086, and 1098 of the history file).

At the same time, this script successfully runs when in the pgAdmin.

 

csns-create.sql has a couple of stored procedures that use PL/pgSQL. I guess Eclipse doesn't recognize it.

 

Although the errors occurred at the end of the script, only the first table (roles) was created.

The error message says something about $$, so my guess is that Eclipse tries to parse the whole thing starting at "create table users" as one statement. Whatever the problem is, it's an Eclipse issue and there's not much we can do about it. Just use pgAdmin or psql.