Unanswered: Informix - NULL VALUE insertion, need HELP!
Hi, I use informix 9.4.
I use a file named file.data to insert data in my table myDBTable.
My file is non positional and the colomn delimiter is a '|' character.
Here is my current source code:
File file.data delimiter '|' 3;
Insert into myDBTable ( field1, field2, fieldMoney)
Values (f01, f02, f03);
I would like to have my 'fieldMoney' column f03, which is set to NOT NULL and of type money, having a '0' when I add nothing into it. For the moment, I am having an error because it converts my blank into null and cannot insert it.
I am new to this forum, hope it is working well. I greatly thank you for your help.
My table already has a default value. The problem is : when you select data, like my value(f01, f02, f03) , it will put a null value if the field contains a null. It will take the default case only if you don't specify a value. The problem is that I have to specify a value because it is a script running and only in rare case that the column is null.
I guess it would work. I just find it a little heavy to convert null into 0
Making the || go into |0| is a good idea. The problem is that I have other fields and changing the pipes will affect all the other fields (including text fields, I don't need a 0 in them).
Wonder why it is not just like a positionnal way where you can put a value when null.