Tuesday, November 27, 2012

Airlines on steroids




Jet airways as per recommendation went from 321 to 598



Spicejet as per recommendation went from 31 to 46

Its high time to book some profits guys ..... 50% returns in a month doesn't happen everyday....

Greed is good and bad but it depends on ypur personal appetite to sell it or hold.... 

Happy Investing...  :-)


*I have every right to be wrong on what I write..



Sunday, November 18, 2012

DBMS_EPG - The Embedded PL/SQL Gateway in Oracle 11g Database Release 2

Dear Guys,
This is a virtual rip off from Tim's article at the location

http://www.oracle-base.com/articles/10g/dbms_epg_10gR2.php

This is for my reference and ease,if someone finds it useful thank Tim@Oracle-base.com for this article.


The administration of Database Access Descriptors (DADs) for the XML DB HTTP server is performed using the DBMS_EPG package. This article presents a simple example of its use.
First we must ensure that we have access to the SCOTT sample schema and the XDB schema.
CONN sys/password AS SYSDBA

-- Create SCOTT schema if you don't currently have it.
@$ORACLE_HOME/rdbms/admin/utlsampl.sql
ALTER USER scott IDENTIFIED BY tiger ACCOUNT UNLOCK;
Next we use the CREATE_DAD procedure to create a database access descriptor with an associated virtual path.
BEGIN
  DBMS_EPG.create_dad (
    dad_name => 'my_epg_dad',
    path     => '/my_epg_dad/*');
END;
/
The current mappings for a specific DAD can be retrieved using the get_all_dad_mappings procedure.
SET SERVEROUTPUT ON SIZE UNLIMITED
DECLARE
  l_paths  DBMS_EPG.varchar2_table;
BEGIN
  DBMS_EPG.get_all_dad_mappings (
    dad_name => 'my_epg_dad',
    paths    => l_paths);

  DBMS_OUTPUT.put_line('Mappings');
  DBMS_OUTPUT.put_line('========');
  FOR i IN 1 .. l_paths.count LOOP
    DBMS_OUTPUT.put_line(l_paths(i));
  END LOOP;
