Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
newbeetoday
Starting Member
2 Posts |
Posted - 2006-08-25 : 02:23:24
|
| Hi, can somebody help me with some verification SQL commands that I need to run on an Oracle database?In the Oracle table 'FEE', if the 'FEETYPE' column has a value of '3' for a record, then the 'PERCENTAMOUNT' column needs to be not null for that row - can somebody put this into a command for me so I can make lots like it?another one I have is in the 'FEE' table, if the 'FEETYPE' column has a value of '1', the 'PERIOD' column needs to always have a value of '3' for that row - is there a command that can check the records that do/do not have this information?Any halp is greatly appreciated :) |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-08-25 : 02:27:42
|
| I don't know the syntax for creating ORACLE constraints, but you should create a constraint on the table that prevents PERCENTAMOUNT to be NULL when FEETYPE = 3.The second question can be solved the same say.Peter LarssonHelsingborg, Sweden |
 |
|
|
newbeetoday
Starting Member
2 Posts |
Posted - 2006-08-25 : 02:33:31
|
| Sorry I was not clear enough in my initial question, I was after the SQLPLUS command to query an existing Oracle database. Can you help? |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-08-25 : 03:18:06
|
| [code]select *from feewhere feetype <> 3 or feetype = 3 and percentamount is not nullselect *from feewhere feetype <> 1 or feetype = 1 and period = 3[/code]or[/code]select *from feewhere feetype <> 3 or feetype = 3 and percentamount is not null or feetype <> 1 or feetype = 1 and period = 3[/code]or[/code]select *from feewhere not (feetype = 3 and percentamount is null or feetype = 1 and period <> 3)[/code]Peter LarssonHelsingborg, Sweden |
 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-08-25 : 08:02:49
|
| Hi newbeetoday,This is a Microsoft SQL server (Sequel Server) Forum.Ur Qs may be better answered (mainly PL-SQL / SQLPLUS stuff) in an Oracle ForumSrinika |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|