January 17, 2017

Sending mail by Telnet and manually checking connection



Open Command prompt using CMD as administrator

Then Put in this command :

telnet server Name 25

Wait to be invited to next step (ehlo), then put in this command:

EHLO  Domai nanme

After output put in this command:

MAIL FROM: From email address

After output  ("Sender OK"), then put in this command:

RCPT TO: to email address

After output  ("Recipient OK"), then put in this command:

DATA

After output , then put in this command:

Subject: type message

After output , then put in a dot (".") and hit enter.

After output  and confirmation message, then put in this command:

Then 

QUIT

January 1, 2017

Advantages of pragma exception init in ORACLE


1.You can define error message for predefined oracle error number.. But once you declare pragma statement, exception are handled implicitly... No need to raise exception explicitly...

2.User could define error message for predefined ora- error number. I guess this would be advantage of using it..


3.The pragma actually makes it possible to check for errors which are not predefined. the only other way would be to check with 'WHEN OTHERS' clause and then accessing the oracle error code.


4.To enhance application interface and display accurate reason for an error.

December 4, 2016

SQL insert query validation constraints to limit number of records


This is sample of query for  SQL insert query validation constraints to limit number of records lets you want to insert only 1000 records in table .

We can restrict number of rows, but need to add a column on which we can add some constraint ... check below example.!

CREATE TABLE TAB_1000_ROWS
AS SELECT ROWNUM COL1 FROM DUAL CONNECT BY ROWNUM <1001;

ALTER TABLE TAB_1000_ROWS
ADD CONSTRAINT CHECK_CONST CHECK (COL1 BETWEEN 1 AND 1000);

ALTER TABLE TAB_1000_ROWS
MODIFY COL1 NUMBER NOT NULL;

ALTER TABLE TAB_1000_ROWS
ADD CONSTRAINT UNIQUE_COL1 UNIQUE (COL1); -- or we can also use sequence with max as 100 and no-cycle!


after insertion of 100 values it wont allow any new values to get inserted! will throw check or unique constraint! 

November 21, 2016

Azure Management Tools,characteristics,Service Type,Subscription



Azure characteristics

  1. Cloud
  2. Virtualized
  3. Pay per use
  4. Scalable (Elastic)
  5. Self Service Provisioning.(Automation)


Azure service type-

  • SOFTWARE AS A SERVICE(Saas)
  • Platform-as-a-Service (PaaS) 
  • INFRASTRUCTURE AS A SERVICE(IAAS)




Azure management tools

  • Azure portal
  • Windows power shell
  • Azure automation
  • Azure CLI
  • visual Studio


Subscription->Service Admin & Co-Admin & Role base access