END;
/
Mappings
========
/my_epg_dad/*

PL/SQL procedure successfully completed.

SQL>
The mappings associated with existing DADs can be altered using the UNMAP_DAD and MAP_DAD procedures.
BEGIN
  DBMS_EPG.unmap_dad (
    dad_name => 'my_epg_dad',
    path     => '/my_epg_dad/*');

  DBMS_EPG.map_dad (
    dad_name => 'my_epg_dad',
    path     => '/my_epg_dad/*');
END;
/
The SET_DAD_ATTRIBUTE procedure is used to associate attributes with the DAD. In the example below the database-username and default-page attributes are set for the DAD.
BEGIN
  DBMS_EPG.set_dad_attribute (
    dad_name   => 'my_epg_dad',
    attr_name  => 'default-page',
    attr_value => 'home');

  DBMS_EPG.set_dad_attribute (
    dad_name   => 'my_epg_dad',
    attr_name  => 'database-username',
    attr_value => 'SCOTT');
END;
/
The attributes associated with a specific DAD can be retrieved using the GET_ALL_DAD_ATTRIBUTES procedure. The following example should produce a list of attributes, but at the time of writing this procedure does not appear to work.
SET SERVEROUTPUT ON SIZE UNLIMITED
DECLARE
  l_attr_names   DBMS_EPG.varchar2_table;
  l_attr_values  DBMS_EPG.varchar2_table;
BEGIN
  DBMS_OUTPUT.put_line('Attributes');
  DBMS_OUTPUT.put_line('==========');

  DBMS_EPG.get_all_dad_attributes (
    dad_name    => 'my_epg_dad',
    attr_names  => l_attr_names,                       
    attr_values => l_attr_values);

  FOR i IN 1 .. l_attr_names.count LOOP
    DBMS_OUTPUT.put_line(l_attr_names(i) || '=' || l_attr_values(i));
  END LOOP;
END;
/
The GET_DAD_ATTRIBUTE function is used to retrieve the value of a specific attribute, and proves that the attributes are being set correctly, despite the output of the previous example.
SET SERVEROUTPUT ON SIZE UNLIMITED
DECLARE
  l_attr_name   VARCHAR2(30);
  l_attr_value  VARCHAR2(30);
  
  PROCEDURE my_get_dad_attribute (p_dad_name   IN  VARCHAR2,
                                  p_attr_name  IN  VARCHAR2) AS
    l_attr_value  VARCHAR2(30);
  BEGIN
    l_attr_value := DBMS_EPG.get_dad_attribute (
                      dad_name  => p_dad_name,
                      attr_name => p_attr_name);
  
    DBMS_OUTPUT.put_line(p_attr_name || '=' || l_attr_value);
  END;
BEGIN
  DBMS_OUTPUT.put_line('Attribute');
  DBMS_OUTPUT.put_line('=========');

  l_attr_name  := 'authentication-mode';
  my_get_dad_attribute('my_epg_dad', 'default-page');
  my_get_dad_attribute('my_epg_dad', 'database-username');
  my_get_dad_attribute('my_epg_dad', 'authentication-mode');
END;
/
Attribute
=========
default-page=home
database-username=
authentication-mode=

PL/SQL procedure successfully completed.

SQL>
The DELETE_DAD_ATTRIBUTE procedure is used to remove DAD attributes.
BEGIN
  DBMS_EPG.delete_dad_attribute (
    dad_name   => 'my_epg_dad',
    attr_name  => 'default-page');
END;
/
The AUTHORIZE_DAD procedure is used to enable access to the specified schema via the DAD. If the user parameter is not specified the current user is assumed. If multiple users are authorized the database-username attribute is used to decide which one to use.
BEGIN
  DBMS_EPG.authorize_dad (
    dad_name => 'my_epg_dad',
    user     => 'SCOTT');
END;
/
The authorization can be reversed using the DEAUTHORIZE_DAD procedure.
BEGIN
  DBMS_EPG.deauthorize_dad (
    dad_name => 'my_epg_dad',
    user     => 'SCOTT');
END;
/
Once the DAD is configured we need to compile a procedure into the SCOTT schema so that the DAD can be tested.
CREATE OR REPLACE PROCEDURE scott.home IS
BEGIN
  HTP.htmlopen;
  HTP.headopen;
  HTP.title('This is a test page!');
  HTP.headclose;
  HTP.bodyopen;
  HTP.print('This is a test page! DateTime: ' || TO_CHAR(SYSTIMESTAMP));
  HTP.bodyclose;
  HTP.htmlclose;
END home;
/
SHOW ERRORS
The embedded HTTP server should register itself automatically with the listener. The XML DB documentation suggests that port 8080 should be presented for HTTP access automatically. In my experience this does not seem to be the case, so I was forced to added the following entries into the DESCRIPTION_LIST of the listener.ora file. The listener should be reloaded or restarted before any tests are performed.
(DESCRIPTION=
  (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=8080))(Presentation=HTTP)(Session=RAW)
)
(DESCRIPTION=
  (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=2100))(Presentation=FTP)(Session=RAW)
)
The DAD can now be tested by calling the following URL from a browser.
http://<server-name>:8080/my_epg_dad/home
Once you've convinced yourself that the DAD works you ar3 ready to develop PL/SQL web applications using the PL/SQL Web Toolkit or PL/SQL Server Pages.
If you wish to enable anonymous access to the XML DB repository, the following code creates the "<allow-repository-anonymous-access>" element if it is missing, or updates it if it is already present in the xdbconfig.xml file.
CONN sys/password AS SYSDBA

SET SERVEROUTPUT ON
DECLARE
  l_configxml XMLTYPE;
  l_value     VARCHAR2(5) := 'true'; -- (true/false)
BEGIN
  l_configxml := DBMS_XDB.cfg_get();

  IF l_configxml.existsNode('/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access') = 0 THEN
    -- Add missing element.
    SELECT insertChildXML
           (
             l_configxml,
             '/xdbconfig/sysconfig/protocolconfig/httpconfig',
             'allow-repository-anonymous-access',
             XMLType('<allow-repository-anonymous-access xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">' ||
                      l_value ||
                     '</allow-repository-anonymous-access>'),
             'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
           )
    INTO   l_configxml
    FROM   dual;

    DBMS_OUTPUT.put_line('Element inserted.');
  ELSE
    -- Update existing element.
    SELECT updateXML
           (
             DBMS_XDB.cfg_get(),
             '/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access/text()',
             l_value,
             'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
           )
    INTO   l_configxml
    FROM   dual;

    DBMS_OUTPUT.put_line('Element updated.');
  END IF;

  DBMS_XDB.cfg_update(l_configxml);
  DBMS_XDB.cfg_refresh;
END;
/
Once the the "<allow-repository-anonymous-access>" element is set to "true", anonymous access to the XML DB repository is enabled by unlocking the anonymous database account.
CONN sys/password AS SYSDBA

ALTER USER anonymous ACCOUNT UNLOCK;
Removing anonymous access to the XML DB repository can be accomplished by locking the anonymous database account, or setting the "<allow-repository-anonymous-access>" element back to "false".
If you need to remove the "<allow-repository-anonymous-access>" element entirely, it can be accomplished using the following code.
CONN sys/password AS SYSDBA

SET SERVEROUTPUT ON
DECLARE
  l_configxml XMLTYPE;
BEGIN
  l_configxml := DBMS_XDB.cfg_get();

  IF l_configxml.existsNode('/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access') != 0 THEN
    SELECT deleteXML
           (
              l_configxml,
              '/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access',
              'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
           )
    INTO   l_configxml
    FROM   dual;

    DBMS_XDB.cfg_update(l_configxml);
    DBMS_XDB.cfg_refresh;

    DBMS_OUTPUT.put_line('Element deleted.');
  END IF;
END;
/
The DROP_DAD is used to remove an unwanted DAD.
-- Cleanup the DAD.
BEGIN
  DBMS_EPG.drop_dad (
    dad_name => 'my_epg_dad');
END;
/

-- Lock the users again.
ALTER USER scott ACCOUNT LOCK;

Monday, November 5, 2012

Malabari's Indian Aviation Masala..



Just an introspection of last two decades of Indian aviation history.



A naive man's understanding of how the situation is to check Vijay Mallya's picture last year in news papers and this year.That pretty much sums up what the industry is going through.The king of good times is having a real bad time.



                                      "I am not here to bury Mallya but to praise him."

Incidentally Mallya and myself happen to share a common birthday reminding me of a dialogue from a Hindi movie Taxi 9211 where Nana patekar says "हम दो डक्कनो को इसी दिन पैदा होना था" .I have been following Mallya (on airline sector) ever since the news of  Kingfisher airlines first splashed on Indian (paid) Media.

UB group's ever booming boozing business had advertising budgets underutilized back then in early 2000s .In India you are not supposed to advertise Liquor  instead create a soda brand or Music collection  give the same name as Whiskey,Brandy or wot ever and advertise.

I must say this man had a vision atleast when he started this airline.He was planning to utilize this unspent advertising budgets to spin of an airline modeled out of his contemporary in the west Richard Branson's Virgin Atlantic Airways . In my view by no means can Vijay Mallya be compared to Richard branson other than the looks.One is born with a silver spoon and the other a rags to rich story.


KFA was easier done than said, yes u read it right.

For a person who was a member of the parliment(Rajya Sabha from Karnataka),leader of a political party  (Janatha party led by Dr.Subramaniam Swamy[It seems now he is the only member of the party ]) , close proximity to the power houses in the ministry and enough cash in hand ,lethal combination for business in India to succeed.He had it all.......Thus KFA was created as a gift to his son Siddharth Mallya on his 18th Birthday.The kid nor his father had no idea that this would be a Frankenstein's monster down the line.



His brewing business churned a 40% margin so he had all the right to be as flamboyant as he was.At this point positive news flowed in for him acquiring Shaw Wallace ,reaching No.2 position behind Diageo(cases sold). Sold his chemical company Berger paints for a whopping profit.King of good times was on a roll.


Before we go ahead with the story a small recap.......

A country where a person buying a Mercedes or BMW first checks its mileage and also buys a diesel version so that he can gets subsidized fuel from the govt .A country obsessed with Mileage and Jugaad.

                                                 

The Indian customer wants the best service at the lowest price.
An industry where only one airline Jet airways promoted by Naresh Goyal through his Isle of Man companies survived the carnage through out the years.

Indian airlines serviced the domestic sector whose tickets were more than a luxury in the early 90s.You had to have the right connections at the right place to fly in those times.Things started changing when the Open Skies policy was announced in 1991.
A number of companies enrolled for license breaking the monopoly of the state run carrier.


East-West Airlines-grounded in 1996

*Accused of underworld links
* The company's managing director Thakiyudeen Wahid was shot dead near his Mumbai office.





ModiLuft -Collaboration lufthanasa and Modi group

It has changed hands and names now it is Spicejet owned by Sun group and headed by Neil Mills.



Damania Airways-Damania brothers sold to Skyline NEPC
*Damania was the first airline to offer alcohol on domestic flights in India, offering Whiskey with breakfast on 6am flights.




Skyline NEPC-Chennai based group grounded in 1997
The Chennai based NEPC group, owned by the Khemkas, after acquiring management control in Damania Airways renamed it as Skyline NEPC in May 1995.






Sahara airlines-Owned by sahara India Pariwar(subrata Roy) sold to Jet airways now run as Jetlite.
The buyout was a landmark deal with its own share of controversies.The jetlite branch was recently merged into the brand Jet Konnect.




Continued.......


Thursday, November 1, 2012

Malabari's Aviation stocks


I have a strong belief that the aviation stocks are bound to comeback from current positions .

Some thoughts on the aviation Industry:

Positives:
 3 month Outlook

The capacity reduction caused by the lockout of Kingfisher airlines has definitely improved the traffic for the existing players like Jet airways,Indigo,Spicejet and Go air.

Jet airways and Spicejet are the listed stocks while the other two are privately held.
Last traded price at BSE on 30-Oct-2012 16:00

Jet airways  321.85  BUY
Spicejet        32.10    BUY

The air-passenger data for the monthly of July stands at IndiGo (12.26 lakh), Jet Airways (8.82 lakh), JetLite (3.25 lakh), Air India (8.24 lakh), SpiceJet (8.08 lakh), GoAir (3.16 lakh) and Kingfisher (1.56 lakh)

Jet airways Market share is 26.6% 

Positive news:
1.Jet Airways offers eight business class seats in Konnect.
20-30% seats are Unutilized in all flights so by reconfiguring the 20% seats will ensure premium pricing.
2.Jet Airways in final stages to join Star Alliance.
3.Pursuing Foreign promoters for stake sale.
4. Kingfisher woes.
5. Holiday season.

Spicejet   Market share is 18.8%      

 1.Well poised for stake sale to Foreign promoters(IN talks with Bravia capital)
 2.International routes opening up.
 3.Blue ocean strategy paying dividends eg Kabul sector.
4. Kingfisher woes.
5. Holiday season.
6.Final stages of ATF import.
7.New routes from New Delhi to China and Saudi Arabia.


The long standing demands are being actively looked into by the ministry .Already 4 states have cut ATF customs duty to 4% from 24%.

Demands of the airline industry:
1. Rationalize taxes on jet fuel.
2.Continue the exemption on withholding tax (WHT) on leased planes and remove service tax on first and business class air travel.
3.Aviation turbine fuel (ATF) accounted for about 40 per cent of the total operating costs for airlines in India, the industry has sought reduction in customs duty on ATF, slashing of excise duty to four per cent and making ATF a 'declared good' attracting a uniform four per cent tax across the country, 4.Private domestic airlines have also imposed a surcharge for the wastage of fuel due to the air traffic congestion at Delhi and Mumbai airports .


Private airlines could turn profitable in the December quarter on strong yields and better load factors. The private carriers collectively could post a profit of $120-140 million for the quarter although Air India will keep the sector in the red, says CAPA (the Centre for Asia Pacific Aviation) India.

According to CAPA India, the first quarter was the best in 18 months. All private Indian carriers, excluding Kingfisher*, were profitable. In several cases, this was due to sale-and-leaseback and other income.

*I do not hold any UB group stocks as it is against my conscience to invest in companies that get people intoxicated.