Advertisement
Advertisement
| 02.19.2008 at 02:19AM PST, ID: 23173871 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: |
CREATE TABLE test (PK int primary key, LK int not null, histtop char(1) not null ) / create or replace function test_func2(par1 int, par2 char) return int deterministic as begin if par2 = 'Y' then return par1; else return null; end if; end; / create unique index test_idx on test(test_func2(LK, histtop)) / |
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 02.19.2008 at 02:21AM PST, ID: 20927031 |
| 02.19.2008 at 02:43AM PST, ID: 20927109 |
1: 2: |
CREATE TRIGGER htcu_ORC_OrgUnit` BEFORE UPDATE ON `ORC_OrgUnit` FOR EACH ROW BEGIN if ((NEW.`LK` = 0) OR (NEW.`histtop` = 'Y' AND (SELECT count(*) FROM `ORC_OrgUnit` WHERE `ORC_OrgUnit`.`histtop`='Y' AND `ORC_OrgUnit`.`LKt`=NEW.`LK` AND `ORC_OrgUnit`.`PK`<>NEW.`PK`) > 0)) THEN call RAISE_APPLICATION_ERROR(-20000, 'duplicate histtop'); END IF; END;// CREATE TRIGGER `htci_ORC_OrgUnit` BEFORE INSERT ON `ORC_OrgUnit` FOR EACH ROW BEGIN if ((NEW.`LK` = 0) OR (NEW.`histtop` = 'Y' AND (SELECT count(*) FROM `ORC_OrgUnit` WHERE `ORC_OrgUnit`.`histtop`='Y' AND `ORC_OrgUnit`.`LK`=NEW.`LK`) > 0)) THEN call RAISE_APPLICATION_ERROR(-20000, 'duplicate histtop'); END IF; END;// |
| 02.19.2008 at 03:07AM PST, ID: 20927192 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: |
create table t ( lk int, histtop char(1) ) go insert into t values ( 1, 'Y') insert into t values ( 2, 'N') go alter table t add cc_lk as case when histtop = 'Y' then lk else null end go insert into t values ( 11, 'Y') insert into t values ( 12, 'N') go create index idx_cc on t (cc_lk ) go select * from t go drop table t |
| 02.19.2008 at 09:34AM PST, ID: 20930546 |
1: 2: |
ALTER TABLE t ADD "histtopcons" AS CASE WHEN "histtop" = 'Y' then 'L' + CAST("LK" AS VarChar(12)) else 'P' + CAST("PK" AS VarChar(12)) END
CREATE UNIQUE INDEX t_dhidx ON t ("histtopcons")
|