On 6/8/2017 6:36 PM, marcinha rocha wrote:
|UPDATEtablea a SETmigrated =yes WHEREa.id =row.id;|
On my original select, the row will have migrated = false. Maybe All I
need to put is a limit 2000 and the query will do the rest?
SELECT does not return data in any determinate order unless you us
On Thursday, June 8, 2017, marcinha rocha
wrote:
> On Thursday, June 8, 2017, marcinha rocha hotmail.com
> >
> wrote:
>
>> On my original select, the row will have migrated = false. Maybe All I
>> need to put is a limit 2000 and the query will do the rest?
>>
>>
> You shoud try to avoid the for
On Thursday, June 8, 2017, marcinha rocha
mailto:marciaestefanidaro...@hotmail.com>>
wrote:
On my original select, the row will have migrated = false. Maybe All I need to
put is a limit 2000 and the query will do the rest?
You shoud try to avoid the for loop,
Why?
but yes a limit 2000 on the
On Thursday, June 8, 2017, marcinha rocha
wrote:
> On my original select, the row will have migrated = false. Maybe All I
> need to put is a limit 2000 and the query will do the rest?
>
>
You shoud try to avoid the for loop, but yes a limit 2000 on the for loop
query should work since the migrate
On 6/8/2017 5:53 PM, marcinha rocha wrote:
> Hi guys! I have the following queries, which will basically select
> data, insert it onto a new table and update a column on the original
> table.
I'm sure your example is a gross simplification of what you're really
doing, but if that's really all yo
On 6/8/2017 5:53 PM, marcinha rocha wrote:
Hi guys! I have the following queries, which will basically select
data, insert it onto a new table and update a column on the original
table.
I'm sure your example is a gross simplification of what you're really
doing, but if that's really all you'
On Thursday, June 8, 2017, marcinha rocha
wrote:
> When I call the function, it must execute 2000 rows and then stop. Then
> when calling it again, it must start from 2001 to 4000, and so on
>
> You can do this is with plain sql with the help of a CTE. Insert into +
Select ... limit 2000 returni
Hi guys! I have the following queries, which will basically select data, insert
it onto a new table and update a column on the original table.
CREATE or REPLACE FUNCTION migrate_data()
RETURNS integer;
declare
row record;
BEGIN
FOR row IN EXECUTE '
SELECT
id