Sunday, 10 December 2017

Oracle questions-part1

What is Row id and its importance?

For each row in the database, the ROWID pseudocolumn returns the address of the row. Oracle Database rowid values contain information necessary to locate a row:


  • The data object number of the object
  • The data block in the datafile in which the row resides
  • The position of the row in the data block (first row is 0)
  • The datafile in which the row resides (first file is 1). The file number is relative to the tablespace.
Values of the ROWID pseudocolumn have the datatype ROWID or UROWID
Rowid values have several important uses:
  • They are the fastest way to access a single row.
  • They can show you how the rows in a table are stored.
  • They are unique identifiers for rows in a table.
  • Although you can use the ROWID pseudocolumn in the SELECT and WHERE clause of a query, these pseudocolumn values are not actually stored in the database. You cannot insert, update, or delete a value of the ROWID pseudocolumn.
    Ex:   
           SELECT ROWID, last_name  FROM employees   WHERE department_id = 20;


2.Can Rowid be used as primary key?

No, You should not use ROWID as the primary key of a table. If you delete and reinsert a row with the Import and Export utilities, for example, then its rowid may change. If you delete a row, then Oracle may reassign its rowid to a new row inserted later.


3. Oracle data types :

character data type- 
char,
vachar2,
nchar,
nvarchar2

number data types-
number, 
binary_float
binary_double


datetime_datatypes:
date
timestamp
interval-year
interval-day

large_object_datatypes:
BLOB
CLOB
NCLOB
BFILE

rowid_datatypes:
rowId
uRowID




VBScript: How to use Dictionary in VBScript | VBScript objects

=>To declare and create object of a vbscript dictionary: Dim objDictionary Set objDictionary = CreateObject("Scripting.Dictionar...