#16 problems with cjeck statement in SQL generation

closed-accepted
None
5
2009-09-08
2009-09-03
Mind And Go
No

Hello,

Thanks for your great job.
I'm currently working with gambas .15 and your 1.2.9 release.

As your DDL definition is correct in the DDL Tab of the Table window, it is incorrect in the file or preview generated by your application. The check statement still empty.

For example I Added "email ~* '^[a-z][a-z0-9_.-]*@[a-z][a-z0-9_.-]*$'" in the check field of the column name.
The DDL tab gave me :
"CREATE TABLE "utilisateur" (
"id_utilisateur" serial NOT NULL,
"login" character varying(6) NOT NULL,
"nom" character varying NOT NULL,
"prenom" character varying NOT NULL,
"email" character varying CHECK(email ~* '^[a-z][a-z0-9_.-]*@[a-z][a-z0-9_.-]*$')
) WITH OIDS;

ALTER TABLE "utilisateur" ADD CONSTRAINT "utilisateur_pk" PRIMARY KEY("id_utilisateur","login");"

Which is correct.

Unfortunately, the sql generation gave me :
"-- Start Table's declaration
DROP TABLE IF EXISTS "utilisateur" CASCADE;
CREATE TABLE "utilisateur" (
"id_utilisateur" serial NOT NULL,
"login" character varying(6) NOT NULL,
"nom" character varying NOT NULL,
"prenom" character varying NOT NULL,
"email" character varying CHECK ()
) WITH OIDS;
ALTER TABLE "utilisateur" ADD CONSTRAINT "utilisateur_pk" PRIMARY KEY("id_utilisateur","login");

-- End Table's declaration"

Note that the check statement is empty.

Discussion

  • Carlotto Luigi

    Carlotto Luigi - 2009-09-03

    Hello,

    Indeed, it is possible that the characters in the regex abnormally affect the generation of the SQL command.
    I will try to build a table like you did, and I'll see how does the program ...

    I will try to resolve the problem soon!

    Thanks for reporting!

     
  • Carlotto Luigi

    Carlotto Luigi - 2009-09-03
    • assigned_to: nobody --> md9327
     
  • Carlotto Luigi

    Carlotto Luigi - 2009-09-08
    • status: open --> closed-accepted
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks