-
Feb 13th, 2024, 04:40 AM
#1
Something weird
Hi Folks/Mods
just experienced something weird: In the Database-Forum i tried to help a User out with some SQL
.... and:
i was not able to post a SQL-DDL-Statement with a specific constraint.
The Forum just froze (Not the Browser!)
I'll try to post it here, trying to outwit the parser
The Constraint (intentional Typos!!)
(KASE WHEN Student_Class_ID IS NULL THEN 0 ELSE 1 END)+(KASE WHEN Teacher_Subject_ID IS NULL THEN 0 ELSE 1 END)=1
Code:
CREATE TABLE "tbl_transaction2" (
"ID" INTEGER,
"Payment" REAL,
"PayDate" TEXT,
"Student_Class_ID" INTEGER DEFAULT NULL,
"Teacher_Subject_ID" INTEGER DEFAULT NULL,
PRIMARY KEY("ID"),
FOREIGN KEY("Student_Class_ID") REFERENCES "tbl_student_class"("ID") ON UPDATE CASCADE ON DELETE RESTRICT,
FOREIGN KEY("Teacher_Subject_ID") REFERENCES "tbl_teacher_subject"("ID") ON UPDATE CASCADE ON DELETE RESTRICT,
CONSTRAINT "CheckForeignKeyXOR" CHECK(
/* Insert The Constraint from above here */
)
)
Since when is the Forum choking on an SQL-CASE/WHEN?
Last edited by Zvoni; Feb 13th, 2024 at 04:44 AM.
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Feb 13th, 2024, 05:26 AM
#2
Re: Something weird
I posted to the thread YOU reported.
-
Feb 13th, 2024, 05:38 AM
#3
Re: Something weird
Originally Posted by Steve R Jones
I posted to the thread YOU reported.
Sorry, Steve, just saw it.
I, too, first thought, it might have to do with the "widespread" of my earlier post, but that's not the case.
It definitely is that "constraint" above i had to write "wrong" intentionally to get it even posted here
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|