Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Friday, January 30, 2009

Dynamic PL/SQL and Bulk Collect

Today was the first time that I needed to use dynamic sql with BULK COLLECT. It was due to a distributed database system that used dblinks from a master reporting database. I programmed this on Oracle 10g but it should work on 9i or later.


declare

TYPE table1Type is TABLE OF table1%ROWTYPE
index by binary_integer;
v_results table1Type ;

begin
v_sql := 'SELECT *
FROM table1@' || v_dblink || '
WHERE mydate_dttm > sysdate - 1';

EXECUTE IMMEDIATE v_sql BULK COLLECT INTO v_results;
end;



That's it... This loaded all of the records into the v_results PL/SQL table and you can loop through the results like a array.



Sunday, January 11, 2009

Dallas Techfest 2009 Postponed

I just read in Tim's Blog that the Dallas Techfest 2009 has been postponed and will not happen by March as originally planned. This is due to the last of sponsors for the event. If anyone has additional contacts to get support let Tim know or contact me and I'll pass the information on.