ruby-plsql 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.1.1 2008-04-01
2
+
3
+ * Bug fixes
4
+ * Improved performance of PL/SQL procedure arguments selection in large databases
5
+ * Added schema and package names in generated PL/SQL block when calling procedures from packages
6
+
1
7
  == 0.1.0 2008-03-15
2
8
 
3
9
  * Initial release
@@ -32,12 +32,15 @@ module PLSQL
32
32
  @arguments = {}
33
33
  @return = nil
34
34
  num_rows = @schema.connection.exec("
35
- SELECT argument_name, position, data_type, in_out, data_length, data_precision, data_scale
36
- FROM all_arguments
37
- WHERE owner = :owner
38
- AND object_name = :object_name
39
- AND NVL(package_name,'nil') = :package
40
- ", @schema.schema_name, @procedure, @package ? @package : 'nil'
35
+ SELECT a.argument_name, a.position, a.data_type, a.in_out, a.data_length, a.data_precision, a.data_scale
36
+ FROM all_arguments a, all_objects o
37
+ WHERE o.owner = :owner
38
+ AND o.object_name = :object_name
39
+ AND a.owner = o.owner
40
+ AND a.object_id = o.object_id
41
+ AND a.object_name = :procedure_name
42
+ AND NVL(a.package_name,'nil') = :package
43
+ ", @schema.schema_name, @package ? @package : @procedure, @procedure, @package ? @package : 'nil'
41
44
  ) do |r|
42
45
  argument_name, position, data_type, in_out, data_length, data_precision, data_scale = r
43
46
  if argument_name
@@ -66,6 +69,8 @@ module PLSQL
66
69
  def exec(*args)
67
70
  sql = "BEGIN\n"
68
71
  sql << ":return := " if @return
72
+ sql << "#{@schema.schema_name}." if @schema
73
+ sql << "#{@package}." if @package
69
74
  sql << "#{@procedure}("
70
75
  # Named arguments
71
76
  args_list = []
@@ -2,7 +2,7 @@ module RubyPlsql #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -5,18 +5,18 @@ describe "Package" do
5
5
  plsql.connection = conn = OCI8.new("hr","hr","xe")
6
6
  plsql.connection.exec <<-EOS
7
7
  CREATE OR REPLACE PACKAGE test_package IS
8
- FUNCTION test_uppercase ( p_string VARCHAR2 )
8
+ FUNCTION test_procedure ( p_string VARCHAR2 )
9
9
  RETURN VARCHAR2;
10
10
  END;
11
11
  EOS
12
12
  plsql.connection.exec <<-EOS
13
13
  CREATE OR REPLACE PACKAGE BODY test_package IS
14
- FUNCTION test_uppercase ( p_string VARCHAR2 )
14
+ FUNCTION test_procedure ( p_string VARCHAR2 )
15
15
  RETURN VARCHAR2
16
16
  IS
17
17
  BEGIN
18
18
  RETURN UPPER(p_string);
19
- END test_uppercase;
19
+ END test_procedure;
20
20
  END;
21
21
  EOS
22
22
 
@@ -42,7 +42,7 @@ describe "Package" do
42
42
  end
43
43
 
44
44
  it "should execute package function and return correct value" do
45
- plsql.test_package.test_uppercase('xxx').should == 'XXX'
45
+ plsql.test_package.test_procedure('xxx').should == 'XXX'
46
46
  end
47
47
 
48
48
  end
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>Ruby API for PL/SQL</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/ruby-plsql"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/ruby-plsql" class="numbers">0.1.0</a>
36
+ <a href="http://rubyforge.org/projects/ruby-plsql" class="numbers">0.1.1</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;ruby-plsql&#8217;</h1>
39
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-plsql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raimonds Simanovskis
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-03-16 00:00:00 +02:00
12
+ date: 2008-04-01 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies: []
15
15