rbragg Posted January 28, 2008 Share Posted January 28, 2008 <?php $queryInsertParent4Student = " INSERT into schema.STUDENT (parent_num) SELECT parent_num FROM schema.PARENT WHERE email = '" . $_SESSION['pMail'] . "'"; ?> Why does the above give me this error: ORA-01400: cannot insert NULL ... when the session is tested and set AND there IS a parent_num for this email in the db? ??? I think I'm just being dumb here. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/88263-cannot-insert-null-error/ Share on other sites More sharing options...
fenway Posted January 28, 2008 Share Posted January 28, 2008 ORA? As in Oracle? Quote Link to comment https://forums.phpfreaks.com/topic/88263-cannot-insert-null-error/#findComment-451643 Share on other sites More sharing options...
rbragg Posted January 28, 2008 Author Share Posted January 28, 2008 LOL! Yes. This type of query works in other places in the environment so I thought it could be asked as a general question. Quote Link to comment https://forums.phpfreaks.com/topic/88263-cannot-insert-null-error/#findComment-451647 Share on other sites More sharing options...
gizmola Posted February 2, 2008 Share Posted February 2, 2008 What might help you is to echo out the value of the query string you've created. echo "\n"; View the source for the page and see if the query is what you expect, and that it's something you can run in sqlplus. I'm thinking it isn't. Quote Link to comment https://forums.phpfreaks.com/topic/88263-cannot-insert-null-error/#findComment-455962 Share on other sites More sharing options...
gluck Posted April 9, 2008 Share Posted April 9, 2008 You seem to have a constraint on the field like not null and your query is trying to insert a null in tha field. Quote Link to comment https://forums.phpfreaks.com/topic/88263-cannot-insert-null-error/#findComment-513412 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.