title: How do I add a constraint to check the first character of a value entered in a VARCHAR2 column in Oracle 11g?
body: <p>I want to add a constraint that checks if the first value of a string (in this case Product_id) is a particular character. In this case I need the first character to be a 'P', while the rest can be any combination of numeric characters.</p>
  
  <p>Thus far I have this when creating the table,</p>
  
  <pre><code>  CREATE TABLE PRODUCTS
  (
  Product_id varchar2(6) CHECK (Product_id, SUBSTRING(1,1) = "P"); 
  Description varchar2(20) NOT NULL,
  Qty_on_hand number(10) NOT NULL,
  Reorder_level number(5),
  Price_per_unit number(8,2)
  );
  </code></pre>
  
  <p>It doesn't seem to work though. I'm sure it's a very simple syntax error but I can't spot it.</p>