OracleException: ORA-01483: invalid length for DATE or NUMBER bind variable

edited October 2012
I get the error in the title with version 2.0.7 of the IQ driver when connecting to an Oracle 11g r2 database. Here is the query, generated SQL (values obscured slightly), and table definition. I am guessing it has something weird to do with the date perhaps?
var rec = NETWORK.Where(n => n.EMP_ID == 236).First();
rec.NT_ACCOUNT = "NT_ACCOUNT";
rec.DOMAIN = "DOMAIN";
SubmitChanges();
UPDATE PRIME_TEAM_OWNER.NETWORK
SET CREDENTIAL = :p0, DOMAIN = :p1, IV = :p2, MOD_BY = :p3, MOD_DATE = :p4, NT_ACCOUNT = :p5, RAS = :p6, REMARKS = NULL, REQUESTED_BY = :p7, TRW_LAN_AGREE_DATE = NULL
WHERE (EMP_ID = 236)
-- p0 = [random_characters]
-- p1 = [DOMAIN]
-- p2 = [random_characters]
-- p3 = [MOD_USER]
-- p4 = [5/19/2006 12:00:00 AM]
-- p5 = [NT_ACCOUNT]
-- p6 = [N]
-- p7 = [REQUESTED_BY]
CREATE TABLE NETWORK
(
EMP_ID NUMBER(38,0),
NT_ACCOUNT VARCHAR2(50 BYTE),
DOMAIN VARCHAR2(50 BYTE),
REQUESTED_BY VARCHAR2(50 BYTE),
TRW_LAN_AGREE_DATE DATE,
REMARKS VARCHAR2(2000 BYTE),
RAS VARCHAR2(1 BYTE),
MOD_BY VARCHAR2(50 BYTE),
MOD_DATE DATE,
CREDENTIAL VARCHAR2(4000 BYTE),
IV VARCHAR2(4000 BYTE)
)

Comments

  • edited October 2012
    Also note: I tried including an update to the MOD_DATE field with both DateTime.Now and DateTime.UtcNow without success, then in a stroke of genius I decided to set MOD_DATE to null - and the query was issued successfully.

    I would like to be able to use an arbitrary date and not just null in future queries, I just hope this helps in narrowing down the issue.

    Also, here are the relevant database parameters that guide formatting of dates & times:
    NLS_DATE_FORMAT = DD-MON-RR
    NLS_TIME_FORMAT = HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT = DD-MON-RR HH.MI.SSXFF AM
    Thanks for your support for many years now @JoeAlbahari !!!
Sign In or Register to comment.