RE: DEFAULT USER

"Anhaus, Thomas" <[email protected]> Thu, 31 May 2007 15:07:34 +0200
Newsgroups gmane.comp.db.maxdb
Message-ID <[email protected]>
Luca Calderano wrote :
 
> Sent: Mittwoch, 30. Mai 2007 17:49
> To: [email protected]
> Subject: DEFAULT USER
> 
> 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 
> 
> -- 
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:    
> http://lists.mysql.com/[email protected]
> 
>

Hi Luca,
I could not reproduce the problem, in my case all users insert different user names into the table. May I ask you which MaxDB version you are using ?
Besides, maybe the following workaround helps : 

CREATE DBPROC "GestionePratiche"."spFOO_INS" ( IN @P1 Fixed (10,0) ,
 IN @P2 varchar(32)
 ) AS
 VAR
   CURRUSER CHAR(32);
 CURRUSER = USER;
 INSERT INTO FOO ( ID,
 NOTES)
 VALUES ( :@P1, :@P2, :CURRUSER);

Best Regards,
Thomas

Thomas Anhaus
SAP AG
mailto: [email protected]
www.sap.com
Sitz der Gesellschaft/Registered Office: Walldorf, Germany
Vorstand/SAP Executive Board: Henning Kagermann (Sprecher/CEO), Shai Agassi, Léo Apotheker, Werner Brandt, Claus Heinrich, Gerhard Oswald, Peter Zencke
Vorsitzender des Aufsichtsrats/Chairperson of the SAP Supervisory Board: Hasso Plattner 
Registergericht/Commercial Register Mannheim No HRB 350269

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt.
Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.
 
This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.
  

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[email protected]