I'm struggling a bit with a query I would expect to work, but errors both running it through my script and from the sqlplus prompt. I was hoping that anyone who had some Oracle experience could point out what it is I'm doing wrong:

Given this table schema for the table 'Promotions':
Name Null? Type ------------------------------- -------- ---- ID NOT NULL NUMBER(5) DATE_CREATED NOT NULL DATE DATE_MODIFIED NOT NULL DATE TITLE NOT NULL VARCHAR2(64) PROMOTION_PHRASE NOT NULL VARCHAR2(255) DATE_START DATE DATE_END DATE STATUS NOT NULL NUMBER(2) TRIGGER_TYPE NOT NULL NUMBER(2) TRIGGER_VALUE NOT NULL VARCHAR2(12) TRIGGER_QUANTITY NOT NULL VARCHAR2(12) REWARD_TYPE NOT NULL NUMBER(2) REWARD_VALUE NOT NULL VARCHAR2(12) REWARD_QUANTITY NOT NULL VARCHAR2(12) USES_PERCUSTOMER NOT NULL NUMBER(5) USES_MAXIMUM NOT NULL NUMBER(10)

And my query:

insert into Promotions (ID,Date_Created,Date_Modified,Title, Promotion_Phrase,Date_Start,Date_End,Status, Trigger_Type,Trigger_Value,Trigger_Quantity, Reward_Type,Reward_Value,Reward_Quantity, Uses_PerCustomer,Uses_Maximum) values (1,SYSDATE,SYSDATE,'test promotion', 'phrase here',NULL,NULL,0,0,'','',0,'','',1,0);

in my perl code I'm using placeholders for all the values, and undef's for the two null values I do want

. The error I'm getting is this:

ORA-01400: mandatory (NOT NULL) column is missing or NULL during insert

Of course, Oracle doesn't take the courtesy to tell me *which* column it is referring to. Any insights would be much appreciated


In reply to OT: Oracle SQL issues by AidanLee

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.