Exiting news, beta version of the Oracle Database called Oracle Express Edition or XE is made available! Oracle intends to release a free version of its database, a reaction to the growing competitive pressure from low-end open-source databases. Read Sergio’s Blog for more info.
October 29, 2005
October 20, 2005
October 19, 2005
AskTom “OA Framework” Discussion
Here you can read a small discussion on the OA framework.
PL/SQL: Who is Calling Me?
Found this handy piece of code that tells you who is calling a procedure. This can be used when you write a package for debugging. Create the following procedure:
create or replace procedure who_called_me(
owner out varchar2
,name out varchar2
,lineno out number
,caller_t out varchar2
) is
call_stack varchar2(4096)
default dbms_utility.format_call_stack;
n number;
found_stack BOOLEAN default FALSE;
line varchar2(255);
cnt number := 0;
begin
loop
n := instr( call_stack, chr(10) );
exit when ( cnt = 3 or n is NULL or n = 0 );
line := substr( call_stack, 1, n-1 );
call_stack := substr( call_stack, n+1 );
if not found_stack then
if line like '%handle%number%name%' then
found_stack := TRUE;
end if;
else
cnt := cnt + 1;
-- cnt = 1 is ME
-- cnt = 2 is MY Caller
-- cnt = 3 is Their Caller
if ( cnt = 3 ) then
lineno := to_number(substr( line
, 13, 6 ));
line := substr( line, 21 );
if ( line like 'pr%' ) then
n := length( 'procedure ' );
elsif ( line like 'fun%' ) then
n := length( 'function ' );
elsif ( line like 'package body%' ) then
n := length( 'package body ' );
elsif ( line like 'pack%' ) then
n := length( 'package ' );
else
n := length( 'anonymous block ' );
end if;
caller_t :=
ltrim(rtrim(upper(substr( line, 1, n-1 ))));
line := substr( line, n );
n := instr( line, '.' );
owner := ltrim(rtrim(substr( line, 1, n-1 )));
name := ltrim(rtrim(substr( line, n+1 )));
end if;
end if;
end loop;
end who_called_me;
/
Procedure created.
Small example on how you can use it, create 2 procedures:
create or replace procedure called
is
l_owner varchar2(30);
l_name varchar2(30);
l_lineno number;
l_caller_t varchar2(2000);
begin
dbms_output.put_line('starting procedure called');
who_called_me(l_owner, l_name, l_lineno, l_caller_t );
dbms_output.put_line('called by '|| l_owner
||'.'||l_name||' line '||l_lineno
||' ('||l_caller_t||')');
dbms_output.put_line('the end...');
end called;
/
Procedure created.
create or replace procedure caller
is
begin
called;
end caller;
/
Procedure created.
Then runnit:
exec caller starting procedure called called by APPS.CALLER line 4 (PROCEDURE) the end... PL/SQL procedure successfully completed.
October 18, 2005
WMS Task Type Assignment Based on Ship Country
I’m trying to assign task types to ship transactions based on ship-to country; we cannot create a Task Type rule and create a restriction on ship-to country. In Europe the trucks leave the warehouse based on where they are going to. We would like to organize order picking based on this constraint. Currently I’m working with Oracle to find a solution. For now this will be a manual process using the WMS workbench, there you can see ship to countries.
October 15, 2005
Oracle Database 10g Sets New World Record For Performance
As the leading database for production data warehousing, Oracle Database 10g provides a single, integrated database engine for scalable and high performing data warehousing implementations. The extensive list of Oracle Database 10g performance world records, including recently published TPC-H benchmarks, illustrates why customers choose Oracle to run very large databases. Currently, Oracle holds the
following TPC-H world records.
October 10, 2005
Books: Optimizing Oracle Performance
Cary Millsap’s book changed the way I look at Oracle performance. Read this book some 1.5 years ago, a very good read!
October 4, 2005
Forcing return-path with sendmail in perl
If sendmail is not setting the correct return-path in your mail header, the -t -ba flags might help. The following example sets the return-path to from@jadajada.com:
#!/usr/local/bin/perl
unless(open (MAIL, "|/usr/lib/sendmail -t -ba")) {
print "error.n";
warn "Error starting sendmail: $!";
}
else{
print MAIL "From: from@jadajada.comn";
print MAIL "To: to@jadajada.comn";
print MAIL "Subject: sendmail+perl -t -ba nn";
print MAIL "test sendmail and perl";
close(MAIL) || warn "Error closing mail: $!";
print "Mail sent.n";
}
