Re: DEFAULT USER
"Luca Calderano" <[email protected]> Thu, 31 May 2007 14:54:32 +0200
| Newsgroups | gmane.comp.db.maxdb |
|---|---|
| Message-ID | <[email protected]> |
----- Original Message ----- From: "Robert Klemme" <[email protected]> To: "Luca Calderano" <[email protected]>; <[email protected]> Sent: Thursday, May 31, 2007 2:04 PM Subject: Re: DEFAULT USER > 2007/5/31, Luca Calderano <[email protected]>: >> >> ----- Original Message ----- >> From: "Robert Klemme" <[email protected]> >> To: "Luca Calderano" <[email protected]> >> Cc: <[email protected]> >> Sent: Thursday, May 31, 2007 10:10 AM >> Subject: Re: DEFAULT USER >> >> >> > 2007/5/30, Luca Calderano <[email protected]>: >> >> Using Maxdb I've found a strange error >> >> >> >> I've defined a table this way: >> >> >> >> CREATE TABLE FOO( >> >> ID Fixed (10,0) NOT NULL DEFAULT SERIAL (1), >> >> NOTES Varchar (255) ASCII NOT NULL, >> >> USERID Varchar (32) ASCII NOT NULL DEFAULT USER >> >> ) >> >> >> >> I've defined 20 USERS which in order to insert records in the table >> >> above >> >> defined have to exec the folowing stored procedure: >> >> >> >> CREATE DBPROC "GestionePratiche"."spFOO_INS" ( IN @P1 Fixed (10,0) , >> >> IN @P2 varchar(32) >> >> ) AS >> >> INSERT INTO FOO ( ID, >> >> NOTES) >> >> VALUES ( :@P1, :@P2); >> >> // >> >> >> >> here comes the error: >> >> doesn't matter which user executes the stored, but the username >> >> recorded >> >> in >> >> the table is the one of the first user who has logged in the database >> > >> > Well, that clearly indicates that USER is evaluated on table creation >> > not on record insertion. You probably want to be using a trigger >> > instead. >> > >> > robert >> > >> sorry, but the user that alwais appears in the field named "USERID" is >> not >> the user that created the table > > That's an interesting point. But regardless of that it seems to be > clear that the value is evaluated only once. Did you try to use a > trigger? > Can U teel me what do you exactly mean ? -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[email protected]