Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
}From: deville@gsi.fr
}Subject: ESQL/C error -1225
}Date: Mon, 22 Nov 93 12:29:42 PST
}X-Informix-List-Id: <news.4920>
}
}ESQL/C Informix (v4.1) returns SOME TIMES -1225 code error
}when my C programm try to insert a text file into database.
}The error message is :
}"Column does not admit a NULL values"
}
}I don't understand why the value is NULL since the file exists
}and is not empty (and privileges are good).
}
}I use a text type in the row declaration.
}I inialize my variable like this:
} $loc_t texte_loc
}
} texte_loc.loc_type=LOCFNAME;
} texte_loc.loc_fname=fichname;
} texte_loc.loc_size=-1; //is it good ?
} texte_loc.loc_oflags=LOC_RONLY;
}
}Usually it works but sometimes no.
}Any suggestion or advice would be great appreciated.
Try ensuring that texte_loc.loc_indicator is set 0. If it is negative,
then it will be treated as a NULL blob, regardless of what happens in the
other fields of the blob.
Because your system gives you semi-random garbage in your blob, you are
getting semi-random null values. And it's only semi-random because the
contents depends on what other functions previously used the stack space
where the blob is allocated.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.