Wednesday, March 14, 2018

Oracle Database: DROP, TRUNCATE, DELETE Operations

Oracle Database Drop and Truncate are DDL  (Data Definition Language) Command while Delete is DML (Data Manipulation Language) Command. We will learn about each of them in detail below,

Drop:   Drop oracle command is used to remove complete table from database. As drop is DDL so commit operation not required after drop query.

Syntax : Drop Table Table_Name [Purge]; 
Table_Name can be any table name that you want to delete from database. Purge is optional keyword.

Drop Table have purge option. Purge is used to delete table permanently from database. If you have used purge with drop table then that table directly deleted from database can not recovered if required.Table delete with drop and purge will not stored into recycle bean.

Truncate :  Truncate Oracle Command is used to remove all rows i.e. all record from table. This command not delete table definition from database.Truncate is DDL command so commit not required after truncate oracle table. Truncate is faster than Delete. Where clause can not be used with Truncate command.

Syntax : Truncate Table Table_Name

Delete : Delete Oracle Command is used to remove all, single, multiple rows i.e. all record from table. This command not delete table definition from database.Delete is DML command so commit required after Delete command to save changes permanently.  Delete can be used with where clause.
Delete is time consuming and slow compared to truncate.

Syntax :  Delete Table Table_Name; Commit;

Delete multiple Rows/Records base on some criteria:
Syntax : Delete from Table_Name [where Condition]

Read More

Sunday, March 11, 2018

Oracle Database ALTER Table

Hello In this post we are going to learn ALTER oracle command.

Oracle ALTER keyword is used to change properties of existing oracle object i.e. Table.

Oracle ALTER Table is used to add,modify,delete existing column of Table. We can change Database name using Oracle ALTER table keyword.

Oracle Syntax Add Single Column & Multiple Columns To Exiting Table as shown below

ALTER Table Table_Name
ADD Column_Name Datatype

