for now I worked around with
DB::table('host_armory')->get();
But I would like to let my answer open: Should it be like this or is there a solution?
Thanks :)
First the explanation why it does a select on host_armories from the documentation:
By convention, the "snake case", plural name of the class will be used as the table name unless another name is explicitly specified.
See: https://laravel.com/docs/5.7/eloquent#defining-models (table names)
You can overwrite it on your model class by adding the table variable.
use Illuminate\Database\Eloquent\Model;
class HostArmory extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'host_armory';
}
You can try something like this.
set @SQLQuery = 'update ' +@tablename+ ' set Flag1 = ''new'' where [Flag1] = '+@flag1+' AND Flag1 IN (SELET TOP 200 Flag1 FROM ' +@tablename+ 'WHERE [Flag1] = '+@flag1+')';
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community