Posts

Showing posts from 2010

Dependencies Among Schema Objects

Image
Dependencies Among Schema Objects The definitions of some objects, including views and procedures, reference other objects, such as tables. As a result, the objects being defined are dependent on the objects referenced in their definitions. This chapter discusses the dependencies among schema objects and how Oracle automatically tracks and manages these dependencies. This chapter contains the following topics: Introduction to Dependency Issues Resolution of Schema Object Dependencies Object Name Resolution Shared SQL Dependency Management Local and Remote Dependency Management Introduction to Dependency Issues Some types of schema objects can reference other objects as part of their definition. For example, a view is defined by a query that references tables or other views. A procedure's body can include SQL statements that reference other objects of a database. An object that references another object as part of its definition is called a dependent object, while ...

Dependency Injection in PL/SQL – Remove Hard Coded Dependencies from your code

Image
Dependency Injection in PL/SQL – Remove Hard Coded Dependencies from your code Frequently our code has dependencies. Some are intrinsic dependencies, like the packages we need to invoke and the type definitions we rely on. Other dependencies are more like configuration settings, not really an intrinsic part of the code at all. Like the parameters in a discount calculcation or the name of the file our Logging component should write or the URL at which a WebService can be accessed. In this article we briefly discuss the Dependency Injection design pattern and continue to investigate a possible implementation in PL/SQL. The Dependency Injection design pattern has been introduced by Martin Fowler – see for example Inversion of Control Containers and the Dependency Injection pattern at http://www.martinfowler.com/articles/injection.html – and can be seen as a specialization of the Inversion of Control pattern. Dependency Injection is about the principle of separating configuration from us...

Dependency Management - Dependencies in Server-Side PL/SQL

Dependency Management - Dependencies in Server-Side PL/SQL If you’re working with server-side PL/SQL programs, you can use the server’s data dictionary to explore usage relationships in quite a bit of detail. Here’s a simple illustration of this rule in action, using the data dictionary to give us eyes into the database. Let’s say that you have a package named bookworm on the server. In this package is a function that selects from the books table. If you create the table and then create the package, expect to see the following: SQL> SELECT object_name, object_type, status 2 FROM USER_OBJECTS 3 WHERE object_name = 'BOOKWORM'; OBJECT_NAME OBJECT_TYPE STATUS ------------------------------ ------------------ ------- BOOKWORM PACKAGE VALID BOOKWORM PACKAGE BODY VALID That is, there are two objects with the name BOOKWORM; the first is the package spec and the second is the body. ...

Character Function

Character   functions 1)       Concat()          It concatenates two strings         Select concat(‘hello’,’world’) from dual;            o/p :   helloworld 2)       Substr()      Maximum 3 arguments   Select substr(‘helloworld’ ,2,3)from dual   o/p :: el 3)       Instr() It gives you portion of character Select instr(‘helloworld’,’l’) from dual; o/p:: 3 4)       Lpad():: Minimum 2 and maximum 3 argument accepted Select lpad(salary,8) from employees;   o/p::    -------4000   select lpad(salary,8,’*’) from employees;   o/p::   ****4000 5) Rpad()       Select rpad(salary,8) from employees; o/p ::     4000---- Select rpad(salary,8...