I am currently working with an 64-bit Standard Database.

For dev/testing, I am connecting this into a 9.0.1 64-bit Enterprise Database.

In SQL*PLus, I can run some SQL that extracts a PK recordset from across a db_link, and this returns around 617,000 rows.

If I put together the same cursor within a procedure, this same SQL is only returning 590,000 or so records.

I am at a complete loss as to what is going on.

Has anyone experienced this kind of behaviour?

It's first thing in the morning for me here, but I've had coffee!!

I've defined the SQL dynamically using both a SYS_REFCURSOR, and also running it as an EXECUTE IMMEDIATE (eventually the SQL is going to be dynamic).

I've even hardcoded the exact SQL that should connect across this particular link, in case I was being an idiot and it was connecting somewhere else - which it really can't - but I'm pulling my hair out with it here!

Comments anyone?