mardi 24 février 2015

dynamic postgres inside shell script not working



PG_CMD="psql -d $DB_NAME -U $DB_USER -c "
PG_CMD_TP="psql -d $DB_NAME -U $DB_USER -t -P format=unaligned -c "
abc()
{
$PG_CMD "
DO \$$

BEGIN
select * from customer;
END;
\$$";
}
*******MAIN***
abc


I want to print result of query on command line as well as I want to send it to excel file.I was expecting result of query on command line.But I am not getting anything.Thanks in advance.





Aucun commentaire:

Enregistrer un commentaire