Wednesday, January 28, 2009

Calling oracle Procedure which return recordsets from PHP

Here is an example of how to fetch records from oracle procedure using cursor which returns a recordset and read it from PHP.
Please create a procedure to get values from a table region_master.

CREATE OR REPLACE PROCEDURE "GETREGIONLISTBYNAMEANDDESC"(
        RegionName In Region_MASTER.region_name%TYPE,
        RegionDesc In Region_MASTER.region_desc%TYPE,
        ResultSet OUT sys_refcursor)
IS
begin
OPEN ResultSet for
    SELECT region_id,region_code,region_name,region_desc,updated_dt FROM Region_MASTER WHERE region_name LIKE '%'|| RegionName || '%'
    AND region_desc LIKE '%' || RegionDesc || '%';
END;

To fetch the results from php write the following code in PHP to get the values.


$curs = OCINewCursor($varOrConnection);
$sqlAssetData = "BEGIN CPM.GETREGIONLISTBYNAMEANDDESC( :regname, :regdesc, :ResultSet); END;";
$resAssetData = ociparse($varOrConnection, $sqlAssetData) or die ('Can not Execute statment');
ocibindbyname($resAssetData, ":regname", &$regname,32);
ocibindbyname($resAssetData, ":regdesc", &$regdesc,32);
ocibindbyname($resAssetData, ":ResultSet", &$curs, -1, OCI_B_CURSOR);                                                                         
ociexecute($resAssetData) or die ('Can not Execute statment');
ociexecute($curs);                                                                                                                            
while (OCIFetchInto($curs,&$ResultSet)) {                                                                                                     
   echo "
";
    print_r($ResultSet); 
   echo "";
}

Monday, January 05, 2009

Error Your password has expired. Please contact administrator to reset it while logging oracle portal

If you get this error "Your password has expired. Please contact administrator to reset it." in oracle portal, The solution is 
STEP 1:Login sqlplus as dba.
STEP2: Enter the following "execute orasso.WWSSO_OID_INTEGRATION.reset_passwd('portal username',null,'new password');"
STEP3: Login into your new portal with this password.


Thursday, December 11, 2008

My Oracle account scott is locked after i have installed oracle 10g

After you have installed oracle 10g, Most of the accounts are locked in the begining.

Try giving the following command to unlock this

Alter user scott identified by tiger account unlock

Friday, June 13, 2008

How to open SAP automatically

Go to folder
Step 1: C:\program files\SAP\FrontEnd\SAPgui
Step 2: There will be a file sapshcut.exe.
Step 3: Create a batch file and put the following in it as contents and execute
start sapshcut.exe -system= -user= -pw=
-client=

How to logon via sapgui without entering u sername and password

sapgui640 from each log to enter a password (to)
1、Start > Run > sapshcut.exe
2、Start > Run > regedit
HKEY_CURRENT_USER \ Software \ SAP \ SAPShortcut \ Security
Change value of EnablePassword from 0 to 1
3, SAP sign of a shortcut.