ALTER Table Table_Name
(Column_Name1 Datatype,
Column_Name2 Datatype,
Column_Name3 Datatype,
Column_NameN Datatype   

Above Add keyword is used to add new column to an existing table.

Oracle Syntax Modify Single Column & Multiple Columns To Exiting Table as shown below

ALTER Table Table_Name
MODIFY Column_Name Datatype

ALTER Table Table_Name
(Column_Name1 Datatype,
Column_Name2 Datatype,
Column_Name3 Datatype,
Column_NameN Datatype   

Above Modify keyword is used to modify existing column from an existing table.

Oracle Syntax Drop Columns of an Exiting Table as shown below

ALTER Table Table_Name

Above Drop keyword is used to delete column of an Table.

Oracle Syntax Rename Columns of an Exiting Table as shown below

ALTER Table Table_Name
RENAME COLUMN Column_Name_Old TO Column_Name_New

Above Rename Column keyword is used to rename existing column name Column_Name_Old  to new name Column_Name_New.

Oracle Syntax Rename Existing Table Name as shown below

ALTER Table Table_Name_Old
RENAME TO Table_Name_New

Above Rename keyword is used to change existing table name Table_Name_Old to Table_Name_New.

Read More

Saturday, March 10, 2018

Oracle Database Create Table

Oracle Create table command used to create table in oracle database.

Table is main oracle entity used to store data in oracle database.

Oracle Create Table Syntax:
In Oracle create table syntax user need to specify Table name and Columns like below,

Create Table Table_Name
Column_Name1 DataType,
Column_Name2 DataType,
Column_Name3 DataType,
Column_NameN DataType

In above create table syntax Table_Name can be any name that user want to name table. Column_Name1  can be any name that user wants to give to its column.Every column must  have Datatype. Datatype can be anything i.e. varchar,Number,date etc.We will detaily discuss about oracle datatype in upcoming posts.

We can also specify oracle column value should be null or not by specify NULL or NOT NULL in create table command as like below,

We can specify column NULL like below in create table query then value of the column can be null

Create Table Table_Name
Column_Name1 DataType NULL,
Column_Name2 DataType NULL,
Column_Name3 DataType NULL,
Column_NameN DataType NULL

So if we specify column NULL like above then we have to compulsory specify value to column while inserting record.

We can specify column NOT NULL like below in create table query then value of the column can not be null.

Create Table Table_Name
Column_Name1 DataType NOT NULL,
Column_Name2 DataType  NOT NULL,
Column_Name3 DataType NOT NULL,
Column_NameN DataType NOT NULL

So if we specify column NOT NULL like above then we can exclude column or set blank value to column while inserting record.

Create Primary Key :
Primary key is used to uniquely identify the record from table. Primary key should not be NULL.

We can specify column as primary key like below,
Constraint Constraint_Name PRIMARY KEY(Column_Name)

Here Constraint_Name can be anything and Column_Name must be table column that we have to assign as primary key.

So create table command look like below,

Create Table Table_Name
Column_Name1 DataType NOT NULL,
Column_Name2 DataType  NOT NULL,
Column_Name3 DataType NOT NULL,
Column_NameN DataType NOT NULL
Constraint Constraint_Name PRIMARY KEY(Column_Name1)

Click Here for ALTER TABLE ORACLE article.

Read More

Friday, March 2, 2018

Oracle Database Introduction

Oracle is Relational Database (RDBMS) used to Store and Retrieve Data in the form of Table Structure.

Oracle used SQL (Structured Query Language) language for create, read, update and delete operations to read and write data to and from oracle database tables.

Oracle is mostly used by big companies in their enterprise applications .

Oracle have different editions depend upon type of industry and its application. We need to select appropriate edition for our use. These editions are as mentioned below

Oracle Enterprise Edition- Most robust package include all advance features i.e. security also
Oracle Standard Edition - Base Functionalities for the user
Oracle Express Edition - Free Edition
Oracle Lite - For Mobile Devices

For more information & download Oracle Database visit below link

Click Here to learn how to create table in oracle database.

Read More

Wednesday, May 20, 2015

PhoneGap: Mobile App Development Framework

PhoneGap: Mobile App Development Framework

What is PhoneGap :

PhoneGap is a mobile application development framework by adobe system to make one mobile application for all mobile operating system. So we can call PhoneGap as platform independent mobile app development. The app made using PhoneGap can run on all famous mobile operating systems like Android, ios, blackberry and windows. So Nowadays PhoneGap becomes very famous due to all these features.

Languages Used:  To develop mobile application using PhoneGap, developer does not required the knowledge about the mobile languages or mobile operating system languages but just required to knowledge about web development language HTML,CSS and JavaScript.

When to use PhoneGap : The developer who want to put his website into the mobile application either online or offline can use PhoneGap to develop mobile application fast using website technology languages.

So before starts working with PhoneGap, you must have knowledge about web technology languages like HTML,CSS and JavaScript.We can not use the native mobile operating system component i.e android,ios,blackberry and windows services and component while developing app using PhoneGap.

We will see how to setup environment to use PhoneGap and how to develop app using it in upcoming tutorial.

Thanks for reading the article. Give your valuable feedback we will come with more interesting articles soon.
Read More

Saturday, May 16, 2015

Android Intent

Android Intent: Android intent is a object which carrying an intent or message from one component to another component inside an application or outside the application. Android intent is a communication medium between any android core components- services,activities and broadcast receivers.

We can use android intent to send data from one activity to another activity with application. Android intent used while to call native android services from our application like calling camera, web browser, calender or any other native android service.

Intent Types:  There are two types of intent
  • Explicit Intent: Explicit intent specify the component to start by name directly because we already know the component name that we have to call. We mostly use this intent to start the component in our own application. For example to start a new activity on user request we directly specify the activity name in intent object.
    // Explicit Intent by specifying its class name i.e SecondActivity.class
    Intent i = new Intent(this, SecondActivity.class);
    // Below we are sending two parameter from one activity or screen to another activity or screen 
    i.putExtra("Param1", "ABC");
    i.putExtra("Param2", "123");
    // Starts Second Activity
    Then the second activity must invoke method getExtras() to receive the parameter data sent by first activity as shown below 
    // Get bundle object in your second activity code
    Bundle extras = getIntent().getExtras();
    // Extract data using passed keys as described by first activity i.e Param1 and Param2
    String value1 = extras.getString("Param1");
    String value2 = extras.getString("Param2")

  • Implicit Intent: Implicit intent does not specify the name of component directly instead it specifies the action name which we have to perform which allows a component from another app to handle it. For example if we have to take photo in our app so instead of making camera functionality in our app we can use native android camera to catch the photo using implicit intent. 
    // Below intent code opens web url in another application  
    Intent intent=new Intent(Intent.ACTION_VIEW);  

So like this we can use intent in our android application to use android system native functions using implicit intent and to communicate between different android component (Activities,Services and broadcast receivers) using explicit intent.

Thanks for visit and reading the article. We will post more android related article soon. Please give your valuable feedback.

Read More

Saturday, May 2, 2015

Android Components:

What is Android?

Android is a Software stack for mobile devices which includes an operating system,middle-ware and key applications.

Android operating system is Linux based Operating system.

Android SDK provides the tool and API to start developing android applications in Java programming language.

Android offers its own java virtual machine called Dalvik Virtual Machine. Dalvik VM is optimized JVM to run compiled java class files in order to counter the handled device limitations such as memory, processor speed and power.

Android Components are the main part of android application. Each components has a different point through which system can enter your app. Each components plays a specific role.

There are four main android components. Each plays different role and have different life cycle. The four main android components are as below.

1) Activities : The building block of user interface is the activity. While it is possible for the activities do not have user interface. Each activity is independent even they work together. Each activity is implemented as derived class of Activity Class. An application may have many activities but out of many activities one activity is marked as first one that should be presented when application starts. One activity invoke another activity.

2) Services : The services dose not have an user interface, but rather runs in background for an indefinite period of time. Each service extends the Service main class. For example services might play music in background as the user attends to other matter or fetch data from network and make them available to activities. Like the other components services runs  in the main thread of application process.

3) Broadcast Receivers : Broadcast receiver is a components that receives and react to broadcast announcement. Any application can also initiate broadcast- for example, to let the other application know that some data is downloaded to device and is available for them to use. All receivers extend the BroadcastReceiver base class. Broadcast receivers do not display user interface. However they may start an activity in response to information they receive.

4) Content Provider : The content provider makes a specific set of applications data available to other applications. The data can be stored in SQLite database file. The content provider shares data between applications. The content provider extends the ContentProvider base class to implement standard set of methods that enable the other application to retrieve and store data. Application call content provider methods by creating object of ContentResolver. A ContentResolver can talk to any content provider, it cooperate with the provider to manage any inter-process communication that involved.

So these are fundamental components of android. We will see how to activate these components using intent in next article..

Thanks for reading the article. Please give your valuable feedback.


Read More