User Profile

Collapse

Profile Sidebar

Collapse
mattdoughty
mattdoughty
Last Activity: Dec 13 '07, 07:13 AM
Joined: May 22 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • mattdoughty
    started a topic Batch file + psql problem

    Batch file + psql problem

    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,...
    See more | Go to post

  • 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
    ...
    See more | Go to post

  • 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:

    Code:
     
    rem %1 database - %2 table
    pgsql2shp.exe -h <server_name> -u postgres <DB_name> <table_name>
    Cheers,

    Matt
    See more | Go to post

    Leave a comment:


  • 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"...
    See more | Go to post

    Leave a comment:


  • I'm trying to get a .sql output, which in turn I want to convert to a shapefile (.shp).
    See more | Go to post

    Leave a comment:


  • mattdoughty
    started a topic Exporting tables from Postgres to SQL

    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
    See more | Go to post
No activity results to display
Show More
Working...