Laravel Eloquent Update Error - laravel

I am trying to update a row with eloquent in laravel 5.5 but i get this error.
In Connection.php line 664:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1769888, `longitud` = -8,4700727 where `id` = '7'' at line 1 (SQL: update `centro` set `updated_at` = 2018-02-19 15:58:01, `latitud` = 43,1769888, `longitud` = -8,4700727 where `id` = 7)
In PDOStatement.php line 107:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1769888, `longitud` = -8,4700727 where `id` = '7'' at line 1
In PDOStatement.php line 105:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1769888, `longitud` = -8,4700727 where `id` = '7'' at line 1

Related

Migration error when using jSON field on MariaDB

After trying to add a new jSon column to my Users table, I am getting an error related to field size. I blame MariaDB because they can't see the future, but is there a way to override this error without changing my field type to BLOB or TEXT?
Here is my up method in the migration:
public function up(){
Schema::table( 'users', function( Blueprint $table ){
$table->json( 'options' )->nullable();
} );
}
This is the error I get:
In Connection.php line 669:
SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row siz
e for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check t
he manual. You have to change some columns to TEXT or BLOBs (SQL: alter table `users` add `opti
ons` json null)
In PDOStatement.php line 129:
SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row siz
e for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check t
he manual. You have to change some columns to TEXT or BLOBs
In PDOStatement.php line 127:
SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row siz
e for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check t
he manual. You have to change some columns to TEXT or BLOBs

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and

I disable "only_full_group_by" on mysql but "laravel" giving above error
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'answer_reactions.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select * from `answer_reactions` where `answer_reactions`.`answer_id` in (147, 156, 165) group by `answer_reactions`.`type`)
in Laravel config\database.php file, inside the mysql driver array add 'strict' => false, and give it a try.
Test with:
GLOBAL sql_mode=(SELECT REPLACE(##sql_mode,'ONLY_FULL_GROUP_BY',''));

Advantage Database Server 8.1 UNIQUE CONSTRAINT multiple columns

I am working on an Advantage Database Server 8.1 and I have created a new table. I want to add a unique constraint for the combination of 2 columns.
I tried
ALTER TABLE TableName
ADD CONSTRAINT ConstraintName
UNIQUE (ColumnName1, ColumnName2)
but I get the error
"ERROR IN SCRIPT: poQuery: Error 7200: AQE Error: State = 42000; NativeError = 2115; [Extended Systems][Advantage SQL Engine]Expected lexical element not found: You are missing the column names. -- Location of error in the SQL
statement is: 33 (line: 2 column: 5)"
Ok the solution I found is:
CREATE UNIQUE INDEX ConstraintName ON TableName (ColumnName1, ColumnName2);

laravel framework webservice error

I am just doing web service for laravel framework, so below error is displayed, I don't know which type of error
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'city' in where clause is ambiguous (SQL: SELECT MIN(room_prize)MIN,MAX(room_prize)MAX from `abserve_hotel_rooms` as `ar` JOIN `abserve_hotels` as `h` ON `ar`.`hotel_id` = `h`.`hotel_id` WHERE 1 AND `city` ="madurai" AND `country` ="india")
You forgot table alias to the fields city and country

Error : ORA-00907: missing right parenthesis

I'm trying to create a simple table but it's giving me an error says:
Error starting at line : 1 in command -
CREATE TABLE dj_abonent
(
nr_klienti int NOT NULL,
emer_klienti varchar2(10),
sasia_cel int
CONSTRAINT dj_klientID PRIMARY KEY(nr_klienti)
)
Error at Command Line : 6 Column : 35
Error report -
SQL Error: ORA-00907: missing right parenthesis
00907. 00000 - "missing right parenthesis"
*Cause:
*Action:
Error starting at line : 1 in command -
CREATE TABLE dj_abonent
(
nr_klienti int NOT NULL,
emer_klienti varchar2(10),
sasia_cel int,
CONSTRAINT dj_klientID PRIMARY KEY(nr_klienti)
)
Error at Command Line : 1 Column : 14
Error report -
SQL Error: ORA-00955: name is already used by an existing object
00955. 00000 - "name is already used by an existing object"
*Cause:
*Action:
You are missing a comma:
CREATE TABLE dj_abonent
(
nr_klienti int NOT NULL,
emer_klienti varchar2(10),
sasia_cel int, -- this one right here
CONSTRAINT dj_klientID PRIMARY KEY(nr_klienti)
)
Your have the second error because you use dj_klientID as name for both of the constraints. They have to be unique.
Try renaming one of the two constraints and also your second query will be fixed.

Resources