Search Postgresql Archives

Re: PL/PGSQL + inserts+updates+limit - Postgres 9.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ok so guys....

CREATE or REPLACE FUNCTION function_data_1()
RETURNS SETOF bigint AS $$

declare
        row record;

BEGIN

[...]

FOR row IN EXECUTE '
            SELECT
                    t1.file_id,
                    t1.path,
                    t1.account_id
            FROM
                    table1 t1
            JOIN
                    table3 t3 ON t3.file_Id = t1.file_id
            WHERE
                    t3.migrated = 0
            AND 
                    t3.account_id = 1112
            ORDER BY 1 LIMIT 30 '

[...]


 How can I make the function works with account_id?

Example: select function_data_1(1112)

and then it will do all the work just for that specific account_id?

If you guys please could give me the way to do that.. 
thanks
Patrick

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux