title: Rounding of Timestamp(9) in Oracle 11g stored procedure
body: <p>The following procedure rounds the Timestamp(9) to a Timestamp(6):</p>
  
  <pre><code>CREATE
      TABLE MY_TABLE
      (
          MY_TIMESTAMP TIMESTAMP(9) NOT NULL
      )
  
  CREATE OR REPLACE PROCEDURE "DB"."INSERT_ROW"
  (myTimestamp IN TIMESTAMP)
  AS
  v_sys_error NUMBER := 0;
  v_err INTEGER;
  v_rc INTEGER;
  BEGIN
  
  BEGIN
      INSERT
  INTO
      DB.INSERT_ROW
      (
          MY_TIMESTAMP
      )
      VALUES
      (
          myTimestamp
      );
  EXCEPTION
  WHEN OTHERS THEN
  v_sys_error := SQLCODE;
  v_err := v_sys_error;
  v_rc := SQL%ROWCOUNT;
  RAISE;
  END;
  
  END;
  </code></pre>
  
  <p>The call below will insert: 2007-12-12 12:23:45.123457000</p>
  
  <pre><code>@call DB.INSERT_ROW(TIMESTAMP '2007-12-12 12:23:45.123456789');
  </code></pre>
  
  <p>Whereas the code below will insert this: 2007-12-12 12:23:45.123456789</p>
  
  <pre><code>INSERT
  INTO
      DB.MY_TABLE
      (
          MY_TIMESTAMP
      )
      VALUES
      (
          TIMESTAMP '2007-12-12 12:23:45.123456789'
      );
  </code></pre>
  
  <p>How do I prevent this?  Using (myTimestamp IN TIMESTAMP(9)) fails to validate.</p>