CREATE TABLE "calc_modes" (
"template" VARCHAR2(20) NOT NULL,
"code" VARCHAR2(20) NOT NULL,
"name" VARCHAR2(40) NULL,
"type" NUMBER(4) NULL DEFAULT (0)
)
what is the proble with this query
3 1934
CREATE TABLE "calc_modes" (
"template" VARCHAR2(20) NOT NULL,
"code" VARCHAR2(20) NOT NULL,
"name" VARCHAR2(40) NULL,
"type" NUMBER(4) NULL DEFAULT (0)
)
what is the proble with this query
Remove the double quotes and if the column TYPE is to be assigned a default value, then how can it be null?
It's either allowed NULL values or assigned a default value but not both.
CREATE TABLE calc_modes (
template VARCHAR2(20) NOT NULL,
code VARCHAR2(20) NOT NULL,
name VARCHAR2(40) NULL,
type NUMBER(4) DEFAULT 0
);
Good Luck.
Remove the double quotes and if the column TYPE is to be assigned a default value, then how can it be null?
It's either allowed NULL values or assigned a default value but not both.
CREATE TABLE calc_modes (
template VARCHAR2(20) NOT NULL,
code VARCHAR2(20) NOT NULL,
name VARCHAR2(40) NULL,
type NUMBER(4) DEFAULT 0
);
Good Luck.
mivey4,
giving a table column a default value has nothing to do with whether or not it can be null. And there may be perfectly valid reasons for giving a nullable field a default value and visa versa. -
[138]dave@ORADB> create table a (
-
2 col1 number default 1 not null,
-
3 col2 number default 2 null );
-
-
Table created.
-
what you cannot do is this: -
[138]dave@ORADB> insert into a values (1,null);
-
-
1 row created.
-
-
[138]dave@ORADB> alter table a modify col2 not null;
-
alter table a modify col2 not null
-
*
-
ERROR at line 1:
-
ORA-02296: cannot enable (DAVE.) - null values found
-
mivey4,
giving a table column a default value has nothing to do with whether or not it can be null. And there may be perfectly valid reasons for giving a nullable field a default value and visa versa. -
[138]dave@ORADB> create table a (
-
2 col1 number default 1 not null,
-
3 col2 number default 2 null );
-
-
Table created.
-
what you cannot do is this: -
[138]dave@ORADB> insert into a values (1,null);
-
-
1 row created.
-
-
[138]dave@ORADB> alter table a modify col2 not null;
-
alter table a modify col2 not null
-
*
-
ERROR at line 1:
-
ORA-02296: cannot enable (DAVE.) - null values found
-
Sorry about that,
You are absolutely correct, Dave. I didn't devote a lot of thought on that until after I'd posted the response. Thanks for the correction.
mivey4
Sign in to post your reply or Sign up for a free account.
Similar topics
by: lkrubner |
last post by:
I have a webserver through Rackspace. I create a domain. I create an
FTP user. I upload some files. I create a database called
testOfSetupScript and then I create a database user named setup.
I...
|
by: Andrew McNab |
last post by:
Hi folks,
I have a problem with an MS Access SQL query which is being used in an
Access Report, and am wondering if anyone can help.
Basically, my query (shown below) gets some records from a...
|
by: Andrew McNab |
last post by:
Hi folks,
I have a problem with an MS Access SQL query which is being used in an
Access Report, and am wondering if anyone can help.
Basically, my query (shown below) gets some records from a...
|
by: frank |
last post by:
I posted a question before (to too many groups) and this time I am
sending to this group only. I have a quick script as seen below, the
file_list table has a unique field called file_name.
The...
|
by: Andy_Khosravi |
last post by:
I have been trying to build a user friendly search engine for a small
database I have created. I'm having some particular problems with one
of my date fields.
Here's the setup:
I'm using...
|
by: JIM.H. |
last post by:
Hello,
I am trying to send Where clause as a parameter. Here is the detail:
Select statment:
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "SELECT * " +
" FROM myTable " +
"...
|
by: Xah Lee |
last post by:
in March, i posted a essay “What is Expressiveness in a Computer
Language”, archived at:
http://xahlee.org/perl-python/what_is_expresiveness.html
I was informed then that there is a academic...
|
by: Brian Hampson |
last post by:
I am trying to determine all the groups which the current user has
permissions to add a member.
Here's my code:
foreach (System.DirectoryServices.SearchResult ADSearchres in...
|
by: CTG |
last post by:
"update set UPDATE-FLAG=false, UPDATE-DT= '10/09/2007
4:09:59 PM' WHERE ICCID='I1' "
UPDATE_FLAG is a YES/NO
ICCID is TEXT
I have tried YES, NO as well but still fails,
|
by: QCLee |
last post by:
Sir can you help me to transfer my Access Query to MS excel? i have a
command button on the form to export the parameter query named
"HVACWindwardQuery" to excel spreadsheet and i got the codes...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |