Re: table locking and priorities

2001-06-13 Thread Mohammad Shoja


No, I mean you can use an autoincrement field besides your username field.
and use that to constructing user name,
In this way you will be sure about uniqness and also you can maintain your
user name as a text field although its some sort of redundancy.

Regards


 Hi,
 
 The username field is text and number so you I can't autoincrement a
 username like abc003434 ...
 
 
 - Original Message -
 From: Mohammad Shoja [EMAIL PROTECTED]
 To: anna soobrattee [EMAIL PROTECTED]
 Sent: Wednesday, June 13, 2001 11:57 AM
 Subject: Re: table locking and priorities
 
 
  Hi Anna,
 
  Why you dont use auto increment field,
  Without a sequence (in Oracle) or Autoincrement (in MySQL) how you will be
  sure about uniquness of your key ?
  Mohammad
 
 
   Hi All,
  
   Can anyone help me...
  
   My registration form looks up the last username in the members table
 (select
   distinct username from members order by uid desc limit 1), and
 increments
   this username (e.g. from abc2 abc3) which will be used as the
   username for the next user to sign up...
  
   the problem occurs when in the time it takes to do an insert, several
   selects can take place - so i have the case where there are users with
 the
   same username (which is not very good at all)
  
   Can I force the selects to lock, whilst the insert is taking place?  Has
   anyone got any ideas on how to get aorund this ?
  
   Please write back soon!
   Anna
  
  
 
  --
  Mohammadreza Shojatalab
  European Bioinformatics InstituteTel: +44 (0)1223 494 669
  EMBL Outstation  Fax: +44 (0)1223 494 468
  Wellcome Trust Genome Campus E-Mail: [EMAIL PROTECTED]
  Hinxton, Cambridge   URL: http://www.ebi.ac.uk/~shoja
  CB10 1SD, UK
 
 
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 

--
Mohammadreza Shojatalab  
European Bioinformatics InstituteTel: +44 (0)1223 494 669  
  
EMBL Outstation  Fax: +44 (0)1223 494 468  
  
Wellcome Trust Genome Campus E-Mail: [EMAIL PROTECTED]   
  
Hinxton, Cambridge   URL: http://www.ebi.ac.uk/~shoja  
  
CB10 1SD, UK


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Again MySQL and LOG

2001-05-31 Thread Mohammad Shoja

Thank you all for your suggestions,
I'm using tcsh so I resolve this problem like this:

mysql -u root dbname  test.sql ! log

and its working on command line but the problem is, it doesnt work when I
put mentioned statement into a bach file.
for example I create a file (createtables) and its contain the following:

mysql -T -u root dbname  test.sql ! log

and assign appropriate permissions and it doesnt work.

should I use some specific options or stuff like that ?
Why its working in command line

Thank you in advance for your helps.
regards
--
Mohammadreza Shojatalab  
European Bioinformatics InstituteTel: +44 (0)1223 494 669  
  
EMBL Outstation  Fax: +44 (0)1223 494 468  
  
Wellcome Trust Genome Campus E-Mail: [EMAIL PROTECTED]   
  
Hinxton, Cambridge   URL: http://www.ebi.ac.uk/~shoja  
  
CB10 1SD, UK


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Can't connect to local MySQL server through socket '/tmp/mysql.sock'(2)

2001-05-30 Thread Mohammad Shoja

Thank you for all your suggestions,
I got it.
the problem was in our web server because of security $ENV{HOME} doesnt
point to my home directory so my .my.cnf file was unreachable.
That's it.
may be It can be helpful for other people as well.

 my %attr = (
   PrintError =0,
   RaiseError =0
   );
 
 $dbh = DBI-connect(
 DBI:mysql:array;mysql_read_default_file=$ENV{HOME}/.my.cnf,
   root,
   ,
\%attr);
 if (defined($dbh)){
   print \n Connected successfully, $DBI::errstr;
   $rc = STATUS_OK;
   $dbh-disconnect;
 }
 else {
   print \n $DBI::errstr\n;
   $rc = undef;
 
 }
 
--
Mohammadreza Shojatalab  
European Bioinformatics InstituteTel: +44 (0)1223 494 669  
  
