I want to declare variable in postgren, but not in the function ...
C declare varchar; An integer; B integer; Select from the table b = count (*) table = a = 1 while a & lt; Select = c = [c] from the table where id = a if (c = '1') Select in table 2 (*) Select from the end of the table Set = a + 1 But error error: "varchar" string syntax error on or near LINE 2: c varchar; ^ I hope someone can help me
If you are at 9.0 then you DO details You can use anonymous blocks by using :
Before 9.0 you can not use anonymous pl / pgSQL blocks, you will need to create a function for it.
In addition to this, you have a syntax for this / PgSQL is completely incorrect
You can not have an assignment and a WHILE statement in the same row. You are also missing other requird keywords for the WHILE loop.
Please refer to the manual to know the correct syntax:
Syntax for reading one is also wrong with the value of the variable.
The correct syntax is to obtain the result of a select:
SELECT SELECT count (*) in some_ from something; See also the manual for:
Comments
Post a Comment