Hi,
I'd like to return the output, or output as a variable, from a pgSQL query that I'm executing through batch file back to the batch file so that it executes a line in particular of the batch file (through a 'goto' command I think).
I manage to execute the query and see the result (in cmd) but am not sure how I can grab that result and use it.
If anybody's got any ideas...?
Thanks,...
User Profile
Collapse
-
Batch file + psql problem
-
Aggregate/concatenate function (flattening columns into a row)
Hi Forum,
I'm trying to perform a type of concatenate function on a table and am not really sure where to start. I'd like to aggregate the values from 'field' on their ID. To explain, my table is like this:
ID roadnum
1 A-1
2 B-1
2 E-1
3 N-1
4 N-3
4 E-2
4 CA-1
5 E-1
... -
Thanks for the link. Although I managed to solve the problem just before going to lunch. A friend passed me a BAT file called postgistoshp.ba t, which works, although I'm not sure how(!).
This is the code:
Cheers,Code:rem %1 database - %2 table pgsql2shp.exe -h <server_name> -u postgres <DB_name> <table_name>
Matt -
Sorry for being a bit vague, I hadn't realised there were various types of SQL files. I checked the files and they're 'Microsoft server SQL query files'- does that help? Below I've copied a the text from the header and footer of a file similar to what I'd like to output.
Thanks
[CODE=sql]
BEGIN;
CREATE TABLE "txt_barrio " (gid serial PRIMARY KEY,
"nombre" varchar(254),
"izena"...Leave a comment:
-
I'm trying to get a .sql output, which in turn I want to convert to a shapefile (.shp).Leave a comment:
-
Exporting tables from Postgres to SQL
Hi,
How can I export some tables from Postgres to SQL scripts? I've tried the COPY...TO command but it's not really what I was looking for as it creates CSV files.
Cheers,
Matt
No activity results to display
Show More
Leave a comment: