CREATE TABLE integer replaced by NUMBER(38)..
Hi,
I am using Oracle 11.1.0.6.O. Create a table using following query.
CREATE TABLE VENDOR_MASTER_new (
VENDOR_ID integer,
VENDOE_NAME VARCHAR2(50 CHAR),
STATUS smallint DEFAULT 1
Table Created.
check the table structure using DESC VENDOR_MASTER_new
It showing
SQL> desc vendor_master_new
Name Null? Type
VENDOR_ID NUMBER(38)
VENDOE_NAME VARCHAR2(50 CHAR)
STATUS NUMBER(38)
SQL>
integer replaced by NUMBER(38)..
if it is possible to make integer. help me resolve this issue.
954124 wrote:
Hi,
I am using Oracle 11.1.0.6.O. Create a table using following query.
CREATE TABLE VENDOR_MASTER_new (
VENDOR_ID integer,
VENDOE_NAME VARCHAR2(50 CHAR),
STATUS smallint DEFAULT 1
Table Created.
check the table structure using DESC VENDOR_MASTER_new
It showing
SQL> desc vendor_master_new
Name Null? Type
VENDOR_ID NUMBER(38)
VENDOE_NAME VARCHAR2(50 CHAR)
STATUS NUMBER(38)
SQL>
integer replaced by NUMBER(38)..
if it is possible to make integer. help me resolve this issue.
That should be fine as number(38) is having one much bigger range than integer.
Similar Messages
-
Create table problem using Dynamic Query
Hi all,
I want to create a temporary table within a stored procedure so I decided to do it using a dynamic query:
create or replace procedure p1
as
begin
execute immediate 'CREATE GLOBAL TEMPORARY TABLE tt(id number(2))';
end;
/ It created successfuly but when I execute that procedure I got:SQL> exec p1;
BEGIN p1; END;
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SCOTT.P1", line 4
ORA-06512: at line 1 While I can create that table using the same user without any problem!
My question is:What privilege should I grant to user(minimum of privileges please! ) to execute that procedure successfuly?
-ThanksHi,
To say a little bit more about Nicolas' answer:
SQL> grant create table to scott;
This is the right answer, but you might wonder why you have to do so if you usually can create tables with this user..
11:59:19 TEST.SQL>CREATE USER UTEST
11:59:28 2 IDENTIFIED BY UTEST;
User created.
11:59:35 TEST.SQL>CREATE ROLE RTEST;
Role created.
11:59:40 TEST.SQL>GRANT RTEST TO UTEST;
Grant succeeded.
11:59:45 TEST.SQL>GRANT CREATE SESSION TO RTEST;
Grant succeeded.
11:59:54 TEST.SQL>GRANT CREATE TABLE TO RTEST;
Grant succeeded.
12:00:03 TEST.SQL>GRANT UNLIMITED TABLESPACE TO UTEST;
Grant succeeded.
12:00:17 TEST.SQL>CREATE PROCEDURE UTEST.CT_TEST
12:00:32 2 IS
12:00:33 3 BEGIN
12:00:35 4 EXECUTE IMMEDIATE 'CREATE TABLE UTEST.TTEST (A NUMBER)';
12:00:56 5 END;
12:00:58 6 /
Procedure created.
12:00:59 TEST.SQL>EXEC UTEST.CT_TEST;
BEGIN UTEST.CT_TEST; END;
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "UTEST.CT_TEST", line 4
ORA-06512: at line 1
12:01:06 TEST.SQL>GRANT CREATE TABLE TO UTEST;
Grant succeeded.
12:01:15 TEST.SQL>EXEC UTEST.CT_TEST;
PL/SQL procedure successfully completed.Don't forget that when you're using PL/SQL, privileges granted via roles are ignored!
Regards,
Yoann. -
I am trying to create tables using a script, but it seems like consecutive statments in the script will not execute --- can anyone tell me what syntax I need to use?
Here is my script - I am using SQL-Plus:
CREATE TABLE regions
( region_id NUMBER
CONSTRAINT region_id_nn NOT NULL
, region_name VARCHAR2(25)
CREATE TABLE countries
( country_id CHAR(2)
CONSTRAINT country_id_nn NOT NULL
, country_name VARCHAR2(40)
, region_id NUMBER
, CONSTRAINT country_c_id_pk
PRIMARY KEY (country_id)
ORGANIZATION INDEX
Here is what I key in:
SQL> get c:\oracle\test.txt
Here is the error that comes out:
1 CREATE TABLE regions
2 ( region_id NUMBER
3 CONSTRAINT region_id_nn NOT NULL
4 , region_name VARCHAR2(25)
5 )
6 CREATE TABLE countries
7 ( country_id CHAR(2)
8 CONSTRAINT country_id_nn NOT NULL
9 , country_name VARCHAR2(40)
10 , region_id NUMBER
11 , CONSTRAINT country_c_id_pk
12 PRIMARY KEY (country_id)
13 )
14* ORGANIZATION INDEX
15 run;
CREATE TABLE countries
ERROR at line 6:
ORA-00922: missing or invalid option
If I trim down the script - to just 1 create table command, no semi-colons, it works:
Script:
CREATE TABLE regions
( region_id NUMBER
CONSTRAINT region_id_nn NOT NULL
, region_name VARCHAR2(25)
Key in:
SQL> get c:\oracle\test.txt
1 CREATE TABLE regions
2 ( region_id NUMBER
3 CONSTRAINT region_id_nn NOT NULL
4 , region_name VARCHAR2(25)
5* )
SQL> run;
Recieve:
1 CREATE TABLE regions
2 ( region_id NUMBER
3 CONSTRAINT region_id_nn NOT NULL
4 , region_name VARCHAR2(25)
5* )
Table created.
adding a semicolon between the create table statements doesn't solve this issue - does anyone have any ideas?
Thanks,
-Tomtry using a file that ends with .sql instead of .txt
and use a semi -colon
CREATE TABLE regions
( region_id NUMBER
CONSTRAINT region_id_nn NOT NULL
, region_name VARCHAR2(25)
CREATE TABLE countries
( country_id CHAR(2)
CONSTRAINT country_id_nn NOT NULL
, country_name VARCHAR2(40)
, region_id NUMBER
, CONSTRAINT country_c_id_pk
PRIMARY KEY (country_id)
Consider using a spool file so you can check for errors at the end.
Or you can use a template like this:
-- 0 ---------------------------------------------------------------------------------------------
PROMPT
PROMPT REGIONS
PROMPT
---------------------------------------------------------------------------------------------------|
-- CREATE SECTION-------------------------------------------------------------------------------|
---------------------------------------------------------------------------------------------------|
CREATE TABLE REGIONS
( REGION_ID NUMBER
CONSTRAINT REGION_ID_NN NOT NULL
, REGION_NAME VARCHAR2(25)
-- INDEXES ----------------------------------------------------------------------------------------
-- SYNONYMS ---------------------------------------------------------------------------------------
CREATE OR REPLACE PUBLIC SYNONYM REGIONS FOR REGIONS ;
-- GRANTS -----------------------------------------------------------------------------------------
GRANT SELECT ON REGIONS TO SCOTT; -
Create table script by passing value from table
I Have a procedure to check if the table exists, if yes drop and re-create else create table.
CREATE OR REPLACE
PROCEDURE test_proc authid current_user
AS
v_cnt NUMBER:=0;
BEGIN
SELECT COUNT(*)
INTO v_cnt
FROM all_tables
WHERE table_name='T1'
AND owner = 'WORKSPACE';
IF v_cnt = 1 THEN
EXECUTE immediate 'DROP TABLE WORKSPACE.T1';
END IF;
EXECUTE immediate 'CREATE TABLE WORKSPACE.T1
ITM_NBR NUMBER ,
LCT_NBR NUMBER
SELECT COUNT(*)
INTO v_cnt
FROM all_tables
WHERE table_name='T2'
AND owner = 'WORKSPACE';
IF v_cnt = 1 THEN
EXECUTE immediate 'DROP TABLE WORKSPACE.T2';
END IF;
EXECUTE immediate 'CREATE TABLE WORKSPACE.T2
LCT_NBR NUMBER(5, 0) NOT NULL ,
PRY_CD NUMBER(5, 0) NOT NULL )';
END;
Requirement: Instead of passing the Owner,tablename & the create table scripts directlyin the query, it should be passed from a database table which will be in given format.
TableName Query Owner
T1 CREATE TABLE WORKSPACE.T1(ITM_NBR NUMBER, LCT_NBR NUMBER) WORKSPACE
T2 CREATE TABLE WORKSPACE.T2(LCT_NBR NUMBER(5, 0) NOT NULL ,PRY_CD NUMBER(5, 0) NOT NULL) WORKSPACEuser12276240 wrote:
Excuse all. The database columns are yet to be finalized and every time changes come in we are currently dropping and re-creating the tables which leads in changing the script, hence we are going in for this approach.
Moreover if i am going to have this script everytime i have to drop and re-create all the tables which can be elimated by this way.So why not have a SQL script as follows?
drop table emp purge;
create table emp(
create index .. on emp( .. );
..It drops the existing table (if exists). It then creates the table with constraints and indexes. This script is now the master definition of the table. You can slap a change log header to it. Any changes that needs the table to be redefined and recreated are done via this script. Which means it is also checked into the source code repository as it is part of the code of that system/application.
I would however remove the drop table from it in case some developer accidentally run it at the wrong time and trash the table.
The bottom line is that DDL code is part and parcel of the installation, configuration and setup code - and that this is as important as the source code. This code also needs to be "formalised" in proper scripts, checked into SVN/CVS/etc, and used to bootstrap the system (or parts of it), as and when needed. -
How to specify tablespace for a primary key inde in create table statement
How to specify the tablespace for a primary key index in a create table statement?
Does the following statement is right?
CREATE TABLE 'GPS'||TO_CHAR(SYSDATE+1,'YYYYMMDD')
("ID" NUMBER(10,0) NOT NULL ENABLE,
"IP_ADDRESS" VARCHAR2(32 BYTE),
"EQUIPMENT_ID" VARCHAR2(32 BYTE),
"PACKET_DT" DATE,
"PACKET" VARCHAR2(255 BYTE),
"PACKET_FORMAT" VARCHAR2(32 BYTE),
"SAVED_TIME" DATE DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "UDP_LOG_PK" PRIMARY KEY ("ID") TABLESPACE "INDEX_DATA"
TABLESPACE "SBM_DATA"; Thank you
Edited by: qkc on 09-Nov-2009 13:42As orafad indicated, you'll have to use the USING INDEX clause from the documentation, i.e.
SQL> ed
Wrote file afiedt.buf
1 CREATE TABLE GPS
2 ("ID" NUMBER(10,0) NOT NULL ENABLE,
3 "IP_ADDRESS" VARCHAR2(32 BYTE),
4 "EQUIPMENT_ID" VARCHAR2(32 BYTE),
5 "PACKET_DT" DATE,
6 "PACKET" VARCHAR2(255 BYTE),
7 "PACKET_FORMAT" VARCHAR2(32 BYTE),
8 "SAVED_TIME" DATE DEFAULT CURRENT_TIMESTAMP,
9 CONSTRAINT "UDP_LOG_PK" PRIMARY KEY ("ID") USING INDEX TABLESP
ACE "USERS"
10 )
11* TABLESPACE "USERS"
SQL> /
Table created.Justin -
ORA - 00922 Missing or Invalid option error while creating table
I am tryin to create a table with the following syntax
1 CREATE TABLE TEST_FOR_SCRIPT (
2 TEST_A NUMBER NOT NULL
3 ,TEST_B VARCHAR2(30) DEFAULT 'UNDEFINED' NOT NULL
4 )
5* @storage_parms_table_cmn
6 /
@storage_parms_table_cmn
ERROR at line 5:
ORA-00922: missing or invalid option
Here, storage_parms_table_cmn.sql reads like this
tablespace DBK_CMN_DATA
Can anyone please guide me how to overcome this error.What is your Oracle Version?
i can do it exactly what you did without error
sql> CREATE TABLE vd.TEST_FOR_SCRIPT (
2 TEST_A NUMBER NOT NULL
3 ,TEST_B VARCHAR2(30) DEFAULT 'UNDEFINED' NOT NULL
4 )
5 @test1.sql
6 /
Table created.
Cheers
http://fiedizheng.blogspot.com/ -
Create Table using DBMS_SQL package and size not exceeding 64K
I have a size contraint that my SQL size should not exceed 64K.
Now I would appriciate if some one could tell me how to create a table using
Dynamic sql along with usage of DBMS_SQL package.
Brief Scenario: Users at my site are not given permission to create table.
I need to write a procedure which the users could use to create a table .ALso my SQL size should not exceed 64K. Once this Procedure is created using DBMS_SQL package ,user should pass the table name to create a table.
Thanks/"If a user doesn't have permission to create a table then how do you expect they will be able to do this"
Well, it depends on what you want to do. I could write a stored proc that creates a table in my schema and give some other user execute privilege on it. They would then be able to create a able in my schema without any explicitly granted create table privilege.
Similarly, assuming I have CREATE ANY TABLE granted directly to me, I could write a stroe proc that would create a table in another users schema. As long as they have quota on their default tablespace, they do not need CREATE TABLE privileges.
SQL> CREATE USER a IDENTIFIED BY a
2 DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;
User created.
SQL> GRANT CREATE SESSION TO a;
Grant succeeded.
SQL> CREATE TABLE a.t (id NUMBER, descr VARCHAR2(10));
CREATE TABLE a.t (id NUMBER, descr VARCHAR2(10))
ERROR at line 1:
ORA-01950: no privileges on tablespace 'USERS'So, give them quota on the tablespace and try again
SQL> ALTER USER a QUOTA UNLIMITED ON users;
User altered.
SQL> CREATE TABLE a.t (id NUMBER, descr VARCHAR2(10));
Table created.Now lets see if it really belongs to a:
SQL> connect a/a
Connected.
SQL> SELECT table_name FROM user_tables;
TABLE_NAME
T
SQL> INSERT INTO t VALUES (1, 'One');
1 row created.Yes, it definitely belongs to a. Just to show that ther is nothing up my sleeve:
SQL> create table t1 (id NUMBER, descr VARCHAR2(10));
create table t1 (id NUMBER, descr VARCHAR2(10))
ERROR at line 1:
ORA-01031: insufficient privilegesI can almost, but not quite, see a rationale for the second case if you want to enforce some sort of naming or location standards but the whole thing seems odd to me.
Users cannot create tables, so lets give them a procedure to create tables?
John -
Error ORA-01426: numeric overflow when Creating table with double data type
Hi,
I am using ODP.NET to create a table with data from SQL to Oracle. The problem is with double data type fields that is equivalent to FLOAT(49) in Oracle. My syntax is:
CREATE TABLE SCOTT.ALLTYPES
F1 NUMBER(10),
F10 DATE,
F2 NUMBER(10),
F3 NUMBER(5),
F4 NUMBER(3),
F5 FLOAT(23),
F6 FLOAT(49),
F7 NUMBER (38,5),
F8 NVARCHAR2(500),
F9 NVARCHAR2(500)
Th error is with field F6 but I am not sure what is the correct type equivalent to double in SQL.
I woul appreciate if anyone can help me with this problem.
SunnyDoes this simple test work for you?
In database:
create table float_test
f1 float(49)
);C# code:
using System;
using System.Data;
using System.Text;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
namespace FloatTest
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
// connect to local db using o/s authenticated account
OracleConnection con = new OracleConnection("User Id=/");
con.Open();
// will hold the value to insert
StringBuilder sbValue = new StringBuilder();
// create a string of 49 number 9's
for (int i = 0; i < 49; i++)
sbValue.Append("9");
// command object to perform the insert
OracleCommand cmd = con.CreateCommand();
cmd.CommandText = "insert into float_test values (:1)";
// bind variable for the value to be inserted
OracleParameter p_value = new OracleParameter();
p_value.OracleDbType = OracleDbType.Double;
p_value.Value = Convert.ToDouble(sbValue.ToString());
// add parameter to collection
cmd.Parameters.Add(p_value);
// execute the insert operation
cmd.ExecuteNonQuery();
// clean up
p_value.Dispose();
cmd.Dispose();
con.Dispose();
}SQL*Plus after executing above code:
SQL> select * from float_test;
F1
1.0000E+49
1 row selected.- Mark -
Primary Key Issue With Creating Tables
Hi,
I have the following scripts to create my two tables in oracle 10g, i was wondering wether or not i had correctly set up my primary key or if there is a better way of doing it than the way i have.
Here are my two scripts for my tables:
CREATE TABLE CUSTOMER (
fname varchar2(15) NOT NULL,
lname varchar2(20) NOT NULL,
age varchar2(3) NOT NULL,
custAreaCode number(5) NOT NULL,
custNumber number(6) NOT NULL,
constraint cust_pk PRIMARY KEY (custAreaCode),
constraint cust_pk2 PRIMARY KEY (custNumber),
constraint age_chk CHECK (age >=18 AND age <150)
CREATE TABLE PHONECALL (
startDateTime smalldatetime NOT NULL,
custAreaCode number(5) NOT NULL, ---Reference PK From Customer Table
custNumber number(6) NOT NULL, ---Reference PK From Customer Table
dialledAreaCode number(5) NOT NULL,
dialledNumber number(6) NOT NULL,
crgPerMinute number number (3,1) NOT NULL,
endDateTime smalldatetime NOT NULL));
I am not sure if i have referenced the primary keys correctly in the PHONECALL table.
Thanks in advance :)Hi,
You want like this below ? I think that smalltime data type is not a valid type. Other thing, this is not a rule, but I advice you to put the primary key columns as the first columns of your table. One question: There is no PK on the phonecall table ?
SGMS@ORACLE10> create table customer (
2 custareacode number(5) not null,
3 custnumber number(6) not null,
4 fname varchar2(15) not null,
5 lname varchar2(20) not null,
6 age varchar2(3) not null,
7 constraint cust_pk primary key (custareacode),
8 constraint cust_uk unique (custnumber),
9 constraint age_chk check (age >=18 and age <150)
10 );
Table created.
SGMS@ORACLE10> create table phonecall (
2 custareacode number(5) not null constraint fk_phone_cusarecode_customer references customer,
3 custnumber number(6) not null constraint fk_phone_custnumber_customer references customer,
4 startdatetime date not null,
5 dialledareacode number(5) not null,
6 diallednumber number(6) not null,
7 crgperminute number (3,1) not null,
8 enddatetime date not null);
Table created.
SGMS@ORACLE10> select table_name,constraint_name,constraint_type from user_constraints
2 where table_name in ('CUSTOMER','PHONECALL') and constraint_type in ('P','U','R');
TABLE_NAME CONSTRAINT_NAME C
CUSTOMER CUST_PK P
CUSTOMER CUST_UK U
PHONECALL FK_PHONE_CUSARECODE_CUSTOMER R
PHONECALL FK_PHONE_CUSTNUMBER_CUSTOMER RCheers -
Problem CREATE TABLE with PRIMARY KEY Still in Trouble ! Please Help!
Hi there !
I use the orcle 8i, and i don't know why i can't create table with any primary key EXample:
SQL> CREATE TABLE O_caisses
2 (No_caisse NUMBER(3) constraint caisses_pk PRIMARY KEY,
3 NB_BILLETS NUMBER(5)
4 )
5 /
CREATE TABLE O_caisses
ERROR at line 1:
ORA-18008: cannot find OUTLN schema
***********some Debuger show me this way: *********************
Well there r certain point u got to notice when creating a table with constraints.
1) U can create table with COLUMN level constraint.
2) U can create table with TABLE level constraint.
3) In COLUMN level constraint u can't give a constraint a name
but only mention the type of constraint.
4) In TABLE level constraint u can give a name to constraint.
Following are the examples of both
--COLUMN LEVEL
CREATE TABLE O_caisses
(No_caisse NUMBER(3) PRIMARY KEY,
NB_BILLETS NUMBER(5));
--TABLE LEVEL
CREATE TABLE O_caisses
(No_caisse NUMBER(3),
NB_BILLETS NUMBER(5),
constraint pk_caisse primary key (No_caisse));
********************And this is another one:*****************
SQL>grant create any outline to username;
BUT the problem is still present, i don't know what to do now !
Please could some body help me !
Thanks alot!
Luong.The clue is in the error message: the OUTLN schema is missing.
This is something Oracle 8i introduced to help manage the CBO (or soemthing equally geeky and internal). For some reason your database no longer has this user. It ought to be created automatically during installation (or upgrade) but catproct may not have completed probably or some over zealous admin type has dropped it.
Solution is to re-install (or re-upgrade) as you cannot create this user on their own. Alas.
HTH, APC -
Invalid character while create table
create table is giving error. Can you please tell me what is wrong with the below code. giving error.
CREATE TABLE TTAX.TTAT_REQUESTS_ALL
REQUEST_ID NUMBER,
REQUEST_TYPE_ID NUMBER,
REQUESTOR_ID NUMBER,
DELEGATED_REQUESTOR_ID NUMBER,
AUTH_NO VARCHAR2 (50),
ALTERNATIVE_CONTACT_NO VARCHAR2 (50),
PRIMARY_OFFICE_LOCATION VARCHAR2 (100),
PREAPPROVED_FLAG VARCHAR2 (5),
CITY VARCHAR2 (50),
STATE VARCHAR2 (50),
START_DATE DATE,
END_DATE DATE,
STATE_CAR VARCHAR2 (50),
JUSTIFICATION VARCHAR (200),
TOTAL_ESTIMATED_AIRFARE NUMBER,
TOTAL_ESTIMATED_CARERENTAL NUMBER,
TOTAL_ESTIMATED_OTHER_TRANS NUMBER,
TOTAL_ESTIMATED_LODGING NUMBER ,
TOTAL _ESTIMATED_PER_DLEM NUMBER ,
TOTAL _ESTIMATED_OTHER_TRAVEL NUMBER ,
PAY_BY_OUTSIDEORG_AIRFARE NUMBER ,
PAY_BY_OUTSIDEORG_CARE_RENTAL NUMBER ,
PAY_BY_OUTSIDEORG_OTHER_TRANS NUMBER ,
PAY_BY_OUTSIDEORG_LODGING NUMBER ,
PAY_BY_OUTSIDEORG_PER_DLEM NUMBER ,
PAY_BY_OUTSIDEORG_OTHER_TRAVEL NUMBER ,
OUTSIDEORG_AIRFARE NUMBER ,
OUTSIDEORG_CAR_RENTAL NUMBER ,
OUTSIDEORG_OTHER_TRANS NUMBER ,
OUTSIDEORG_LODGING NUMBER ,
OUTSIDEORG_RPER_DLEM NUMBER ,
OUTSIDEORG_OTHER_TRAVEL NUMBER ,
PAY_IN_FULL_FLAG VARCHAR2(5) ,
ORGANIZATION_NAME VARCHAR2(50) ,
BCO_PCA VARCHAR2(5) ,
BCO_UNIT VARCHAR2(50) ,
BCO_DIVISION_TRACK_NO VARCHAR2(50) ,
BCO_REMARKS VARCHAR2(200) ,
BCO_FUND VARCHAR2(4) ,
BCO_BLANKET_NO VARCHAR2(4) ,
OST_CONFIRM_FLAG VARCHAR2(5) ,
TRAINING_TYPE VARCHAR2(50) ,
EESTIMATED_ TUITION_ REG_FEE NUMBER ,
EESTIMATED_COST_OTHERS NUMBER ,
SERVER_TYPE VARCHAR2(50) ,
VENDOR_ID NUMBER ,
COURSE_TITLE VARCHAR2(50) ,
COURSE _ADDRESS VARCHAR2(50) ,
COURSE _CITY VARCHAR2(50) ,
COURSE _STATE VARCHAR2(50) ,
COURSE _ZIP_CODE VARCHAR2(50) ,
DATE_FROM1 DATE ,
DATE_TO1 DATE ,
DATE_FROM2 DATE ,
DATE_TO2 DATE ,
DATE_FROM3 DATE ,
DATE_TO3 DATE ,
TRAINING_HOUR NUMBER ,
TRAINING_REASON VARCHAR2(100) ,
TRAINING_JUSTIFICATION VARCHAR2(200) ,
TRAINING_COMPLETED DATE ,
SPONSOR VARCHAR2(50) ,
ATTEND_YN VARCHAR2(5) ,
STATUS VARCHAR2(10) ,
CREATED_BY NUMBER ,
CREATE_DATE DATE ,
LASTUPDATED_BY NUMBER ,
LASTUPDATE_DATE DATE )Extra Space!
21 TOTAL _ESTIMATED_PER_DLEM NUMBER ,
22 TOTAL _ESTIMATED_OTHER_TRAVEL NUMBER ,Try this
CREATE TABLE TTAX.TTAT_REQUESTS_ALL
REQUEST_ID NUMBER,
REQUEST_TYPE_ID NUMBER,
REQUESTOR_ID NUMBER,
DELEGATED_REQUESTOR_ID NUMBER,
AUTH_NO VARCHAR2 (50),
ALTERNATIVE_CONTACT_NO VARCHAR2 (50),
PRIMARY_OFFICE_LOCATION VARCHAR2 (100),
PREAPPROVED_FLAG VARCHAR2 (5),
CITY VARCHAR2 (50),
STATE VARCHAR2 (50),
START_DATE DATE,
END_DATE DATE,
STATE_CAR VARCHAR2 (50),
JUSTIFICATION VARCHAR (200),
TOTAL_ESTIMATED_AIRFARE NUMBER,
TOTAL_ESTIMATED_CARERENTAL NUMBER,
TOTAL_ESTIMATED_OTHER_TRANS NUMBER,
TOTAL_ESTIMATED_LODGING NUMBER ,
TOTAL_ESTIMATED_PER_DLEM NUMBER ,
TOTAL_ESTIMATED_OTHER_TRAVEL NUMBER ,
PAY_BY_OUTSIDEORG_AIRFARE NUMBER ,
PAY_BY_OUTSIDEORG_CARE_RENTAL NUMBER ,
PAY_BY_OUTSIDEORG_OTHER_TRANS NUMBER ,
PAY_BY_OUTSIDEORG_LODGING NUMBER ,
PAY_BY_OUTSIDEORG_PER_DLEM NUMBER ,
PAY_BY_OUTSIDEORG_OTHER_TRAVEL NUMBER ,
OUTSIDEORG_AIRFARE NUMBER ,
OUTSIDEORG_CAR_RENTAL NUMBER ,
OUTSIDEORG_OTHER_TRANS NUMBER ,
OUTSIDEORG_LODGING NUMBER ,
OUTSIDEORG_RPER_DLEM NUMBER ,
OUTSIDEORG_OTHER_TRAVEL NUMBER ,
PAY_IN_FULL_FLAG VARCHAR2(5) ,
ORGANIZATION_NAME VARCHAR2(50) ,
BCO_PCA VARCHAR2(5) ,
BCO_UNIT VARCHAR2(50) ,
BCO_DIVISION_TRACK_NO VARCHAR2(50) ,
BCO_REMARKS VARCHAR2(200) ,
BCO_FUND VARCHAR2(4) ,
BCO_BLANKET_NO VARCHAR2(4) ,
OST_CONFIRM_FLAG VARCHAR2(5) ,
TRAINING_TYPE VARCHAR2(50) ,
EESTIMATED_TUITION_REG_FEE NUMBER ,
EESTIMATED_COST_OTHERS NUMBER ,
SERVER_TYPE VARCHAR2(50) ,
VENDOR_ID NUMBER ,
COURSE_TITLE VARCHAR2(50) ,
COURSE_ADDRESS VARCHAR2(50) ,
COURSE_CITY VARCHAR2(50) ,
COURSE_STATE VARCHAR2(50) ,
COURSE_ZIP_CODE VARCHAR2(50) ,
DATE_FROM1 DATE ,
DATE_TO1 DATE ,
DATE_FROM2 DATE ,
DATE_TO2 DATE ,
DATE_FROM3 DATE ,
DATE_TO3 DATE ,
TRAINING_HOUR NUMBER ,
TRAINING_REASON VARCHAR2(100) ,
TRAINING_JUSTIFICATION VARCHAR2(200) ,
TRAINING_COMPLETED DATE ,
SPONSOR VARCHAR2(50) ,
ATTEND_YN VARCHAR2(5) ,
STATUS VARCHAR2(10) ,
CREATED_BY NUMBER ,
CREATE_DATE DATE ,
LASTUPDATED_BY NUMBER ,
LASTUPDATE_DATE DATE )
SQL - ORCL(SCOTT)>/
Table created.Edited by: Lokanath Giri on १३ फ़रवरी, २०१२ ३:१५ अपराह्न -
Does The Create Table Privilege allow to insert data ?
Hi,
I wish to know if it's possible that a user UserA allows another user UserB to create a table but does not allow him (does not allow UserB ) to insert data in a table UserB has created .If it's possible, I would want to know the commands to do that.
Thanks .sys@LINUX>create user user1 identified by user1;
User created.
sys@LINUX>grant connect, resource to user1;
Grant succeeded.
sys@LINUX>create user user2 identified by user2;
User created.
sys@LINUX>grant connect, resource to user2;
Grant succeeded.
sys@LINUX>conn user1/user1
Connected.
user1@LINUX>create table t (id number);
Table created.
user1@LINUX>disc
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Production
With the Partitioning, OLAP and Data Mining options
user1@LINUX>conn / as sysdba
Connected.
sys@LINUX>grant create any table to user2;
Grant succeeded.
sys@LINUX>conn user2/user2
Connected.
user2@LINUX>create table user1.tab (id number);
Table created.
user2@LINUX>insert into user1.tab values(1);
insert into user1.tab values(1)
ERROR at line 1:
ORA-01031: insufficient privileges
user2@LINUX>select * from user1.tab;
select * from user1.tab
ERROR at line 1:
ORA-01031: insufficient privileges
user2@LINUX>delete from user1.tab;
delete from user1.tab
ERROR at line 1:
ORA-01031: insufficient privileges
user2@LINUX>update user1.tab set id=1;
update user1.tab set id=1
ERROR at line 1:
ORA-01031: insufficient privilegesInteresting issue. Although user2 was able to create a table in user1 schema (because he has "create any table" privilege), he's NOT able to run ANY DML on that table (NO insert, update, delete and select)!
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com
[Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/] -
Create table, PARTITION, compress ORACLE SUPPORT PLS !
Can someone PLEASE explain to me the following (read carefully):
SQL> create table abc
2 (a number)
3 PARTITION BY LIST(a)
4 (PARTITION A_A values (2),
5 PARTITION A_B values (DEFAULT) COMPRESS);
Table created.
SQL> alter table abc add b number;
alter table abc add b number
ERROR at line 1:
ORA-22856: cannot add columns to object tables
SQL> alter table abc modify partition A_B nocompress;
Table altered.
SQL> alter table abc add b number;
alter table abc add b number
ERROR at line 1:
ORA-22856: cannot add columns to object tables
SQL> drop table abc;
Table dropped.
SQL> create table abc
2 (a number)
3 PARTITION BY LIST(a)
4 (PARTITION A_A values (2),
5 PARTITION A_B values (DEFAULT));
Table created.
SQL> alter table abc modify partition A_B compress;
Table altered.
SQL> alter table abc add b number;
Table altered.
I definetelly think this is a BUG !14464, 00000, "Compression Type not specified"
// *Cause: Compression Type was not specified in the Compression Clause.
// *Action: specify Compression Type in the Compression Clause. -
Auto-creating tables with CMP Explicit Mapping
Hello.
I am trying to migrate a working CMP EJB Jar from Weblogic to OC4J, using the admin.jar deploy utility. I believe my orion-ejb-jar.xml deployment descriptor (shown at the bottom) is set up properly, but OC4J attempts to auto-create tables for my entity beans anyway. (see messages that follow).
Can anybody tell me why it tries to create these tables? Is something missing from my deployment descriptor?
Thanks,
David
Auto-creating table: create table User_passwords_Passwor__fqeml6 (User_SEC_USER.
SEC_USER_ID NUMBER not null, Password_SEC_USER_PASSWORD_ID NUMBER null)
Error creating table: ORA-01748: only simple column names allowed here
Auto-creating table: create table User_userRoles_UserRol__guatbv (User_SEC_USER.
SEC_USER_ID NUMBER not null, UserRole_SEC_USER_ROLE_ID NUMBER null)
Error creating table: ORA-01748: only simple column names allowed here
Auto-creating table: create table Permission_RolePermiss__768cc0 (Permission_SEC
FUNCTIONID NUMBER not null, RolePermission_SEC_ROLE_FUNCTION_ID NUMBER null)
Error creating table: ORA-00972: identifier is too long
Auto-creating table: create table Role_UserRole_role_User_39lzhp (Role_SEC_ROLE.
SEC_ROLE_ID NUMBER not null, UserRole_SEC_USER_ROLE_ID NUMBER null)
Error creating table: ORA-01748: only simple column names allowed here
Auto-creating table: create table Role_rolePermissions_Ro_4ocmz1 (Role_SEC_ROLE.
SEC_ROLE_ID NUMBER not null, RolePermission_SEC_ROLE_FUNCTION_ID NUMBER null)
Error creating table: ORA-01748: only simple column names allowed here
orion-ejb-jar.xml
<?xml version="1.0"?>
<!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
<orion-ejb-jar deployment-version="9.0.3.0.0" deployment-time="e6e55808e4">
<enterprise-beans>
<session-deployment name="SecurityComponent" >
</session-deployment>
<session-deployment name="ServerSecurityContext" >
</session-deployment>
<session-deployment name="SecurityComponentSecurityFilter" >
</session-deployment>
<entity-deployment name="User" table="SEC_USER" data-source="datasource-ecmsOraclePool">
<primkey-mapping>
<cmp-field-mapping name="userId" persistence-name="SEC_USER.SEC_USER_ID" />
</primkey-mapping>
<cmp-field-mapping name="partyId" persistence-name="PARTY_ID" />
<cmp-field-mapping name="officeLocation" persistence-name="OFFICE_LOCATION" />
<cmp-field-mapping name="defaultLocation" persistence-name="DEFAULT_LOCATION" />
<cmp-field-mapping name="districtVvid" persistence-name="DISTRICT_VVID" />
<cmp-field-mapping name="userName" persistence-name="SEC_USER.USER_NAME" />
<cmp-field-mapping name="accountActivationDate" persistence-name="SEC_USER.ACCOUNT_ACTIVATION_DATE" />
<cmp-field-mapping name="defaultBranchVvid" persistence-name="SEC_USER.DEFAULT_BRANCH_VVID" />
<cmp-field-mapping name="unitVvid" persistence-name="UNIT_VVID" />
<cmp-field-mapping name="sectionVvid" persistence-name="SEC_USER.SECTION_VVID" />
<cmp-field-mapping name="lastUpdateTimestamp" persistence-name="AUD_SYSTEM_OBJECT.LAST_UPDATE_DT" />
<cmp-field-mapping name="lastUpdateSystemUserId" persistence-name="AUD_SYSTEM_OBJECT.LAST_UPDATE_SEC_USER_ID" />
<cmp-field-mapping name="failedLoginAttempts" persistence-name="SEC_USER.LOGIN_ATTEMPTS_CNT" />
</entity-deployment>
<entity-deployment name="Permission" table="SEC_FUNCTION" data-source="datasource-ecmsOraclePool">
<primkey-mapping>
<cmp-field-mapping name="permisssionId" persistence-name="SEC_FUNCTION_ID" />
</primkey-mapping>
<cmp-field-mapping name="permission" persistence-name="FUNCTION_NAME" />
</entity-deployment>
<entity-deployment name="Role" table="SEC_ROLE" data-source="datasource-ecmsOraclePool">
<primkey-mapping>
<cmp-field-mapping name="roleId" persistence-name="SEC_ROLE.SEC_ROLE_ID" />
</primkey-mapping>
<cmp-field-mapping name="lastUpdateTimestamp" persistence-name="AUD_SYSTEM_OBJECT.LAST_UPDATE_DT" />
<cmp-field-mapping name="lastUpdateSystemUserId" persistence-name="AUD_SYSTEM_OBJECT.LAST_UPDATE_SEC_USER_ID" />
<cmp-field-mapping name="roleDescription" persistence-name="SEC_ROLE.ROLE_DESC" />
<cmp-field-mapping name="roleName" persistence-name="SEC_ROLE.ROLE_NAME" />
</entity-deployment>
<entity-deployment name="Password" table="SEC_USER_PASSWORD" data-source="datasource-ecmsOraclePool">
<primkey-mapping>
<cmp-field-mapping name="passwordId" persistence-name="SEC_USER_PASSWORD_ID" />
</primkey-mapping>
<cmp-field-mapping name="password" persistence-name="PASSWORD" />
<cmp-field-mapping name="activeInd" persistence-name="ACTIVE_IND" />
<cmp-field-mapping name="expirationDate" persistence-name="EXPIRATION_DATE" />
<cmp-field-mapping name="userId" persistence-name="SEC_USER_ID" />
<cmp-field-mapping name="lastUpdateTimestamp" persistence-name="AUD_SYSTEM_OBJECT.LAST_UPDATE_DT" />
<cmp-field-mapping name="lastUpdateSystemUserId" persistence-name="AUD_SYSTEM_OBJECT.LAST_UPDATE_SEC_USER_ID" />
</entity-deployment>
<entity-deployment name="UserRole" table="SEC_USER_ROLE" data-source="datasource-ecmsOraclePool">
<primkey-mapping>
<cmp-field-mapping name="userRoleId" persistence-name="SEC_USER_ROLE_ID" />
</primkey-mapping>
<cmp-field-mapping name="sequenceNum" persistence-name="SEQUENCE_NUM" />
<cmp-field-mapping name="userId" persistence-name="SEC_USER_ID" />
<cmp-field-mapping name="roleId" persistence-name="SEC_ROLE_ID" />
</entity-deployment>
<entity-deployment name="RolePermission" table="SEC_ROLE_FUNCTION" data-source="datasource-ecmsOraclePool">
<primkey-mapping>
<cmp-field-mapping name="roleFunctionId" persistence-name="SEC_ROLE_FUNCTION_ID" />
</primkey-mapping>
<cmp-field-mapping name="functionId" persistence-name="SEC_FUNCTION_ID" />
<cmp-field-mapping name="roleId" persistence-name="SEC_ROLE_ID" />
<cmp-field-mapping name="sequenceNum" persistence-name="SEQUENCE_NUM" />
</entity-deployment>
</enterprise-beans>
<assembly-descriptor>
</assembly-descriptor>
</orion-ejb-jar>Hi David,
The "autocreate-tables" attribute is defined in the DTD for the "orion-application.xml" file. This file is usually generated automatically by OC4J, from your application's "application.xml" file when you deploy your application. (Note that subsequent [re-]deployments of your application will not change the "orion-application.xml" file.)
The default value for this attribute is 'true', and the default is defined in the "application.xml" file that is located in the "j2ee/home/config" subdirectory of the OC4J installation.
Hope this answers your question.
Good Luck,
Avi. -
Problem on CREATING TABLES with PRIMARY KEY
Hi there !
I use the orcle 8i, and i don't know why i can't create table with any primary key EXample:
SQL> CREATE TABLE O_caisses
2 (No_caisse NUMBER(3) constraint caisses_pk PRIMARY KEY,
3 NB_BILLETS NUMBER(5)
4 )
5 /
CREATE TABLE O_caisses
ERROR at line 1:
ORA-18008: cannot find OUTLN schema
Please could some body help me !
Thanks alot!
Luong.Luong,
Your syntax is fine. It looks like you don't have the correct database privileges to create the table. The error message you're getting suggests that you don't have CREATE ANY OUTLINE privileges. You should log in as a user than can grant these privileges and give yourself the correct privileges. I think the syntax is
SQL>grant create any outline to username;
Alison
Maybe you are looking for
-
Something similar to "isdn network-failure-cause" command on Cisco 3600
Hi I have two Cisco 3600 with NM-HDV-2E1 on each chassis. The version of ios is Version 12.3(19) Sometimes the Cisco sends the 27 (Destination out of order) or the 38 (Network out of order) cause code, which is generally not correct, because most of
-
CAN NOT GET IN MY AKO MILITARY WEB SITE.MESSAGE SERVER NOT FOUND.WHY?
fix access.did not have this problem with internet explorer.
-
My catalog won't backup in Elemnents 11
The backup sequence freezes up when calculating the stotal media size of the file. It freezes up at 32%. This also happened with Elements 10.
-
Error in accessing ARD client 2.2.1 from ARD admin 3.2 via Airport
Hi all, I was successfullly accessing mac-mini machine having ARD client 2.2.1 which was connected to ethernet cable from ARD admin 3.2. But now when I am trying to access same mac-mini machine which is now connected to airport, I am getting followin
-
Deleted items also to be displayed in PO print preview
Hi I want the deleted items also to be displayed in PO print preview.. If it is possible What should i do in configuration ? Regards, Alagesan