Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8242473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:10:52+00:00 2026-06-07T21:10:52+00:00

I have an Insert stored procedure where I am inserting into 2 tables. The

  • 0

I have an Insert stored procedure where I am inserting into 2 tables. The second table using the Last_Insert_ID of the first table. Here is my sproc:

    DELIMITER $$

CREATE DEFINER=`root`@`%` PROCEDURE `new_user_create`(

    IN oFarmName      varchar(45),
    IN oFirstName        varchar(45),
    IN oAddress1         varchar(45),
    IN oCity         varchar(45),
    IN oState         varchar(45),
    IN oZip         varchar(45),
    IN oCountry         varchar(45)
)
BEGIN
    insert into intelliair.individual
    ( FarmName, FirstName)
    values ( oFarmName, oFirstName);
       insert into intelliair.address
    (IndividualID, Address1, City, State, Zip, Country)
    Values (Last_Insert_ID(), oAddress1, oCity, oState, oZip, oCountry);
END

Here is how I am testing the query in MySql workbench:

call new_user_create(@myFarm, @MyName, @MyAddress, @MyCity, @MyState, @MyZip, @MyCountry)

There error I get is: “Column Address1 cannot be null”

Where am I going wronng? Is it in the sproc? Or the way I am calling it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:10:55+00:00Added an answer on June 7, 2026 at 9:10 pm

    “Column Address1 cannot be null” indicates that the intelliair.address.Address1 field must be defined not null.

    And, I don’t think that you pre defined value for @MyAddress before passing it to the stored procedure.
    Unless defined it is treated as NULL and hence is the error thrown.

    To cross check values before calling the stored procedure like :

    select @MyAddress;  -- ,@myFarm, @MyName, @MyCity, @MyState, @MyZip, @MyCountry;
    

    Update 1:

    You can call stored procedure by directly inputting values for each of the parameters.
    Example:

    call new_user_create(  
        'my Farm value', -- @myFarm  
        'E B', -- @MyName  
        'My Address is SO', -- @MyAddress1  
        'My City is Coders', -- @MyCity  
        'CA', -- @MyState  
        '12345', -- @MyZip  
        'US' -- @MyCountry
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using devexpress and i have two problems. My insert stored procedure work fine.
I have a stored procedure with multiple insert/select statements. Let's say I'm using the
I have inside a stored procedure: INSERT INTO SitesCategories(SiteID, CategoryID) VALUES(@SITEID, @TempCId); This insert
Parsing some data and inserting it into 3 tables from .NET. Using Table Valued
I have a stored procedure (see below) which inserts data into a physical table
HI, I have an insert statement in a Stored Procedure that requires the value
I have a stored procedure which is called inside a trigger on Insert/Update/Delete. The
Say I have a stored procedure consisting of several separate SELECT, INSERT, UPDATE and
I'm inserting a row using an Oracle stored procedure which is configured to use
i have this procedure for inserting rows in tables(sql server 2005) CREATE PROCEDURE ans_insert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.