4 Replies Latest reply: Oct 23, 2013 2:55 AM by Billy~Verreynne RSS

    Ccreation of API

    Sarathy..beginner

      HI

       

      I am new to oracle and i don't know what is meant by API , and why do we create API,whats the necessary  to create an API..

              

                    could anyone explain me in a simple term..

       

       

       

       

       

          thank you

       

       

       

       

       

       

        • 2. Re: Ccreation of API
          vinod2303

          Hi Sarathy,

           

               You will never create an API. API's are provided by oracle and you just use them.  API's are used mainly because you should never do direct insert or update on any base tables in Oracle as the data gets corrupted as you will be not updating the other tables which are dependent on this data. But if you insert or update by calling an API it takes care of all dependencies. Hope it helps.

           

           

          Regards,

          Vinod

          • 3. Re: Ccreation of API
            Purvesh K

            vinod2303 wrote:

             

            API's are used mainly because you should never do direct insert or update on any base tables in Oracle as the data gets corrupted as you will be not updating the other tables which are dependent on this data. But if you insert or update by calling an API it takes care of all dependencies.

             

            Really? Where did you come up with this bizzarre? You should really read the Wiki link posted by Ramin.

             

            Except: "In most procedural languages, an API specifies a set of functions or routines that accomplish a specific task or are allowed to interact with a specific software component"

             

            Read an example of API http://www.oracle-base.com/articles/11g/dbfs-apis-11gr2.php

            • 4. Re: Ccreation of API
              Billy~Verreynne

              vinod2303 wrote:

               

              You will never create an API. API's are provided by oracle and you just use them.  API's are used mainly because you should never do direct insert or update on any base tables in Oracle as the data gets corrupted as you will be not updating the other tables which are dependent on this data. But if you insert or update by calling an API it takes care of all dependencies. Hope it helps.

              Wrong.

               

              APIs should be created ALL the time. Your PL/SQL application should use a custom developed API for (at minimal)

              - instrumentation

              - exception management

              - message logging

               

              If your PL/SQL application is the back-end for a Java/C# application, then your ENTIRE application needs to be an API for that Java/C# client application to use.

               

              In basic terms - an API takes a technical complexity (like recording processing stats for instrumentation) and abstract it, allowing the application to easily make use of that technical complexity.

               

              For example, for instrumentation you want to record v$ session stats at the start of the process, record it again at the end of the process, determine the delta, discard stats that have not changed, and save the remaining stats to a process stats table for analysis or baselining.

               

              Instead of each PL/SQL application process doing these steps, it is done by the API - and all the app code needs to do is call the abstract calls StartProcess() and EndProcess() to have its processing stats recorded.

               

              You need to evaluate each and every component of your application and determine which of these need to be designed and written as local APIs for that application's use, and which should be done as a common and generic cross-application API.