schema/spacewalk/oracle/procs/lookup_snapshot_invalid_reason.sql | 45 +++------- schema/spacewalk/postgres/procs/lookup_snapshot_invalid_reason.sql | 2 schema/spacewalk/upgrade/spacewalk-schema-1.6-to-spacewalk-schema-1.7/101-lookup_snapshot_invalid_reason.sql.oracle | 17 +++ schema/spacewalk/upgrade/spacewalk-schema-1.6-to-spacewalk-schema-1.7/101-lookup_snapshot_invalid_reason.sql.postgresql | 2 4 files changed, 35 insertions(+), 31 deletions(-)
New commits: commit 55fc057e170e889677f9393a28dcb18a334be117 Author: Milan Zazrivec mzazrivec@redhat.com Date: Wed Feb 29 09:56:12 2012 +0100
no need for autonomous_transaction in lookup_snapshot_invalid_reason
diff --git a/schema/spacewalk/oracle/procs/lookup_snapshot_invalid_reason.sql b/schema/spacewalk/oracle/procs/lookup_snapshot_invalid_reason.sql index 6e7fe82..356ee4d 100644 --- a/schema/spacewalk/oracle/procs/lookup_snapshot_invalid_reason.sql +++ b/schema/spacewalk/oracle/procs/lookup_snapshot_invalid_reason.sql @@ -1,5 +1,4 @@ --- --- Copyright (c) 2008 Red Hat, Inc. +-- Copyright (c) 2008-2012 Red Hat, Inc. -- -- This software is licensed to you under the GNU General Public License, -- version 2 (GPLv2). There is NO WARRANTY for this software, express or @@ -11,35 +10,21 @@ -- Red Hat trademarks are not licensed under GPLv2. No permission is -- granted to use or replicate Red Hat trademarks that are incorporated -- in this software or its documentation. --- --- --- ---
-CREATE OR REPLACE FUNCTION -lookup_snapshot_invalid_reason(label_in IN VARCHAR2) -RETURN NUMBER -IS - PRAGMA AUTONOMOUS_TRANSACTION; +create or replace function +lookup_snapshot_invalid_reason(label_in in varchar2) +return number +is snapshot_invalid_reason_id number; -BEGIN - SELECT id - INTO snapshot_invalid_reason_id - FROM rhnSnapshotInvalidReason - WHERE label = label_in; +begin + select id + into snapshot_invalid_reason_id + from rhnsnapshotinvalidreason + where label = label_in;
- RETURN snapshot_invalid_reason_id; -EXCEPTION - WHEN NO_DATA_FOUND THEN - rhn_exception.raise_exception('invalid_snapshot_invalid_reason'); -END; + return snapshot_invalid_reason_id; +exception when no_data_found then + rhn_exception.raise_exception('invalid_snapshot_invalid_reason'); +end; / -SHOW ERRORS - --- --- --- Revision 1.1 2003/10/07 20:49:18 pjones --- bugzilla: 106188 --- --- snapshot invalidation --- +show errors diff --git a/schema/spacewalk/postgres/procs/lookup_snapshot_invalid_reason.sql b/schema/spacewalk/postgres/procs/lookup_snapshot_invalid_reason.sql index ad2e30d..97db760 100644 --- a/schema/spacewalk/postgres/procs/lookup_snapshot_invalid_reason.sql +++ b/schema/spacewalk/postgres/procs/lookup_snapshot_invalid_reason.sql @@ -1,4 +1,4 @@ --- oracle equivalent source sha1 69e0205a1a9291fbadf81d6ebcabb5a9643f03c7 +-- oracle equivalent source sha1 303d967530018a2a0c844e4641e2668f7735ecbd -- retrieved from ./1241042199/53fa26df463811901487b608eecc3f77ca7783a1/schema/spacewalk/oracle/procs/lookup_snapshot_invalid_reason.sql -- -- Copyright (c) 2008--2010 Red Hat, Inc. diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.6-to-spacewalk-schema-1.7/101-lookup_snapshot_invalid_reason.sql.oracle b/schema/spacewalk/upgrade/spacewalk-schema-1.6-to-spacewalk-schema-1.7/101-lookup_snapshot_invalid_reason.sql.oracle new file mode 100644 index 0000000..de68621 --- /dev/null +++ b/schema/spacewalk/upgrade/spacewalk-schema-1.6-to-spacewalk-schema-1.7/101-lookup_snapshot_invalid_reason.sql.oracle @@ -0,0 +1,17 @@ +create or replace function +lookup_snapshot_invalid_reason(label_in in varchar2) +return number +is + snapshot_invalid_reason_id number; +begin + select id + into snapshot_invalid_reason_id + from rhnsnapshotinvalidreason + where label = label_in; + + return snapshot_invalid_reason_id; +exception when no_data_found then + rhn_exception.raise_exception('invalid_snapshot_invalid_reason'); +end; +/ +show errors diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.6-to-spacewalk-schema-1.7/101-lookup_snapshot_invalid_reason.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.6-to-spacewalk-schema-1.7/101-lookup_snapshot_invalid_reason.sql.postgresql new file mode 100644 index 0000000..3b3e5f3 --- /dev/null +++ b/schema/spacewalk/upgrade/spacewalk-schema-1.6-to-spacewalk-schema-1.7/101-lookup_snapshot_invalid_reason.sql.postgresql @@ -0,0 +1,2 @@ +-- oracle equivalent source sha1 5c4386a7bb5e939b926b0c63d20091bd77aa00a4 +-- This file is intentionally left empty.
spacewalk-commits@lists.fedorahosted.org