yajra / pdo-via-oci8

PHP PDO_OCI functions via OCI8 extension
Other
88 stars 63 forks source link

ORA-12533: TNS:illegal ADDRESS parameters #77

Open digitlimit opened 4 years ago

digitlimit commented 4 years ago

Summary of problem or feature request

I am running Laravel 6 I'm getting the error below:

ORA-12533: TNS:illegal ADDRESS parameters

My .env
DB_CONNECTION=oracle
DB_HOST=127.0.0.1
DB_POST=1521
DB_DATABASE=XE
DB_USERNAME=HR
DB_PASSWORD=hshahashs

My controller:

namespace App\Http\Controllers;

use App\Models\Employee;

class HomeController extends Controller
{
    public function index(){

        $employees = Employee::all();
        dd($employees);
    }
}

Models

<?php
namespace App\Models;

use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;

class Employee extends Eloquent {

    protected $connection = 'oracle';

    protected $table = 'employees';

    // define binary/blob fields
//    protected $binaries = ['content'];

    // define the sequence name used for incrementing
    // default value would be {table}_{primaryKey}_seq if not set
//    protected $sequence = null;

}

I tried this directly and it works without the package

       $conn = oci_connect("HR", "hshahashs", "localhost/XE");
        $stdi = oci_parse($conn, "SELECT * FROM employees");

        if(oci_execute($stdi)){
            dd(oci_fetch_assoc($stdi));
        }

Please assist

wernerm commented 4 years ago

Please try to include the code that's producing the error.

digitlimit commented 4 years ago

@wernerm I have udpated issue