Warning

2005-04-10 Thread Ady Wicaksono
I;m using redhat linux 9.0 and MySQL 4.1.9
I found this lines on my log file
050411 11:31:50 [Warning] Asked for 196608 thread stack, but got 126976
050411 11:31:50 [Warning] Asked for 196608 thread stack, but got 126976
Is it bad ?
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


foreign key design stratgies

2005-04-10 Thread Steve Lefevre
Hey folks -
I'm having a little problem understanding ON DELETE foreign key 
constraints. Here's my options from the manual:

[ON DELETE {RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT}]
When do I use each one? I can find anything in the online manual that 
suggests how to construct a database using this.

Let's take two examples, and here are my guesses:
1. A simple accounting database, with a clients, invoices, and 
line_items table.

My guess is that you would give invoices a foreign key in clients with 
ON DELETE CASCADE, meaning that when you delete a client record, it 
deletes its children in the invoices table. Also, you would give 
line_items a foreign key in the invoices table with ON DELETE CASCADE, 
so that deleting an invoice also causes its children in the line items 
table to be deleted. Is this right?

2. A class scheduling program, with a table of students, classes, and a 
'merge' table called registration. That way we can have a many-to-many 
relationship, where one student has many classes, and one class has many 
students. The registration table would have only two foreign keys, and 
an index making them unique.

Hm, I seem to only want to have parent rows delete their children. When 
would I use these other key restraint types?

Steve Lefevre
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: UDF Request "AGGLOM()"

2005-04-10 Thread Arjen Lentz
Hi Dan,

On Sat, 2005-04-09 at 02:59, Dan Bolser wrote:
> Who can I prod about setting up a UDF repo at MySQL. I think 'they' should
> do this ;)

Yep it's an existing idea, a very good one, and it's on the todo.
Putting such an infrastructure into place will take some time though.

Would a special forum for this purpose perhaps be a good intermediate
solution? Routines could be posted there, it's searchable...


Regards,
Arjen.
-- 
Arjen Lentz, Community Relations Manager
MySQL AB, www.mysql.com

MySQL Users Conference (Santa Clara CA, 18-21 April 2005)
Only 8 days until the event!  http://www.mysqluc.com/



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Getting Started with MySQL

2005-04-10 Thread Peter Smeaton
Help, please, for a beginner to mysql, but with a (long time ago) background 
in 'C'.

1. I can install and get running version 4.1.11-nt of mysql. I cannot ugrade 
this to version 5 - it simply will not install properly depite doing all the 
things it says in the documentation. I hope to use the feature of stored 
procedures, so this means I'm stuck.
2. I would also like to use the C API. However the version 4 is supposed to 
contain the C API, but all I can find is a .dll
Th .h files and a load of library files are in the version 5 (unzipped) but 
not in the version 4.

Please, can anyone offer some pointers, to get me going on this?
Peter Smeaton
Cheshire, UK
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Recreating primary index on MyIsam table

2005-04-10 Thread Nils Valentin
Hi Peter,

thanks a bunch,

I new that it must have been something simple like this. I am just no 
programmer. ;-)

Thanks a bunch !!

Best regards

Nils Valentin
Tokyo / Japan


On Sunday 10 April 2005 23:41, Peter Brawley wrote:
> Nils,
>
>  >So the task is to recreate the current primary key (c_serial),so that the
>  >current index would start with 1,2,3,4,
>
> SET @i=0;
> UPDATE c1 SET c_serial=(@i:[EMAIL PROTECTED]);
>
> PB
>
> -
>
> Nils Valentin wrote:
> >Hi MySQL fans ;-),
> >
> >I was just asked recently with the task to recreate a tables index
> >"gracefully" on a MyIsam table.
> >
> >This is the table layout:
> >
> >CREATE TABLE `cl` (
> >  `c_serial` int(11) NOT NULL auto_increment,
> >  `cname` tinytext NOT NULL,
> >  `cl_vals` text NOT NULL,
> >  `utime` int(11) NOT NULL default '0',
> >  PRIMARY KEY  (`c_serial`)
> >) TYPE=MyISAM
> >
> >
> >So the task is to recreate the current primary key (c_serial),so that the
> >current index would start with 1,2,3,4,
> >Currently the numbers are all over the place. To make this simple (for
> > now) there are no dependencies to other tables so the order of the index
> > doesnt really matter, its more for the admins  peace of mind ;-)
> >
> >I tried the obvious first, removing the column completely and adding the
> >primary key, which left me with a lot of "0"s - which is not what I had in
> >mind ;-).
> >
> >I know this shouldnt be too difficult, but perhaps I am just too long in
> > front of the screen. ;-)
> >
> >Best regards
> >
> >Nils Valentin
> >Tokyo / Japan
> >
> >www.be-known-online.com
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 4/7/2005

-- 
kind regards

Nils Valentin
Tokyo/Japan

http://www.be-known-online.com/mysql/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: retrieving a value from mysql and use it later

2005-04-10 Thread Michael Stassen
On Apr 10, 2005, at 11:30 AM, Eko Budiharto wrote:
Hi,
I would like to ask about how to retrieve a value from mysql and use 
it later. What I mean is like this
This is really a perl question, not mysql.  my is a scoping operator.  
Variables declared with my disappear when they go out of scope.

my $ref = $sth->fetchall_arrayref();
foreach my $row (@$ref) {
my ( $passengerIndex, $passengerName, $passengerEmailAddress, 
$passengerLoginPassword ) = @$row;
 my $new = $passengerIndex;
$new belongs to the foreach loop.
}
$new disappears here, as it has gone out of scope.
...
print $new;
but it does not work.
so far, when I want to use it, I always do this
my $ref = $sth->fetchall_arrayref();
foreach my $row (@$ref) {
my ( $passengerIndex, $passengerName, $passengerEmailAddress, 
$passengerLoginPassword ) = @$row;
 my $new = $passengerIndex;
...

print $new;
}
You have to create $new so it is in the desired scope.  You need 
something like

  my $new;
  my $ref = $sth->fetchall_arrayref();
  foreach my $row (@$ref) {
  my ( $passengerIndex, $passengerName, $passengerEmailAddress, 
$passengerLoginPassword ) = @$row;
  $new = $passengerIndex;
  }
  ...
  print $new;

Michael
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


retrieving a value from mysql and use it later

2005-04-10 Thread Eko Budiharto
Hi,
I would like to ask about how to retrieve a value from mysql and use it later. 
What I mean is like this
 
my $ref = $sth->fetchall_arrayref();
foreach my $row (@$ref) {
my ( $passengerIndex, $passengerName, $passengerEmailAddress, 
$passengerLoginPassword ) = @$row;
 my $new = $passengerIndex;
}
...
 
print $new;
 
but it does not work.
 
so far, when I want to use it, I always do this
 
my $ref = $sth->fetchall_arrayref();
foreach my $row (@$ref) {
my ( $passengerIndex, $passengerName, $passengerEmailAddress, 
$passengerLoginPassword ) = @$row;
 my $new = $passengerIndex;
...
 
print $new;

}



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Find valid numeric values in a string field?

2005-04-10 Thread Dan Bolser

I have a column like this "my_col varchar(20) null".

The values in the column can be text or numbers. How can I select only
those rows where the value in this column is a valid number?

I need something like IS_DECIMAL(), but I can't find that function.

The following SQL fails to do the job (probably because of
optimization)...

SELECT
  MIXED_COLUMN,
  MIXED_COLUMN + 0
FROM
  TABLE
WHERE
  MIXED_COLUMN =
  MIXED_COLUMN + 0
;

Hey, lets make an IS_DECIMAL UDF! ;)



p.s. why aren't the addresses of these mailing lists anywhere to be found
on the MySQL Lists pages?

Dan.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Recreating primary index on MyIsam table

2005-04-10 Thread Peter Brawley
Nils,
>So the task is to recreate the current primary key (c_serial),so that the
>current index would start with 1,2,3,4,
SET @i=0;
UPDATE c1 SET c_serial=(@i:[EMAIL PROTECTED]);
PB
-
Nils Valentin wrote:
Hi MySQL fans ;-),
I was just asked recently with the task to recreate a tables index 
"gracefully" on a MyIsam table.

This is the table layout:

CREATE TABLE `cl` (
 `c_serial` int(11) NOT NULL auto_increment,
 `cname` tinytext NOT NULL,
 `cl_vals` text NOT NULL,
 `utime` int(11) NOT NULL default '0',
 PRIMARY KEY  (`c_serial`)
) TYPE=MyISAM

So the task is to recreate the current primary key (c_serial),so that the 
current index would start with 1,2,3,4,
Currently the numbers are all over the place. To make this simple (for now) 
there are no dependencies to other tables so the order of the index doesnt 
really matter, its more for the admins  peace of mind ;-)

I tried the obvious first, removing the column completely and adding the 
primary key, which left me with a lot of "0"s - which is not what I had in 
mind ;-).

I know this shouldnt be too difficult, but perhaps I am just too long in front 
of the screen. ;-)

Best regards
Nils Valentin
Tokyo / Japan
www.be-known-online.com

 


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 4/7/2005
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Recreating primary index on MyIsam table

2005-04-10 Thread Nils Valentin
Hi MySQL fans ;-),

I was just asked recently with the task to recreate a tables index 
"gracefully" on a MyIsam table.

This is the table layout:

CREATE TABLE `cl` (
  `c_serial` int(11) NOT NULL auto_increment,
  `cname` tinytext NOT NULL,
  `cl_vals` text NOT NULL,
  `utime` int(11) NOT NULL default '0',
  PRIMARY KEY  (`c_serial`)
) TYPE=MyISAM


So the task is to recreate the current primary key (c_serial),so that the 
current index would start with 1,2,3,4,
Currently the numbers are all over the place. To make this simple (for now) 
there are no dependencies to other tables so the order of the index doesnt 
really matter, its more for the admins  peace of mind ;-)

I tried the obvious first, removing the column completely and adding the 
primary key, which left me with a lot of "0"s - which is not what I had in 
mind ;-).

I know this shouldnt be too difficult, but perhaps I am just too long in front 
of the screen. ;-)

Best regards

Nils Valentin
Tokyo / Japan

www.be-known-online.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]