cancel
Showing results for 
Search instead for 
Did you mean: 

To insert " NULL " in MS SQL Database

Former Member
0 Kudos

Hi Friends,

We have a scenario where a decimal value is sent from the source and it has to be updated in the MS SQL Database accordingly. If the data is sent for the decimal field, the decimal value gets updated.

We need to insert " NULL " in the database, if no data is passed for that particular field.

Kindly help us in achieving this functionality.

Regards,

Sherin Jose P

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

The allow Nullable in DB is checked actually. I think that is used for mandatory and non-mandatory parameters.

Regards,

Sherin jose P

Former Member
0 Kudos

Hi,

Actually we are doing a Migration project in which we are migrating the interfaces from SeeBeyond to SAP PI.

I have actually seen "NULL" in the database which the SeeBeyond code has inserted. I dont have any idea like how it has been handled in SeeBeyond, the same way it has to be handles in PI. Is there any solution for this.

Regards,

Sherin Jose

Former Member
0 Kudos

Hi,

I think, in MS SQL database, there is a option for each field for allow NULLABLE, besides the field type a small check box to select. If you select this box in table definition, you can insert NULL values into it.

Hope this helps.

Thanks and Regards,

Kalpesh

Former Member
0 Kudos

Hi,

I forgot to mention. We are using Stored Procedures for executing.

Former Member
0 Kudos

Hi,

U cannot insert NULL in decimal field...this is standard for any lanaguage.

Regards,

Manisha

Former Member
0 Kudos

Hi,

Sorry for replying late.

I tried both the options. I tried with NULL and EMPTY STRING, but in both the cases it throwed an error stating " Error converting data type nvarchar to decimal ".

Is there any other way that i could insert a " NULL " in MS SQL Database when no data comes for a decimal field, where the datatype in the DB is Decimal.

Kindly help me solving this issue.

Regards,

Sherin Jose P

Former Member
0 Kudos

Hi,

as per standard rule, I guess u cannot insert NULL in decimal field...it is used in case of char or varchar type of data fields.

Regards,

Manisha

Former Member
0 Kudos

Hi,

And the Data Type at the database side is in Decimal, so we are not able to insert any string value there.

Kindly help us.

Regards,

Sherin Jose P

Shabarish_Nair
Active Contributor
0 Kudos

in the adapter -> processing tab use the option

XML Schema Interpreter

Field
	

Entry

Key Tags Mandatory
	

Set the indicator to specify that there must be conditions in the key tag.

Interpretation of Empty String Values
	

Specify how empty text fields are to be handled.

u25CF      NULL value

In the case of INSERT and UPDATE statements, empty fields are handled like NULL fields (do not exist) and are not inserted in the database.

u25CF      Empty string

In the case of INSERT and UPDATE statements, empty texts are inserted in the columns.

http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm