hi,
i have a table called zones: idzone, zone_name
and several tables called zonename_records (same structure), where
zonename is one of the zone_name in the zones table.
What i want to do is a function that union all of this tables
dinamically based on zones table, this is what i've done so
On 2/10/2010 11:29 AM, Andrea Visinoni wrote:
hi,
i have a table called zones: idzone, zone_name
and several tables called zonename_records (same structure), where
zonename is one of the zone_name in the zones table.
What i want to do is a function that union all of this tables
dinamically
On 02/10/2010 08:29 AM, Andrea Visinoni wrote:
hi,
i have a table called zones: idzone, zone_name
and several tables called zonename_records (same structure), where
zonename is one of the zone_name in the zones table.
What i want to do is a function that union all of this tables
dinamically
I tryed a way but it is not working. Please see it:
LOOP;
-- some computations
insert into carga (desc) values ('My Text');
IF count 100 THEN
EXIT; -- exit loop
END IF;
END LOOP;
The postgresql reports the following error:
/
ERROR: syntax error at or near LOOP
SQL state
100 THEN
EXIT; -- exit loop
END IF;
END LOOP;
The postgresql reports the following error:
/
ERROR: syntax error at or near LOOP
SQL state: 42601
Character: 1/
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ
They are not working well.
Allways the same error.
(if while)
ERROR: syntax error at or near WHILE
SQL state: 42601
Character: 1
(if for)
ERROR: syntax error at or near FOR
SQL state: 42601
Character: 1
(if loop)
ERROR: syntax error at or near LOOP
SQL state: 42601
Character: 1
I installed
] 2007-03-13 14:19
They are not working well.
Allways the same error.
(if while)
ERROR: syntax error at or near WHILE
SQL state: 42601
Character: 1
(if for)
ERROR: syntax error at or near FOR
SQL state: 42601
Character: 1
(if loop)
ERROR: syntax error at or near LOOP
SQL state: 42601
Character
Ezequias R. da Rocha wrote:
They are not working well.
Allways the same error.
(if while)
ERROR: syntax error at or near WHILE
SQL state: 42601
Character: 1
You may have a problem in the code just _before_ these lines.
--
Alvaro Herrera
: syntax error at or near LOOP
SQL state: 42601
Character: 1
I installed the pgsql but I don't think it is a problem of language.
What could be wrong ? I am not using functions too. I am using the SQL
tool of PgAdmin III.
Any help would be glad.
Can we see the complete function?
--
Adrian
SQL state: 42601
Character: 1
(if for)
ERROR: syntax error at or near FOR
SQL state: 42601
Character: 1
(if loop)
ERROR: syntax error at or near LOOP
SQL state: 42601
Character: 1
I installed the pgsql but I don't think it is a problem of language.
What could be wrong ? I am not using functions
On 3/13/07, Ezequias R. da Rocha [EMAIL PROTECTED] wrote:
I quetion one more time. I must have a function ? Isn't another way to
implement it without using functions ?
Not in PostgreSQL. Here's a sample of something similar to what you were doing.
CREATE LANGUAGE plpgsql;
CREATE TABLE carga
(if for)
ERROR: syntax error at or near FOR
SQL state: 42601
Character: 1
(if loop)
ERROR: syntax error at or near LOOP
SQL state: 42601
Character: 1
I installed the pgsql but I don't think it is a problem of language.
What could be wrong ? I am not using functions too. I am using the SQL
tool
am Tue, dem 13.03.2007, um 10:30:59 -0300 mailte Ezequias R. da Rocha
folgendes:
I quetion one more time. I must have a function ? Isn't another way to
implement it without using functions ?
Yes, you need a function. SQL doesn't know LOOPs.
And, please, no silly fullquote.
[100 lines
Hi list,
I would like to test the power of processing of postgresql (and my
server) by insert a large ammount of data on a table I have.
I would like to know how to implement a For... loop . With it I think I
could check the real power of my server.
Ezequias
Ezequias R. da Rocha wrote:
Thank you all. The function from Jonah solves my problem.
Just a simple question:
One million of inserctions in *28,8* seconds with this kind of data
(timestamp|character varring (50)) is a good performance ?
I let my questions to DBAs from PostgreSQL.
I
I rewritte the Jonah's function to:
FOR iter IN 1 .. num_iter
LOOP
-- some computations
INSERT INTO carga (descricao) VALUES ('CardPass');
END LOOP;
My ID is now() by default
And it was in 23sec
After I changed the insert to:
INSERT INTO carga (id,descricao) VALUES
hi all,
i am using PostgreSQL 7.3.2 on redhat linux 9.
there is problem when executing pl/pg sql functions.
if the function enter an infinite loop. the server is hanged.
cannot cancel the query.
the linux itself is hanged.i cannot kill postgres process.
i have to reboot the machine manually..
17 matches
Mail list logo