Connecting Tech Pros Worldwide Forums | Help | Site Map

For Oracle Sql plus

Newbie
 
Join Date: Oct 2007
Posts: 4
#1: Oct 24 '07
One table contains information about courses offered at a local college. A course number like MATH1301 or HIST2311 identifies each course. All course numbers are the same length. Each course has a name and number of credit hours earned for successful completion of the course. All information in this table is mandatory. The values stored in the credit hours must be greater than zero and less than 100.


check this
and how can u make this possible?

amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#2: Oct 25 '07

re: For Oracle Sql plus


Quote:

Originally Posted by HARSHUL

One table contains information about courses offered at a local college. A course number like MATH1301 or HIST2311 identifies each course. All course numbers are the same length. Each course has a name and number of credit hours earned for successful completion of the course. All information in this table is mandatory. The values stored in the credit hours must be greater than zero and less than 100.


check this
and how can u make this possible?

You can add NOT NULL constraint on all the columns of the table
ADD CHECK constraint for credit hours to be between 0 and 100
Newbie
 
Join Date: Oct 2007
Posts: 4
#3: Oct 25 '07

re: For Oracle Sql plus


Quote:

Originally Posted by amitpatel66

You can add NOT NULL constraint on all the columns of the table
ADD CHECK constraint for credit hours to be between 0 and 100


I did Not Null
but add check constraint right?
but in coding i am doing but now it is giving me an error
i check that but it is not working
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#4: Oct 26 '07

re: For Oracle Sql plus


Quote:

Originally Posted by HARSHUL

I did Not Null
but add check constraint right?
but in coding i am doing but now it is giving me an error
i check that but it is not working

Can you PSOT your error number and error message for my reference?
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,508
#5: Oct 26 '07

re: For Oracle Sql plus


Kindly post the table structure for reference of our experts.
Newbie
 
Join Date: Oct 2007
Posts: 4
#6: Oct 26 '07

re: For Oracle Sql plus


Quote:

Originally Posted by debasisdas

Kindly post the table structure for reference of our experts.

Part 2. Insert the following data into the three tables
Chip name DOB Dep Course title hrs
1234 Bob Smith 11Dec1953 M 3 Math1314 Algebra 3 B
1111 Sally M Jones 1 June 73 F 5 Math1314 Algebra 3
1111 Sally M Jones 1 June 73 F 5 HIST1301 US 3 B
1234 Bob Smith 11Dec1953 M 3 Hist1301 US 3 A
PHED1109 Yoga 1
2121 Al A Ala 6Novem83 M PHED1108 Dance 1
3333 Sue Chen 29 Feb 82 F 0
Newbie
 
Join Date: Oct 2007
Posts: 4
#7: Oct 26 '07

re: For Oracle Sql plus


Insert Into Student(name, Lastname, Birthdate,gender,chip)
Values ('sue','chen', '29-02-1982','f','3333');

When I Trying To Put Date
Month Feb
But It Is Not Working It Is Giving Me Error No

Ora-01830

And I Tried With 02
Then Giivng Me One More Error
Ora-01843
So Any Sugestion?
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#8: Oct 28 '07

re: For Oracle Sql plus


Quote:

Originally Posted by HARSHUL

Insert Into Student(name, Lastname, Birthdate,gender,chip)
Values ('sue','chen', '29-02-1982','f','3333');

When I Trying To Put Date
Month Feb
But It Is Not Working It Is Giving Me Error No

Ora-01830

And I Tried With 02
Then Giivng Me One More Error
Ora-01843
So Any Sugestion?

Try TO_DATE function here:

check below query:

Expand|Select|Wrap|Line Numbers
  1. Insert Into Student(name, Lastname, Birthdate,gender,chip)
  2.   Values ('sue','chen',TO_DATE('29-02-1982','DD-MM-YYYY'),'f','3333');
  3.  
Reply