EMBL Outstation  Fax: +44 (0)1223 494 468  
  
Wellcome Trust Genome Campus E-Mail: [EMAIL PROTECTED]   
  
Hinxton, Cambridge   URL: http://www.ebi.ac.uk/~shoja  
  
CB10 1SD, UK


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Log

2001-05-30 Thread Mohammad Shoja

Hello everybody.
would you please tell me how can I log execution of a DDL?
I have a test.sql which is a DDL file, I wanna log its output but when I
try the following it create log file but its empty.

mysql -u root databasename test.sql log

it Just send errors and logs to STDERR.
Thanks you for your helps in advance.
Regards
--
Mohammadreza Shojatalab  
European Bioinformatics InstituteTel: +44 (0)1223 494 669  
  
EMBL Outstation  Fax: +44 (0)1223 494 468  
  
Wellcome Trust Genome Campus E-Mail: [EMAIL PROTECTED]   
  
Hinxton, Cambridge   URL: http://www.ebi.ac.uk/~shoja  
  
CB10 1SD, UK


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: SELECT question.

2001-05-30 Thread Mohammad Shoja



 I am stuck on a select query and was wondering if someone could help.  I
 have I've written a database app. that helps me run my business
 (trucking).  I need however to write a query that shows me all of the
 loads that are delivered but not billed (invoiced).  Which means that I
 have to select the loads that are delivered but do not have an entry in
 the INVOICED table -- since an entry is made in the INVOICED table
 whenever a load is billed.
 
 I know the query below won't work.  Can someone please help me fix it?
 
 SELECT l.load_no l.date FROM loads l, invoiced i
 WHERE l.dlvr_date  0
 AND l.load_no != i.load_no
 
 
 Thanks,
 
 Richard

Because MySQL doesnt support subquery I think you have to breake your sql
and bring your logic into your bussiness layer.
Maybe you can find better solution but at least this can resolve your
problem.

regards
--
Mohammadreza Shojatalab  
European Bioinformatics InstituteTel: +44 (0)1223 494 669  
  
EMBL Outstation  Fax: +44 (0)1223 494 468  
  
Wellcome Trust Genome Campus E-Mail: [EMAIL PROTECTED]   
  
Hinxton, Cambridge   URL: http://www.ebi.ac.uk/~shoja  
  
CB10 1SD, UK


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Log HELP!

2001-05-30 Thread Mohammad Shoja


Mybe this is not a mysql question but a unix command line question:
would you please tell me how can I log execution of a DDL?
I have a test.sql which is a DDL file, I wanna log its output but when I
try the following it create log file but its empty.

mysql -u root databasename test.sql log

it Just send errors and logs to STDERR.
Thanks you for your helps in advance.


Regards
--
Mohammadreza Shojatalab  
European Bioinformatics InstituteTel: +44 (0)1223 494 669  
  
EMBL Outstation  Fax: +44 (0)1223 494 468  
  
Wellcome Trust Genome Campus E-Mail: [EMAIL PROTECTED]   
  
Hinxton, Cambridge   URL: http://www.ebi.ac.uk/~shoja  
  
CB10 1SD, UK



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Can't connect to local MySQL server through socket '/tmp/mysql.sock'(2)

2001-05-29 Thread Mohammad Shoja

Thanks for your reply
The question is why in command line there is no problem?

 It is looking for /tmp/mysql.sock and the one that exists is
 /tmp/mysql.sock.shoja
 
 Two different files.. It can't find what it is looking for. Try:
 
 safe_mysqld --socket=/tmp/mysql.sock
 
 and it should work
 
 I just had the same problem.
 
 thanks,
 shawn
 
 

--
Mohammadreza Shojatalab  
European Bioinformatics InstituteTel: +44 (0)1223 494 669  
  
EMBL Outstation  Fax: +44 (0)1223 494 468  
  
Wellcome Trust Genome Campus E-Mail: [EMAIL PROTECTED]   
  
Hinxton, Cambridge   URL: http://www.ebi.ac.uk/~shoja  
  
CB10 1SD, UK


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php