Best practice for pagination in Oracle?

If you’re already using analytics (ROW_NUMBER() OVER …) then adding another analytic function on the same partitioning will add a negligible cost to the query. On the other hand, there are many other ways to do pagination, one of them using rownum: SELECT * FROM (SELECT A.*, rownum rn FROM (SELECT * FROM your_table ORDER … Read more

Oracle PL/SQL – How to create a simple array variable?

You can use VARRAY for a fixed-size array: declare type array_t is varray(3) of varchar2(10); array array_t := array_t(‘Matt’, ‘Joanne’, ‘Robert’); begin for i in 1..array.count loop dbms_output.put_line(array(i)); end loop; end; Or TABLE for an unbounded array: … type array_t is table of varchar2(10); … The word “table” here has nothing to do with database … Read more

Deploying and Configuring ODP.NET to work without installation with Entity Framework

This answer summarizes (hopefully) all the steps required, many of which documented in various places online and might save someone hours of Googling. A. How to deploy and configure Oracle.DataAccess.Client. A.1. Download ODAC112030Xcopy_64bit.zip or ODAC112030Xcopy_32bit.zip. A.1.1. Extract the content of the following folders within the zip file into your application/host’s bin/setup folder: A.1.1.1. instantclient_11_2 A.1.1.2. … Read more