declare Plg_Pledge_Date as STRING rather than DATE/DATESTR, am not sure what is DATESTR
Plg_Pledge_Date IS STRING;
Main Topics
Browse All TopicsI am writing a program in Pro*C with embedded SQL commands. My program inputs data from a tab delimited text file, copies the values into the Pro*C variables and then inserts the values into an Oracle database table. I have a problem with the date columns in my table. Whenever the value in the text file for a date column is null and I try to insert the value, I keep getting the error: "ORA-01480: trailing null missing from STR bind value". There is no problem if the variable (Plg_Pledge_Date) has a value in it. My code is as follows:
EXEC SQL BEGIN DECLARE SECTION;
...
DATESTR Plg_Pledge_Date;
...
EXEC SQL END DECLARE SECTION;
/* Other code */
EXEC SQL
INSERT INTO AXRRCIF (PLG_PLEDGE_DATE, ... )
VALUES
(...TO_DATE(:Plg_Pledge_Da
...
);
POSTORA;
I have tried to get rid of the error, but to no avail. Would really appreciate anybody's help.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: slightwvPosted on 2005-09-14 at 13:27:36ID: 14884548
First, from what you've described: Why are you writing a C program to do this? There are better ways to do this: External tables or SQL*Loader come to mind.
I've not messed with ProC but if memory serves, a null pointer in C is different than a null in Oracle. Maybe something like setting the bind variable to an empty string ('') before the insert. Also look for a proC version of dbnull.value (that's a .Net null value. I'm sure proC has something similar).