473,473 Members | 1,604 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Batch file + psql problem

6 New Member
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,

Matt
Dec 12 '07 #1
1 6408
rski
700 Recognized Expert Contributor
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,

Matt
I'm afraid I don't get your problem (probably because of my poor english) but are you looking for something like that

for zm in `psql -t -A -c "select column_name from table_name"`
do
#do something with $zm
done;
Dec 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup)...
0
by: Leo Heska | last post by:
Hi I haven't seen the following problem mentioned anywhere We have an application written in VB.NET which executes a batch file (named startJob.cmd). We have discovered that if that batch file...
6
by: Charles Neitzel | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
1
by: Charles | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
7
by: Willem Herremans | last post by:
I am developing a client application for postgreSQL in Tcl/Tk (see http://gborg.postgresql.org/project/pfm ). It mainly uses PgTcl or pgintcl. I don't have any problems with those, but I am also...
0
by: rao123 | last post by:
Hi, I want to execute some set of Postgres routines like psql,pg_dump,pg_restore in a single MSDos batch file. I want to prompt user only once for password and use that in entire batch file with...
1
by: GOPALA | last post by:
Hi , How To Execute A Psql Commands Through Batch File(.bat). My Aim Is , Usting Batch File , Connect The Database And Then Execute The Psql Statements.
14
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my windows applicationm, i need to excute a batch file. this batch file throws some text and questions to the screen, i need to catch the standard Output, check if it's a question, in...
1
by: deepikabg | last post by:
Hi, Im v.new to postgres. I needed some help writing batch files. I wanted to run psql commands in a batch file. I give 2 inputs to the batch file -- Username and Database name I want my batch...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.