Relative Content

Tag Archive for functionfor-looppsql

Iterate throught records in psql in a function

first, i have never wrote an function with loops in psql. I tried to create functions without loops and it works very well.
Now my problem is i have 2 functions one for the outer loop and one for the inner loop. I need all values as return values in a table. I get records from the outer loop and i need the id of every record to iterate throught the inner loop. And from the inner loop i need the data of the records.
The error message i get in DBeaver is:

ERROR: syntax error at or near "record".

Here is the function:

Iterate throught records in psql in a function

first, i have never wrote an function with loops in psql. I tried to create functions without loops and it works very well.
Now my problem is i have 2 functions one for the outer loop and one for the inner loop. I need all values as return values in a table. I get records from the outer loop and i need the id of every record to iterate throught the inner loop. And from the inner loop i need the data of the records.
The error message i get in DBeaver is:

ERROR: syntax error at or near "record".

Here is the function:

Iterate throught records in psql in a function

first, i have never wrote an function with loops in psql. I tried to create functions without loops and it works very well.
Now my problem is i have 2 functions one for the outer loop and one for the inner loop. I need all values as return values in a table. I get records from the outer loop and i need the id of every record to iterate throught the inner loop. And from the inner loop i need the data of the records.
The error message i get in DBeaver is:

ERROR: syntax error at or near "record".

Here is the function:

Iterate throught records in psql in a function

first, i have never wrote an function with loops in psql. I tried to create functions without loops and it works very well.
Now my problem is i have 2 functions one for the outer loop and one for the inner loop. I need all values as return values in a table. I get records from the outer loop and i need the id of every record to iterate throught the inner loop. And from the inner loop i need the data of the records.
The error message i get in DBeaver is:

ERROR: syntax error at or near "record".

Here is the function: