Subject Strange Data in my inserts
Author Colin Fraser
Hi,

I have a table with a few varchar fields which have default '' and not null
specified for them.

When inserting data I am ending up with strange characters in the fields
that I do not explicitly set. I would have expected them to be set to an
empty string.

What I have is a IB_Cursor with a select * from table sql clause. I then use
the IB_Cursor.Insert, .Edit and .Post where required. In some cases I do not
set all the field values (using FieldByName) before posting and this is
where I am getting this strange data in my tables.

Some of the results from IB Monitor are shown below (I had to turn
PreparedEdits on in order to get this... but this is what is ending up in
the DB.)

This is also repeated in the output twice for some reason... does this mean
it is getting executed twice??

I don't know where it is getting the char for the strings (the ones that are
not set with FieldByName). Also, the integer for the post_code is from no
where, although it seems to remain the same between runs. Some of the fields
have longer 'rubbish' in other records.

GetRequired and GetServerDefaults are both False. Running on IB 5.6.

Any help appreciated.

Regards

Colin
---------------------From IB Monitor--------------------------
SECONDS = 0.120
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 12927724
STMT_HANDLE = 12934260
PARAMS = [ Version 1 SQLd 29 SQLn 29
CT_CONTACT.CONTACT_ID = 34790
CT_CONTACT.STAFF_CONTACT = 'F'
CT_CONTACT.DEBTOR_CONTACT = 'F'
CT_CONTACT.PARENT_CONTACT_ID = 0
CT_CONTACT.NAME = 'Smith'
CT_CONTACT.QUICK_CODE = ''
CT_CONTACT.TITLE = ' '
CT_CONTACT.SALUTATION = 'Wendy'
CT_CONTACT.COMPANY_TITLE = ''
CT_CONTACT.PHONE = ' '
CT_CONTACT.FAX = ' '
CT_CONTACT.MOBILE = ''
CT_CONTACT.EMAIL = ' '
CT_CONTACT.POSTAL_ADDRESS1 = ''
CT_CONTACT.POSTAL_ADDRESS2 = ''
CT_CONTACT.POSTAL_TOWNCITY = ''
CT_CONTACT.POSTAL_COUNTRY = ''
CT_CONTACT.DELIVERY_ADDRESS1 = ''
CT_CONTACT.DELIVERY_ADDRESS2 = ''
CT_CONTACT.DELIVERY_TOWNCITY = ''
CT_CONTACT.DELIVERY_COUNTRY = ''
CT_CONTACT.POST_CODE = 808464432
CT_CONTACT.TIME_STAMP = '15 Mar 2001 16:25:32'
CT_CONTACT.UC_NAME = ''
CT_CONTACT.INITIALS = '
'
CT_CONTACT.HOLD_CREDIT = 'F'
CT_CONTACT.TEMNOTES = <NULL>
CT_CONTACT.GENERAL_NOTES = <NULL>
CT_CONTACT.IN_USE = 'T' ]

SELECT COUNT: 1
UPDATE COUNT: 1

SECONDS = 0.010
----*/


######################################################################
Attention:
The information in this email and in any attachments is confidential.
If you are not the intended recipient then please do not distribute,
copy or use this information. Please notify us immediately by return
email and then delete the message from your computer.
Any views or opinions presented are solely those of the author.
######################################################################