Oracle Error list and solutions

ORA-12162: TNS:net service name is incorrectly specified [oracle@Grid-EM ~]$ echo $ORACLE_SID oraworld [oracle@Grid-EM ~]$ echo $ORACLE_HOME /oracle/product/11.2.0/dbhome_1 [oracle@Grid-EM ~]$ echo $TNS_ADMIN   [oracle@Grid-EM ~]$ sqlplus /nolog   SQL*Plus: Release 11.2.0.1.0 Production on Sat Oct 9 13:59:01 2010   Copyright (c) Read More …

Like Operator alternative in a decode function

select dist_id,roll_no,sex,edu,per,gen,chil,total, decode(REGEXP_SUBSTR(ff,’1′), 1,’Y’) FF, decode(REGEXP_SUBSTR(ff,’2′), 2,’Y’) DEP, decode(REGEXP_SUBSTR(ff,’3′), 3,’Y’) ANS, decode(REGEXP_SUBSTR(ff,’4′), 4,’Y’) ORP, decode(REGEXP_SUBSTR(ff,’5′), 5,’Y’) TRIBAL from VIVA_COTA_s /////////////////// SELECT dt,CASE WHEN dt like ‘%123%’ THEN ‘Match’   7         ELSE ‘Not Matched’   8         END With_case   9        ,DECODE(REGEXP_SUBSTR(dt,’123′),NULL,’Not Read More …

Connect Oralce using PHP

::Data Select from orale:: <?php $db_test = ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.10.211)(PORT=1522)) (CONNECT_DATA=(SID=iis)))’; $c     = oci_connect(‘registrar3’, ‘registrar3’, $db_test); $q         = “select * from CONTACT”; $stmt     = oci_parse($c, $q); oci_execute($stmt, OCI_DEFAULT); while ($row = oci_fetch_array($stmt, OCI_ASSOC)) { echo $row[‘FIRSTNAME’].”\n”; } oci_free_statement($stmt); oci_close($c); ?> ::Insert Data Read More …