auto insert data every one minute

Started by searcheliteover 17 years ago12 messagesgeneral
Jump to latest
#1searchelite
searchelite@gmail.com

Hi all..

I have an sql script consists of insert statement data. I want to insert
every row of data every one minute. How can i do that using batch file in
windows

Thank you
--
View this message in context: http://www.nabble.com/auto-insert-data-every-one-minute-tp20027811p20027811.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

#2Richard Broersma
richard.broersma@gmail.com
In reply to: searchelite (#1)
Re: auto insert data every one minute

On Fri, Oct 17, 2008 at 12:32 AM, searchelite <searchelite@gmail.com> wrote:

I have an sql script consists of insert statement data. I want to insert
every row of data every one minute. How can i do that using batch file in
windows

Take a look at your windows scheduler in the control panel. You might
need to spend quite a bit of time configuring a 1 minute interval
since it only seems to be designed for daily occurrences.

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

#3Jason Long
mailing.list@supernovasoftware.com
In reply to: Richard Broersma (#2)
Re: auto insert data every one minute

Richard Broersma wrote:

On Fri, Oct 17, 2008 at 12:32 AM, searchelite <searchelite@gmail.com> wrote:

I have an sql script consists of insert statement data. I want to insert
every row of data every one minute. How can i do that using batch file in
windows

Take a look at your windows scheduler in the control panel. You might
need to spend quite a bit of time configuring a 1 minute interval
since it only seems to be designed for daily occurrences.

Use Linux and you life will become much easier. ;)

#4Daniel Verite
daniel@manitou-mail.org
In reply to: searchelite (#1)
Re: auto insert data every one minute

searchelite wrote:

I have an sql script consists of insert statement data. I want to

insert

every row of data every one minute. How can i do that using batch

file in

windows

How about using pg_sleep ?

INSERT .... ;
COMMIT;
SELECT pg_sleep(60);

INSERT...;
COMMIT;
SELECT pg_sleep(60);

...

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage:
http://www.manitou-mail.org

#5Grzegorz Jaśkiewicz
gryzman@gmail.com
In reply to: Daniel Verite (#4)
Re: auto insert data every one minute

how about windows task scheduler ? (cron-ish thing)

--

GJ

#6Daniel Verite
daniel@manitou-mail.org
In reply to: Grzegorz Jaśkiewicz (#5)
Re: auto insert data every one minute

Grzegorz Jaśkiewicz wrote:

how about windows task scheduler ? (cron-ish thing)

If the OP wants to do the exact same insert every minute, then the OS
scheduler sure does the job.

That's not how I understood the question, though. My interpretation is
that he has a SQL script with an ordered list of INSERTs to perform and
he wants to throttle the execution, in which case scheduling at the OS
level doesn't help that much.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage:
http://www.manitou-mail.org

#7searchelite
searchelite@gmail.com
In reply to: Daniel Verite (#4)
Re: auto insert data every one minute

Daniel Verite wrote:

searchelite wrote:

How about using pg_sleep ?

INSERT .... ;
COMMIT;
SELECT pg_sleep(60);

INSERT...;
COMMIT;
SELECT pg_sleep(60);

i can use pg_sleep..but i have thousands of data to be inserted..is there
any better way using pg_sleep?

--
View this message in context: http://www.nabble.com/auto-insert-data-every-one-minute-tp20027811p21263763.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

#8Reg Me Please
regmeplease@gmail.com
In reply to: searchelite (#7)
Re: auto insert data every one minute

You need to write a process that will do it.
At best you can use crontab if your a lucky and use Unix.

--
Fahrbahn ist ein graues Band
weisse Streifen, grüner Rand

Show quoted text

On Saturday January 3 2009 11:46:47 searchelite wrote:

Daniel Verite wrote:

searchelite wrote:

How about using pg_sleep ?

INSERT .... ;
COMMIT;
SELECT pg_sleep(60);

INSERT...;
COMMIT;
SELECT pg_sleep(60);

i can use pg_sleep..but i have thousands of data to be inserted..is there
any better way using pg_sleep?

--
View this message in context:
http://www.nabble.com/auto-insert-data-every-one-minute-tp20027811p21263763
.html Sent from the PostgreSQL - general mailing list archive at Nabble.com.

#9Tino Wildenhain
tino@wildenhain.de
In reply to: searchelite (#7)
Re: auto insert data every one minute

Hi,

searchelite wrote:
...

i can use pg_sleep..but i have thousands of data to be inserted..is there
any better way using pg_sleep?

I wonder what is you complete problem? It seems all the advices given
so far are shots-in-the-dark. Could you perhaps expand a bit?

Also for sophisticated solution, if you stick to windows you might
want to consider something different then just pure CMD, say some
scripting language to support.

Tino

#10Christophe Chauvet
christophe@kryskool.org
In reply to: Tino Wildenhain (#9)
Re: auto insert data every one minute

Hi

Why don't use pgAgent http://pgadmin.org/docs/dev/pgagent.html ?

Regards,

Christophe Chauvet.

Tino Wildenhain a �crit :

Show quoted text

Hi,

searchelite wrote:
...

i can use pg_sleep..but i have thousands of data to be inserted..is
there
any better way using pg_sleep?

I wonder what is you complete problem? It seems all the advices given
so far are shots-in-the-dark. Could you perhaps expand a bit?

Also for sophisticated solution, if you stick to windows you might
want to consider something different then just pure CMD, say some
scripting language to support.

Tino

#11searchelite
searchelite@gmail.com
In reply to: Tino Wildenhain (#9)
Re: auto insert data every one minute

Tino Wildenhain wrote:

I wonder what is you complete problem? It seems all the advices given
so far are shots-in-the-dark. Could you perhaps expand a bit?

Also for sophisticated solution, if you stick to windows you might
want to consider something different then just pure CMD, say some
scripting language to support.

Tino

I have pre-recorded gps data in .sql insert format..for simulate real-time
tracking, i want to insert the data in let say every one minute

--
View this message in context: http://www.nabble.com/auto-insert-data-every-one-minute-tp20027811p21524797.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

#12Joshua D. Drake
jd@commandprompt.com
In reply to: searchelite (#11)
Re: auto insert data every one minute

On Sat, 2009-01-17 at 22:40 -0800, searchelite wrote:

Tino Wildenhain wrote:

I wonder what is you complete problem? It seems all the advices given
so far are shots-in-the-dark. Could you perhaps expand a bit?

Also for sophisticated solution, if you stick to windows you might
want to consider something different then just pure CMD, say some
scripting language to support.

Tino

I have pre-recorded gps data in .sql insert format..for simulate real-time
tracking, i want to insert the data in let say every one minute

Feed the data to a loop that waits every 60 seconds. You could also pipe
it to a named pipe while an injector was listening.

Joshua D. Drake

--
View this message in context: http://www.nabble.com/auto-insert-data-every-one-minute-tp20027811p21524797.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
PostgreSQL - XMPP: jdrake@jabber.postgresql.org
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997