Sponsored Content
Top Forums Programming How do I partition an Oracle 11g Table? Post 302928256 by bbbngowc on Wednesday 10th of December 2014 09:20:39 AM
Old 12-10-2014
Thanks for checking. I have this query and I thought i understood the interval partitioning, but it's giving me the following error. Can you help with the proper syntax please?


Code:
SQL Error: ORA-14752: Interval expression is not a constant of the correct type


Here is the statement.

Code:
CREATE TABLE "AUDIT_COLLECTION_EVENTS" 
   ("AUDIT_TS" TIMESTAMP (6) DEFAULT sysdate, 
    "AUDIT_ID" NUMBER(20,0) DEFAULT -1, 
     "EVENT_NAME" VARCHAR2(48 CHAR) DEFAULT (null), 
     "EVENT_VALUE" VARCHAR2(256 CHAR) DEFAULT (null), 
    "TABLE_TXN_ID" NUMBER(20,0)
   )
  TABLESPACE "AUDIT"
  
  PARTITION BY RANGE ("AUDIT_TS") INTERVAL (NUMTODSINTERVAL(1,'MONTH')) 
 (PARTITION "PART1"  VALUES LESS THAN (TO_DATE('2014-12-01', 'YYYY-MM-DD'));


Last edited by bbbngowc; 12-10-2014 at 10:27 AM..
 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Switching user to oracle to connect Oracle 11g DB with 'sysdba'

I need to connect my Oracle 11g DB from shell script with 'sysdba' permissions. To do this I have to switch user from 'root' to 'oracle'. I've tried the following with no success. su - oracle -c "<< EOF1 sqlplus -s "/ as sysdba" << EOF2 whenever sqlerror exit sql.sqlcode;... (2 Replies)
Discussion started by: NetBear
2 Replies

2. Solaris

need help in oracle upgrade from 10g to 11g

Hi , situation has come where in i want to upgrade my database from 10g to 11g ,my code heavily depends on Pro*C , i just want to know if i upgrade my DB from 10g to 11g , will there be any changes in my pro*c compiler ..? if so then wat are the prerequisites i need to check ..? thanks ... (2 Replies)
Discussion started by: senkerth
2 Replies
Vend::Accounting::SQL_Ledger(3pm)			User Contributed Perl Documentation			 Vend::Accounting::SQL_Ledger(3pm)

   parts table
       CREATE TABLE "parts" (	   "id" integer DEFAULT nextval('id'::text),	  "partnumber" text,	  "description" text,	   "bin" text,
	    "unit" character varying(5),      "listprice" double precision,	 "sellprice" double precision,	    "lastcost" double precision,
	    "priceupdate" date DEFAULT date('now'::text),      "weight" real,	   "onhand" real DEFAULT 0,	 "notes" text,	    "makemodel"
       boolean DEFAULT 'f',	 "assembly" boolean DEFAULT 'f',      "alternate" boolean DEFAULT 'f',	    "rop" real,      "inventory_accno_id"
       integer,      "income_accno_id" integer,      "expense_accno_id" integer,      "obsolete" boolean DEFAULT 'f' );

   oe table
       CREATE TABLE "oe" (	"id" integer DEFAULT nextval('id'::text),      "ordnumber" text,      "transdate" date DEFAULT date('now'::text),
	    "vendor_id" integer,      "customer_id" integer,	  "amount" double precision,	  "netamount" double precision,      "reqdate"
       date,	  "taxincluded" boolean,      "shippingpoint" text,	 "notes" text,	    "curr" character(3) );

NAME
Vend::Accounting::SQL-Ledger - SQL-Ledger Accounting Interface for Interchange DESCRIPTION
This module is an attempt to create a set of callable routines that will allow the easy integration of the SQL-Ledger Accounting package with Interchange. It handles the mapping of the Interchange variable names to the appropriate SQL-Ledger ones as well as parsing the html returned by the SQL-Ledger "API". Background: SQL-Ledger Accounting "www.sql-ledger.org" is a multiuser, double entry, accounting system written in Perl and is licensed under the GNU General Public License. The SQL-Ledger API: SQL-Ledger functions can be accessed from the command line by passing all the variables in one long string to the perl script. The variable=value pairs must be separated by an ampersand. See "www.sql-ledger.org/misc/api.html" for more details on the command line interface. ------------------------------------------------------------------ This module also happens to be the author's first perl module and probably his second or third perl program in addition to "Hello World". :) So please go easy on me. -Daniel Schema CREATE SEQUENCE "id" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ; CREATE TABLE "makemodel" ( "id" integer, "parts_id" integer, "name" text ); CREATE TABLE "gl" ( "id" integer DEFAULT nextval('id'::text), "source" text, "description" text, "transdate" date DEFAULT date('now'::text) ); CREATE TABLE "chart" ( "id" integer DEFAULT nextval('id'::text), "accno" integer, "description" text, "charttype" character(1) DEFAULT 'A', "gifi" integer, "category" character(1), "link" text ); CREATE TABLE "defaults" ( "inventory_accno_id" integer, "income_accno_id" integer, "expense_accno_id" integer, "fxgain_accno_id" integer, "fxloss_accno_id" integer, "invnumber" text, "ordnumber" text, "yearend" character varying(5), "curr" text, "weightunit" character varying(5), "businessnumber" text, "version" character varying(8) ); CREATE TABLE "acc_trans" ( "trans_id" integer, "chart_id" integer, "amount" double precision, "transdate" date DEFAULT date('now'::text), "source" text, "cleared" boolean DEFAULT 'f', "fx_transaction" boolean DEFAULT 'f' ); CREATE TABLE "invoice" ( "id" integer DEFAULT nextval('id'::text), "trans_id" integer, "parts_id" integer, "description" text, "qty" real, "allocated" real, "sellprice" double precision, "fxsellprice" double precision, "discount" real, "assemblyitem" boolean DEFAULT 'f' ); CREATE TABLE "vendor" ( "id" integer DEFAULT nextval('id'::text), "name" character varying(35), "addr1" character varying(35), "addr2" character varying(35), "addr3" character varying(35), "addr4" character varying(35), "contact" character varying(35), "phone" character varying(20), "fax" character varying(20), "email" text, "notes" text, "terms" smallint DEFAULT 0, "taxincluded" boolean ); CREATE TABLE "customer" ( "id" integer DEFAULT nextval('id'::text), "name" character varying(35), "addr1" character varying(35), "addr2" character varying(35), "addr3" character varying(35), "addr4" character varying(35), "contact" character varying(35), "phone" character varying(20), "fax" character varying(20), "email" text, "notes" text, "discount" real, "taxincluded" boolean, "creditlimit" double precision DEFAULT 0, "terms" smallint DEFAULT 0, "shiptoname" character varying(35), "shiptoaddr1" character varying(35), "shiptoaddr2" character varying(35), "shiptoaddr3" character varying(35), "shiptoaddr4" character varying(35), "shiptocontact" character varying(20), "shiptophone" character varying(20), "shiptofax" character varying(20), "shiptoemail" text ); CREATE TABLE "parts" ( "id" integer DEFAULT nextval('id'::text), "partnumber" text, "description" text, "bin" text, "unit" character varying(5), "listprice" double precision, "sellprice" double precision, "lastcost" double precision, "priceupdate" date DEFAULT date('now'::text), "weight" real, "onhand" real DEFAULT 0, "notes" text, "makemodel" boolean DEFAULT 'f', "assembly" boolean DEFAULT 'f', "alternate" boolean DEFAULT 'f', "rop" real, "inventory_accno_id" integer, "income_accno_id" integer, "expense_accno_id" integer, "obsolete" boolean DEFAULT 'f' ); CREATE TABLE "assembly" ( "id" integer, "parts_id" integer, "qty" double precision ); CREATE TABLE "ar" ( "id" integer DEFAULT nextval('id'::text), "invnumber" text, "ordnumber" text, "transdate" date DEFAULT date('now'::text), "customer_id" integer, "taxincluded" boolean, "amount" double precision, "netamount" double precision, "paid" double precision, "datepaid" date, "duedate" date, "invoice" boolean DEFAULT 'f', "shippingpoint" text, "terms" smallint DEFAULT 0, "notes" text, "curr" character(3) ); CREATE TABLE "ap" ( "id" integer DEFAULT nextval('id'::text), "invnumber" text, "transdate" date DEFAULT date('now'::text), "vendor_id" integer, "taxincluded" boolean, "amount" double precision, "netamount" double precision, "paid" double precision, "datepaid" date, "duedate" date, "invoice" boolean DEFAULT 'f', "ordnumber" text, "curr" character(3) ); CREATE TABLE "partstax" ( "parts_id" integer, "chart_id" integer ); CREATE TABLE "tax" ( "chart_id" integer, "rate" double precision, "taxnumber" text ); CREATE TABLE "customertax" ( "customer_id" integer, "chart_id" integer ); CREATE TABLE "vendortax" ( "vendor_id" integer, "chart_id" integer ); CREATE TABLE "oe" ( "id" integer DEFAULT nextval('id'::text), "ordnumber" text, "transdate" date DEFAULT date('now'::text), "vendor_id" integer, "customer_id" integer, "amount" double precision, "netamount" double precision, "reqdate" date, "taxincluded" boolean, "shippingpoint" text, "notes" text, "curr" character(3) ); CREATE TABLE "orderitems" ( "trans_id" integer, "parts_id" integer, "description" text, "qty" real, "sellprice" double precision, "discount" real ); CREATE TABLE "exchangerate" ( "curr" character(3), "transdate" date, "buy" double precision, "sell" double precision ); perl v5.14.2 2011-03-09 Vend::Accounting::SQL_Ledger(3pm)
All times are GMT -4. The time now is 12:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy