SQL not-null values

I'm using a MS SQL database with the AppSheet app.    The table has some non-null columns, which are imported into AppSheets as required columns.  The initial value is set to ('') by the app. which makes sense, if I was using java to write to SQL, I'd set the non-null column values to 'value' or '' for blanks.  However, when I try to add a row, the operations fails, with a error message that says:

Unable to add row to table 'Xxxxxxx'. → Cannot insert the value NULL into column 'yyyy', table 'SANDBOX.zzzzzzzzz'; column does not allow nulls. INSERT fails.

Changing the database to allow null values is not an option. 

Any ideas?

 

0 4 318
4 REPLIES 4

Try using a single space instead of a blank string?

@Marc_Dillon that technically works, but it seems like a work around then a solution.  The default initial value the app put in is ('') so for a table that has 100 non-null columns, it's trivial work to change them all (' ').   But I have tables that have more columns that are non-null.  Do you happen to know of bulk changing the initial value for multiple columns at the same time?


@bk108 wrote:

Do you happen to know of bulk changing the initial value for multiple columns at the same time?


That doesn't exist.

 

Maybe @Jonathon has a suggestion or experience with this?

I'm confused with the issue here - the MS SQL database has columns marked as required, and we are trying to add rows without the required data?

Options in order of correctness:

  1. Specify VALID initial values (e.g. FALSE for a Y/N column)
  2. Adjust the database table (normalize or set fields to not required)
  3. Specify dummy initial values in appsheet
  4. Specify dummy default values in the database

If the question is how to bulk edit initial values - nothing I know of off hand, it would be possible to build a chrome extension for this though.

Top Labels in this Space