satishgaudo.com

Understanding technology

Bit of oracle

All the system tables that stores the user defined tables/sequences/object types :
 
user_types
 
USER_TYPE_ATTRS
 
user_sequences
 
user_tables
 
USER_TAB_COLUMNS
 
Code for creating a table for already existing table:
 
CREATE TABLE HIP_TASK_INFO_satish as SELECT HIP_TASK_ID ,
 
HIP_TASK_ID as HIP_TASK_BUDGET_ID,
HIP_TASK_ID as HIP_DUTY_DETAIL_ID,
IS_ACTIVE,
IS_DELETE,
ADDDT
FROM HIP_TASK_INFO
 
Command to rename table :
 
RENAME HIP_TASK_INFO_satish TO HIP_TASK_INFOÂ ;
 
Code example for limits implementaion:
 
SELECT temp.*,rownum FROM (
 
SELECT sp.company_name, sp.contact_phone, sp.office_fax, sp.sub_id, sb.branch_id, sb.branch_url, sp.Office_Address.Address1 || ‘, ‘ || sp.Office_Address.Address2 || ‘, ‘ || sp.Office_Address.Address3 || ‘, ‘ || sp.Office_Address.City || ‘, ‘ || sp.Office_Address.County as address FROM subscriber_primary sp, subscriber_branch sb, subscriber_info si WHERE si.sub_id=sp.sub_id AND sb.sub_id=sp.sub_id AND si.sub_kind_id=4 AND sp.primacy_no=1 AND sb.branch_level = ‘0? ) tempGROUP BY
 
temp.contact_phone, temp.office_fax, temp.sub_id, temp.branch_id, temp.branch_url, temp.address, rownum having rownum>=2 AND rownum<4
Bookmark and Share
Categories: Oracle