If we have n no of columns in a table, can we add new
column in that table with not null constraint?
Answers were Sorted based on User's Feedback
Answer / srinu
U r correct Chandan.But one thing,what is that is if the
table contains some data at that time syntax for adding new
column to that table with notnull constraint is....
alter table table_name add column_name datatype default
value constraint constraint_name not null;
if we want 2 know which columns have which constraints then
the syntax is
select column_name,constraint_type
from user_cons_columns
where table_name='EMP';
Is This Answer Correct ? | 7 Yes | 1 No |
Answer / chandan kumar
If table is empty (means no records are there) then we can
add the constraint.
alter table tablename add (col_name datatype not null)
Is This Answer Correct ? | 6 Yes | 2 No |
Explain ddl statements in pl/sql?
How do I install microsoft sql?
How to add a column ‘salary’ to a table employee_details?
Hi All, I am new to both this blog and technology. I was able to see a response for one of the questions on triggers as below. I would like to know why are we using " if rtrim(to_char(sysdate,'day'))=rtrim('sunday') then" instead, can't we use " if sysdate = 'sunday' then". I can understand the use of "rtrim", but dont know y v r using to_char. I have seen this in many cases but did not get a convincible explaination. Please help me with this and do excuse if this question sounds silly. Thanks in advance...... create or replace trigger trg_sun before insert on <table name> begin if rtrim(to_char(sysdate,'day'))=rtrim('sunday') then raise_application_error(-20345,'no transaction in sunday'); end if; end trg_sun;
what is inline command?
What view means?
Can I copy :old and :new pseudo-records in/to an oracle stored procedure?
What is the usage of nvl function?
I have one Excel file with 1,50,000 Records. Now I need to load that whole file into Oracle Database with same columns in Excel sheet . I need PLSQL Procedure or used by SQL PLUS
How can I change database name in sql?
What is the left table in sql?
What do we need to check in database testing?