Error 1048 Mysql
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the
Error Code 1048 In Mysql
company Business Learn more about hiring developers or posting ads with us Stack Overflow mysql error code 1048. column cannot be null Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 column cannot be null mysql million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ERROR 1048 (23000) Column cannot be NULL, however I am inserting valid data up vote 5 down vote favorite
Error Number 1048 Column Cannot Be Null In Codeigniter
There are tons of these posts on Stack Overflow, however from the 20 or so that I looked at they were either coding errors faced when interfacing with MySQL (which I am not trying to do) or simply wanted null values but had their table defined incorrectly. I am seeing an error in MySQL 5.6.19 where I have a column that is not allowed to have a null value. This is fine as
Error Number 1048 Column Name Cannot Be Null In Codeigniter
it shouldn't have a null value. Here is the table desc below. mysql> describe z; +-------+----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+----------+------+-----+---------+----------------+ | a | int(11) | NO | PRI | NULL | auto_increment | | data | char(30) | NO | | NULL | | | t | datetime | YES | | NULL | | +-------+----------+------+-----+---------+----------------+ 3 rows in set (0.00 sec) My problem is that I am inserting valid data.... mysql> insert into z (data, t) values('helloworld', sysdate()); ERROR 1048 (23000): Column 'data' cannot be null There is one other piece of information that might be of some concern... or may not be. I have a trigger and procedure that execute upon the implementation of inserts into this column. However I don't see that it should be a problem due to the trigger being activated after the insert statement completes. Here is the trigger: mysql> show triggers\G *************************** 1. row *************************** Trigger: insertuser Event: INSERT Table: z Statement: begin call triggerproc(sysdate(),user(),(select data from z where a = last_insert_id())); end Timing: AFTER Created: NULL sql_mode: NO_ENGINE_SUBSTITUTION Definer: root@localhost character_set_client: utf8 collation_connection: utf8_general_ci Database Collation: latin1_swedish_ci 1 row in set (0.00 sec) And the Procedure: mysql> show create procedure triggerproc\G *************************** 1. row *************************** Procedure: triggerproc sql_mode: NO_ENGINE_S
here for a quick overview sql error 1048 sqlstate 23000 hibernate of the site Help Center Detailed answers to
Error Number 1048 In Codeigniter
any questions you might have Meta Discuss the workings and policies of this mysql column cannot be null default value site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us http://stackoverflow.com/questions/25154105/error-1048-23000-column-cannot-be-null-however-i-am-inserting-valid-data Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up MySQL Error http://stackoverflow.com/questions/37994365/mysql-error-code-1048-column-cannot-be-null Code: 1048: Column cannot be null up vote 0 down vote favorite I have a query: SELECT COUNT(*) FROM (SELECT vendors_id, merchants_id, SUM(amount) AS amount, SUM(commission_amount) AS commission_amount FROM (SELECT vendors_id, merchants_id, amount, commission_amount FROM (SELECT vendors.id AS vendors_id, merchants_id, SUM(transactions_cash.amount) AS amount, SUM( transactions_cash.commission_amount ) AS commission_amount FROM ibaserver.transactions_cash, ibaserver.vendors, ibaserver.merchants WHERE transactions_cash.vendors_id = vendors.id AND TIME > 1466680920208 AND TIME <= 1466681880067 AND merchants_id = merchants.id GROUP BY transactions_cash.merchants_id ORDER BY transactions_cash.merchants_id) a UNION ALL SELECT vendors_id, merchants_id, amount, commission_amount FROM (SELECT vendors.id AS vendors_id, merchants_id, SUM( transactions_cash_archive.amount ) AS amount, SUM( transactions_cash_archive.commission_amount ) AS commission_amount FROM ibaserver.transactions_cash_archive, ibaserver.vendors, ibaserver.merchants WHERE transactions_cash_archive.vendors_id = vendors.id AND TIME > 1466680920208 AND TIME <= 1466681880067 AND merchants_id = merchants.id GROUP BY transactions_cash_archive.merchants_id ORDER BY transactions_cash_archive.merchants_id) b) s)
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the http://stackoverflow.com/questions/28864836/error-code-1048-sql-state-23000-column-colegiado-id-cannot-be-null company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions http://stackoverflow.com/questions/8793071/error-1048-23000-at-line-1-column-cannot-be-null Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error Code: 1048, SQL State: 23000 Column 'colegiado_id' cannot be null up vote 0 down vote favorite this error "[Error cannot be Code: 1048, SQL State: 23000] Column 'colegiado_id' cannot be null" appears when I try to run the code below, direct in the mysql: start transaction; INSERT INTO EspecialistasColegiados (colegiado_id, especialista_id) ( select col.id as colegiado_id, esp.id as especialista_id from Especialista esp inner join importacao imp ON imp.idimportacao = esp.id left join Colegiado col ON col.nome like concat('%',imp.CURSOS,'%') ); rollback; mysql share|improve this question asked Mar 4 '15 at 21:00 Murilo Valadares 36 cannot be null Could you add the table definitions and some sample data and the expected output to your question? –FH-Inway Mar 4 '15 at 21:59 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote You missed to ask a question. The error is quite obvious though: One of the values in "col.id" from "Especialista" is null, and this is not configured as allowed for "calegiado_id". share|improve this answer answered Mar 4 '15 at 21:04 Mackan 4,02021029 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged mysql or ask your own question. asked 1 year ago viewed 1214 times active 1 year ago Related 1ERROR 1048 (23000) at line 1: Column cannot be null1Failed to run query: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'membersince' cannot be null0SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'post' cannot be null0PHP MYSQL->execute failed: (1048) Column 'title' cannot be null ERROR5ERROR 1048 (23000) Column cannot be NULL, however I am inserting valid data0Integrity constraint vio
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ERROR 1048 (23000) at line 1: Column cannot be null up vote 1 down vote favorite I have a database named "crea" with a table named "assets" and in this table i have 11 column named (name,description,assetType,local,temporary,data,id,create_time,access_time,asset_flags,CreatorID) I also have a directory folder with many picture in .jp2 format (xxxx.jp2) What im trying to do is to bulk insert these picture in the table "assets" of my database, so i decided to do it with 2 shell scripts, the both are in the directory with the pictures. When i launch ./assetadd.sh from the terminal, i get this error from MySQL : ERROR 1048 (23000) at line 1: Column 'data' cannot be null I checked many time and im sure that the column 'data' isnt NULL (Type: LONGBLOB Binaries Null: NO), so i really dont understand why i get this error. Help will be apreciated. Thank you - Script 1 : assetsadd.sh #!/bin/bash path=$(pwd) find $path/ -type f \( -iname *.jp2 \) -exec ./insertjp2.sh {} \; echo "finished!!" - Script 2 : insertjp2.sh #!/bin/bash user="crea" password="crea" database="crea" dbhost="localhost" creator="crea" param=$@ basenam=${param##*/} filenam=${basenam%.*} MYSQL=`/usr/bin/mysql -u$user -p$password -D$database -e"INSERT INTO assets (name,description,assetType,local,temporary,data,id,create_time,access_time,asset_flags,CreatorID) VALUES ('$filenam','$filenam',0,0,0,LOAD_FILE('$param'),'$filenam',UNIX_TIMESTAMP(),1325304546,0,'$creator' );"` echo $param >> assetadd.log echo $MYSQL mysql bash share|improve this question asked Jan 9 '12 at 18:08 Ellan 1015 Any files with ' in their name? –Joachim Isaksson Jan 9 '12 at 18:11 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted From the documentation for LOAD_FILE: Reads the file and returns the file contents as a string. To use this function, the file must be located on the server host, you must specify the full path name to the file,