-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem when used with chunk method #35
Comments
What's the whole error message? |
|
How are you generating this in Laravel? |
Yes |
How? What's the query with |
I forgot to mention that is $query = Articolo::from('BGS_ARTI as articoli')->with('somerelation');
$queryCatMerc = DB::connection('mexal')->table('BGS_ANAMER as root')->select('CKY_MERC')
->where('root.CKY_MERC', '=', '0060000')
->unionAll(
DB::connection('mexal')->table('BGS_ANAMER as childs')
->select('childs.CKY_MERC')
->join('catTree', 'catTree.CKY_MERC', '=', 'childs.CKY_MERC_PADRE')
);
$query->join('catTree', 'articoli.CKY_MERC','=','catTree.CKY_MERC')
->withRecursiveExpression('catTree', $queryCatMerc);
$query->orderBy('articoli.CKY_ART')->chunk(100, function ($articoli) {
//Business logic...
}); |
The issue is that your query selects all columns from both You need to limit the selected columns: Articolo::select('articoli.*')->from('BGS_ARTI as articoli')->... |
Thanks the problem is solved |
I'm tried to using the package in my project to test it out, but when i use the Laravel chunk method on the query, i get the following error: "Column specified multiple times"
I checked the query and i noticed that this package and the Laravel chunk method, use the alias temp_table and this cause the error.
Thanks.
Laravel Version: 8.74.0
Php Version: 8.0
The text was updated successfully, but these errors were encountered: