Skip to content

Issue while using sybase with different schemas #40

Open
@vservin

Description

@vservin

Hello I got this error from the logs while trying to make a model::find(12345789);

Undefined variable: tipos (SQL: select top 1 * from [adminSchema].[Alumnos_Expediente] where [adminSchema].[Alumnos_Expediente].[id_documento] = 12345789) {"userId":1,"email":"[email protected]","exception":"[object] (Illuminate\Database\QueryException(code: 0): Undefined variable: tipos (SQL: select top 1 * from [adminSchema].[Alumnos_Expediente] where [adminSchema].[Alumnos_Expediente].[id_documento] = 12345789) at /var/www/html/expeleLaravel/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, ErrorException(code: 0): Undefined variable: tipos at /var/www/html/expeleLaravel/vendor/uepg/laravel-sybase/Database/SybaseConnection.php:177)

My model is well configured given that i had to make a custom find function that implemented a whereRaw, in a whereRaw the query does work, in a normal where it doesn't.
class Documento extends Model {
protected $connection = 'sybase';
protected $table = 'adminSchema.Documento';
protected $primaryKey = 'id_documento';
public $incrementing = false;
public $timestamps = false;
public static function find($search){
return static::whereRaw("id_documento = $search")->first();
}

I believe this error has to due that the package can't get the column type, if it's a string or number or what

but I emphasis that my model is correct, since the whereRaw works.
I could solve the find method with my custom find, but now i'm stuck while trying to make a validation with "exists:sybase.adminSchema.ActaNacimiento,id_documento"
I hope we can solve this error, thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions