Create table with fieldname = keywords
Hi to all
I must create a table with a field with name SECTION
But "section" is a keywords and so it seems impossible.
Anybody can help me?
I have to say that's a bad practice. You can workaround by double-quotes usage around the field name, but you have to manage those ones every time you'll invoke this field. Furthermore, that become case sensitive...
SQL> create table mytbl3(order number);
create table mytbl3(order number)
ERROR at line 1:
ORA-00904: : invalid identifier
SQL> create table mytbl3("order" number);
Table created.
SQL> select order from mytbl3;
select order from mytbl3
ERROR at line 1:
ORA-00936: missing expression
SQL> select "ORDER" from mytbl3;
select "ORDER" from mytbl3
ERROR at line 1:
ORA-00904: "ORDER": invalid identifier
SQL> select "order" from mytbl3;
no rows selected
SQL>Think more if you have really good reason to work on such sad thing.
Nicolas.
Similar Messages
-
OID users ( EUS) problem with grant create table with admin
Hi,
We activated enterprise users in the OID.
There is a role APP_ADMIN that has the following grants:
create user
drop user
create table with admin option
this is for an application that creates BI schemas, so it needs to be able to create other users.
I have granted these to a local role, and the user has access to the local role, thanks to the OID setup.
The create and drop user work.
however, the grant create table to another user does not work.
Is there an issue with 'with admin option' grants in Enterprise user security?
Regards,
PeterIf I grant
grant create table to test_role with admin option;
it does not work
if I grant
GRANT GRANT ANY PRIVILEGE to test_role WITH ADMIN OPTION;
it does work.
The test command as user with test_role is:
grant create table to test_usr;
very strange!
If the user is a standard user and I create role test_role
and grant create table to test_role with admin option it works.
but if I convert the user to an EUS user and the same privilege is given to the role ( role is granted to a global role to an enterprise role)
it doesnt work
Edited by: Peter on Dec 7, 2012 2:36 PM -
Unable to create table with column default value with date interval
Please help to create table with calculated date defaullt value:
CREATE TABLE emp (
birth_date DATE DEFAULT sysdate + interval '3' day NOT NULL
or
CREATE TABLE emp (
some_date DATE,
birth_date DATE DEFAULT some_date NOT NULL
or
CREATE TABLE emp (
some_date DATE,
birth_date DATE DEFAULT some_date + interval '3' day NOT NULL
below syntax error:
TT1001: Syntax error in SQL statement before or at: "+"I'm afraid this is not possible; as per the SQL Reference, TimesTen only supports 'constant expressions' for the DEFAULT clause and none of these are constant expressions.
Chris -
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 -
How to create table with dynamic rows
Hi Ppl,
I have an array lets say with length of n. I want to creata table with 2 columns and no of rows = array length.
lets say array length is 3 ( array[0] = 1, array[1] = 2, array[2] = 3) so the table should have 2 columns and 3 rows.
After creation of table I want to display each array value in each row.
Can somebody help me in this asap.
Thanks \
AshishHi, Thanks for reply... actually this is one part of rtf. I have put values from xml to an array and now I want to create a table with no of rows = length of array. so here xml will not be useful. could you pls think of it without xml.
result is like
lets says below is the array
array[0] = a
array[1] = b
array[2] = c
array length = 3
so there should be a table of 2 coulmns and 3 rows. Second column of first row will show 'a', Second column of second row wil show 'b' and Second column of third row will show 'c'.
Hope this is useful.
Thakns
Ashish -
How to create table with table description
Hi,
I would like create table with table description(like creating package or procedure with comments).
Is it possible to achieve through oracle, if possible please help me how to achieve this.
Thanks and regards,
Ibrahim Sayyed.> create table test (col1 number);
> comment on table test is 'this is a comment';
> select comments from user_tab_comments where table_name = 'TEST';
COMMENTS
this is a comment -
How to create table with row type in smart forms
How to create table with row type in smart forms with out line type
please explain me the procedureHI,
A table type describes the structure and functional attributes of an internal table in ABAP. In ABAP programs you can reference a table type TTYP defined in the ABAP Dictionary with the command DATA <inttab> TYPE TTYP. An internal table <inttab> is created in the program with the attributes defined for TTYP in the ABAP Dictionary.
A table type is defined by:
its line type, that defines the structure and data type attributes of a line of the internal table
the options for managing and accessing the data ( access mode) in the internal table
the key ( key definition and key category) of the internal table
The row type is defined by directly entering the data type, length and number of decimal places or by referencing a data element, structured type ( structure, table or view) or other table type. Or the row type can be a reference type.
<b>for more info :</b> http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm
Internal table
Regards
Sudheer -
How to create table with resizable row ?
how to create table with resizable row ?
I'd suggest you start here:
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html -
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 -
How i can create table with data
How i can create table with data from dev to production?
How i can create table with data
[url=http://en.wikipedia.org/wiki/Black_Beast_of_Aa
aaarrrrrrggghhh]from dev to production?
[url=http://img2.travelblog.org/Photos/3800/14977/t
/64816-Col-Kurtz-0.jpg]The horror, the
horror.lol, you gonna scare somebody here.
Are we helping devil? -
Creating table with null and not null values.
I have to create a table with 5 Null nd 5 Not Null fields.My questionis which fields are place first?Not or Not Null and why???
What you mean is: the person who asked you the question thought the order of columns was important, and wanted to see if you agreed. Or maybe they were just asking the question to see whether you thought it was important (as a test of your understanding of the database).
When I started out in Oracle I was told that it was good practice to have the mandatory columns first and then the optional columns. But if you do some research you find this: the impact of column ordering on space management is: empty nullable columns at the end of the table take up zero bytes whereas empty nullable columns at the middle of the table take up one byte each. I think if that saving really is important to you you need to spring for an additional hard drive.
Besides, even if you do organise your columns as you suggest, what happens when you add an eleventh NOT NULL column to your table? It gets tacked on to the end of your table. Your whole neat organisation is blown.
What does still matter is the positioning of large VARCHAR2 columns: they should be the last columns on your table in case they create chaining. Then any query that doesn't need the large columns can be satisfied without reading the chained block, something that can't be guaranteed if you've got columns after a VARCHAR2(4000) column. This doesn't apply to CLOBs, etc. which are stored separately anyway.
Cheers, APC -
Error while creating table with clusters
Hi
I tried the following
CREATE CLUSTER emp_dept (deptno NUMBER(3))Cluster is created
Then i tried to create the table having the above cluster but giving the errors:
create table emp10 (ename char(5),deptno number(2) )cluster emp_dept(deptno);The error is:
ORA-01753 column definition incompatible with clustered column definitionCould you please help me in thisYour cluster is based on a NUMBER(3) data type while the emp10 table has a deptno column with a data type of NUMBER(2).
-
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 -
Create table with name already existed
Hello,
I am trying to create a table which has the same table name that already exists in a different schema. The table already exist in another user's schema but why can't I create the same table in my own schema with the same name? Thank you.Check this out.
SQL> create user testuser1 identified by testuser1 default tablespace user01;
User created.
SQL> create user testuser2 identified by testuser2 default tablespace user01;
User created.
SQL> grant create session, create table, create public synonym,
2 unlimited tablespace to testuser1;
Grant succeeded.
SQL> grant create session, create table, create public synonym,
2 unlimited tablespace to testuser2;
Grant succeeded.
SQL> connect testuser1/testuser1
Connected.
SQL> create table mytable(col1 number);
Table created.
SQL> create public synonym mytable for testuser1.mytable;
Synonym created.
SQL> grant select on mytable to public;
Grant succeeded.
SQL> connect testuser2/testuser2
Connected.
SQL> create table mytable(col1 number);
Table created.
SQL> drop table mytable;
Table dropped.
SQL> desc mytable
Name Null? Type
COL1 NUMBER
SQL> desc testuser1.mytable
Name Null? Type
COL1 NUMBER
SQL> disconnect
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.3.0 - Production -
Create table with storage parameters in a locally managed tablespace
Hi,
Can we create object with storage parameters in a locally managed tablespace.
CREATE TABLE my_hash_table_6 (
name VARCHAR2(30),
value VARCHAR2(4000) )
STORAGE (
INITIAL 1M
NEXT 512K
PCTINCREASE 0
MINEXTENTS 2
MAXEXTENTS UNLIMITED )
users default tablespace is locallly managed.
Then this table's extent management will be managed as per the tablespace or as the storage parameters which
were specified at the time of table creation.Why don't you try it yourself ?
TEST@db102 > select * from dba_tablespaces
2 where TABLESPACE_NAME='USERS';
TABLESPACE_NAME BLOCK_SIZE INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS
MAX_EXTENTS PCT_INCREASE MIN_EXTLEN STATUS CONTENTS LOGGING FOR EXTENT_MAN
ALLOCATIO PLU SEGMEN DEF_TAB_ RETENTION BIG
USERS 8192 65536 1
2147483645 65536 ONLINE PERMANENT LOGGING NO LOCAL
SYSTEM NO AUTO DISABLED NOT APPLY NO
TEST@db102 > CREATE TABLE my_hash_table_6 (
2 name VARCHAR2(30),
3 value VARCHAR2(4000) )
4 STORAGE (
5 INITIAL 1M
6 NEXT 512K
7 PCTINCREASE 0
8 MINEXTENTS 2
9* MAXEXTENTS UNLIMITED )
TEST@db102 > /
Table created.
TEST@db102 > select * from user_segments
2 where segment_name='MY_HASH_TABLE_6';
SEGMENT_NAME
PARTITION_NAME SEGMENT_TYPE TABLESPACE_NAME
BYTES BLOCKS EXTENTS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS
MAX_EXTENTS PCT_INCREASE FREELISTS FREELIST_GROUPS BUFFER_
MY_HASH_TABLE_6
TABLE USERS
2097152 256 2 1572864 1
2147483645 DEFAULT
TEST@db102 >
Maybe you are looking for
-
CS5 slow to get the 'open' and 'save' dialog box over networked computer.
I have been having this problem since the suite was installed, but recently has gotten much slower. Any time I click open or save it takes 8-10 seconds just for the dialog box to come up. CS1 was lightening fast - I know that was ages ago, but I can
-
Adobe Photoshop cs4 download trial help?
When I try to downlaod the trial for cs4, on my Mac, it says something about the disk I/O failure... help?
-
i tried to publish my site, but the error "folder can not be made //images"occurs repetetly. What can i do? The site is: http://kampfkunst-amlech.businesscatalyst.com/index.html and i want it to put it there: www.kampfkunst-amlech.de The image files
-
Can you make still photos have a 3D "look" in Motion 5?
Hello All, I don't mean 3D like the kind you need to see with blue and red glasses, I mean that technique where you can make different objects in the still photo appear as if the camera is moving passed them. If this can be done in Motion 5 does anyo
-
ADOBE CC - Germany - Can't open Photoshop and other programs - can't connect ADOBE
Hello - I try to open my CC program's - but don't work. I get always the information hat I have to much profiles. But is not true. I try to connect with ADOPE to close all profils. But doesnt work. No connection to ADOBE