Results 1 to 3 of 3

Thread: Something weird

  1. #1

    Thread Starter
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,528

    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

  2. #2
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Largo, FL.
    Posts
    1,886

    Re: Something weird

    I posted to the thread YOU reported.

  3. #3

    Thread Starter
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,528

    Re: Something weird

    Quote Originally Posted by Steve R Jones View Post
    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
  •  



Click Here to Expand Forum to Full Width