Can't open table after myisamchk

2001-09-13 Thread Järkeborn Joacim

Hi,

I have a table:
CREATE TABLE WI_PICTUREFILES (
SECTIONID   VARCHAR(50) BINARY NOT NULL,
PICTUREID   VARCHAR(50) BINARY,
PICTUREFILE VARCHAR(200) BINARY NOT NULL,
PICFILEXT   VARCHAR(5) BINARY NOT NULL,
SHEETNO VARCHAR(2) BINARY,
UNIQUE PICTUREFILES_XPK (SECTIONID,SHEETNO),
INDEX PICTUREFILES_X1 (PICTUREFILE)
);

The table has 32314 records.
When I compress it with 'myisampack' it's fine but after running 'myisamchk -rq' the 
table can't be opened. 
When running 'myisamchk -rq' I get this message:
-
E:\standalone\database\dtim9t>myisamchk -rq 
E:\standalone\database\dtim9t\wi_picturefiles
- check key delete-chain
- check record delete-chain
- recovering (with sort) MyISAM-table 
'e:\standalone\database\dtim9t\wi_picturefiles.MYI'
Data records: 32314
- Fixing index 1
myisamchk: error: Found too many records; Can`t continue
MyISAM-table 'E:\standalone\database\dtim9t\wi_picturefiles' is not fixed because of 
errors
Try fixing it by using the --safe-recover (-o) or the --force (-f) option
-

Then I run 'myisamchk --safe-recover' and it works again.

Is this a bug in mySQL, or?!

Best regards

Joacim Järkeborn
Consultant - Systems Development 
Cell Network Sverige AB
__
Volvo IT
Dept 9224, ARH4
Gothenburg, Sweden

Telephone..: +46 31 765 49 65
Mobilephone: +46 708 78 58 01
E-mail.: [EMAIL PROTECTED]
__ 

-
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




Equivalent as UNION (Oracle)

2001-08-28 Thread Järkeborn Joacim

Hi,

We have Oracle SQL statements that uses UNION is there an equivalent for this in mySQL?

// Jocke

-
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




[Solved] RE: Search and compare

2001-08-27 Thread Järkeborn Joacim

Yes, I have got the tip from 'Carl Troein', thanks anyway

CASE value WHEN [compare-value] THEN result [WHEN [compare-value] THEN result ...] 
[ELSE result] END 

Best regards
Joacim 

> -Original Message-
> From: Harald Fuchs [mailto:[EMAIL PROTECTED]]
> Sent: den 27 augusti 2001 11:43
> To: [EMAIL PROTECTED]
> Subject: Re: Search and compare
> 
> 
> In article 
> <[EMAIL PROTECTED]>,
> Jarkeborn Joacim <[EMAIL PROTECTED]> writes:
> 
> > Hi,
> > Oracle has a fuction that compares value and then returns 
> another value.
> > DECODE( expr, search, result [, search, result] ... [, default] )
> 
> > E.g.
> 
> > DECODE (deptno, 10, 'ACCOUNTING', 
> > 20, 'RESEARCH', 
> > 30, 'SALES', 
> > 40, 'OPERATION', 
> > 'NONE')
> 
> > If 'deptno' is equal to 10 the string 'ACCOUNTING' is 
> returned, 20 => 'RESEARCH'etc. If no match 'NONE' will be 
> returned.
> 
> > Is there some similar function in mySQL?
> 
> Yes.  You can use CASE or IF() for that.
> 
> -
> 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 
>  .mysql.com>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 

-
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: Help about joins

2001-08-27 Thread Järkeborn Joacim

> -Original Message-
> From: Van [mailto:[EMAIL PROTECTED]]
> Sent: den 27 augusti 2001 11:01
> To: Jarkeborn Joacim
> Cc: [EMAIL PROTECTED]
> Subject: Re: Help about joins
> 
> 
> Jarkeborn Joacim wrote:
> > 
> > Hi,
> > I have a Oracle SQL string that contains '(+)' but when 
> running it in mySQL I get an error message saying that it's a 
> syntax error.
> > 
> > The definition in a Oracle helpfile is:
> > (+),Indicates that the preceding column   SELECT ename, dname
> > is the outer join column  FROM emp, dept
> > in a join.WHERE dept.deptno =
> > emp.deptno (+)
> > 
> > How can I do this in mySQL?
> > 
> > Here is my SQL statement:
> > 
> --
> -
> > SELECT f.fungroupno, f.infotypeid, f.qualifierid, f.vssno, 
> f.vsscompany,
> >   f.vssgroupno, i.fromid, i.toid, i.linktype, 
> s.sectionid section,
> >   LTRIM(CONCAT( t1.text, CONCAT( ' ', CONCAT( t2.text, 
> CONCAT( '',
> > CONCAT( t3.text, CONCAT( ' ', s.subheadtext)))
> >   infoelementtitle, NULL opcode, NULL optitle
> >FROM wi_sifilter f, wi_siinfoelement i, wi_textlist t1, 
> wi_textlist t2,
> >   wi_textlist t3, wi_pisection s , wi_fevss vs
> >WHERE f.infotypeid = 'PARTS' AND f.fungroupno LIKE '49%' AND
> >   f.qualifierid = 'PARTS-CATLG' AND f.infoelementid = 
> i.fromid AND
> >   s.sectionid = i.toid AND
> >   t1.language(+) = 'eng' AND t1.country(+) = 'US' AND
> >  t1.textid(+) = s.heading1 AND
> >   t2.language(+) = 'eng' AND t2.country(+) = 'US' AND
> >  t2.textid(+) = s.heading2 AND
> >   t3.language(+) = 'eng' AND t3.country(+) = 'US' AND
> >  t3.textid(+) = s.heading3 AND
> >   i.linktype = 'partinforef' AND
> >   vs.vssno = f.vssno AND (vs.model = 'F10' OR vs.model IS NULL)
> >ORDER BY 6 ASC, 5 ASC, 4 ASC
> > 
> --
> -
> > 
> > Best regards
> > Joacim
> 
> Joacim:
> 
> I don't think the (+) is standard ANSI SQL and is probably 
> not necessary for
> your Oracle query.  The (+) is unnecessary.  Lose it and the 
> query will likely
> work in both Oracle and MySQL.

Unfortunately, we have a lots of SQL statements that are non standard ANSI SQL and 
more Oracle specific.
I can't remove (+) since it doesn't work either in Oracle or mySQL. It seems that I 
have to rewrite lots of SQLs ;-(


> I'm curious why you're not explicitely specifying your OUTER 
> JOIN before the
> WHERE clause which would make it a more efficient query.

I'm not that good at SQL but I will take the issue to the SQL developer.

> CONCAT() is definitely not supported in MSSQL as of 7.0, and 
> will cause you
> problems there, but that's another issue.  I'm assuming 
> you're shooting for a
> cross-sql capable application.  A thought to consider.

Yes, if the SQL statements where ANSI SQL it wouldn't be any problem to use mySQL 
instead of Oracle.
We have lots of code that are developed for Oracle and it seems that they haven't 
developed database independant SQL's. It's very stupid done.

Regards
Joacim

-
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




Case sensitive

2001-08-15 Thread Järkeborn Joacim

Hi,

I have the table:

CREATE TABLE WI_TEXTLISTUS (
TEXTID  VARCHAR(50) NOT NULL,
COUNTRY VARCHAR(2) NOT NULL,
LANGUAGEVARCHAR(3) NOT NULL,
TEXTVARCHAR(250),
PRIMARY KEY (TEXTID,COUNTRY,LANGUAGE),
INDEX TEXTLISTUS_X1 (TEXT)
);

and when I inserts data such as

INSERT INTO WI_TEXTLISTUS VALUES ('IUSB-2348a-n00021','US','eng','FUEL TANK SUPPORTS, 
LH');
INSERT INTO WI_TEXTLISTUS VALUES ('IUSB-2348A-N00021','US','eng','FUEL TANK SUPPORTS, 
LH');

I get an error:

ERROR 1062: Duplicate entry 'IUSB-2348A-N00021-US-eng' for key 1

Is it possible to set mySQL to be case sensitive since it's a small difference between 
the two?



Best regards

Joacim Järkeborn
Sweden

-
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: Placing database on a novell disk

2001-07-13 Thread Järkeborn Joacim

Hi,

After installation in 'C:\mysql' I moved the 'C:\mysql\data' directory to 
'C:\mysql-data'. That means that all databases where moved (mysql, test and my own). 
The same was to the Novell drive.

I need to do this since I'm going to insert approx. 3.4 GB of data and I have not that 
much space left on my local drives.

BR
Joacim

> -Original Message-
> From: Miguel Angel Solórzano [mailto:[EMAIL PROTECTED]]
> Sent: den 12 juli 2001 18:54
> To: Järkeborn Joacim; mySql Mailing List
> Subject: Re: Placing database on a novell disk
> 
> 
> At 15:01 12/07/2001 +0200, Järkeborn Joacim wrote:
> Hi,
> 
> Did you had moved the mysql database (together with the grant tables)
> for the new location ?
> I can't to test Novell mapped drive on Win32, however I didn't find
> problems with mapped drives on Win32:
> 
> E:\mysql\bin>mysql
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 9 to server version: 3.23.39-max
> 
> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
> 
> mysql> show variables like "datadir";
> +---+--+
> | Variable_name | Value|
> +---+--+
> | datadir   | h:\data\ |
> +---+--+
> 1 row in set (0.00 sec)
> 
> mysql>
> 
> Regards,
> Miguel
> >Hi there,
> >
> >I have installed the Win32 mySQL binaries on 'C:\mysql' and 
> databases on 
> >'C:\mysql-data'. I have also an configuration file 
> 'C:\my.cnf' containing 
> >(and other things):
> >
> >basedir = c:/mysql/
> >datadir = c:/mysql-data/
> >
> >- Now I want to move the databases to a mapped novell disc 'K:\' and 
> >changes the 'C:\my.cnf' according to the new path. When 
> trying to start 
> >the NT service I gets an error
> >
> >C:\mysql>NET START mysql
> >The MySql service is starting.
> >The MySql service could not be started.
> >A system error has occurred.
> >System error 1067 has occurred.
> >The process terminated unexpectedly.
> >
> >
> >What dependicies have mySQL?
> >- Can I move the installed 'C:\mysql' dir, databases and 
> 'C:\my.cnf' to 
> >another machine and get it to work?
> >- Has it keys in the registry and/or files in some windows 
> system directory?
> >
> >BR
> >Joacim
> >
> >-
> >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

-- 
For technical support contracts, goto https://order.mysql.com/
__  ___ ___   __
   /  |/  /_ __/ __/ __ \/ /Miguel A. Solórzano <[EMAIL PROTECTED]>
  / /|_/ / // /\ \/ /_/ / /__   MySQL AB, FullTime Developer
/_/  /_/\_, /___/\___\_\___/   Mogi das Cruzes - São Paulo, Brazil
<___/   www.mysql.com

-
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




Execute multiple scripts

2001-07-12 Thread Järkeborn Joacim

Hi,

I have approx. 110 SQL scripts in a directory. Each containing DROP TABLE, CREATE 
TABLE, lots of INSERT INTO and finally a COMMIT.
I need to run all these script in mysql console.

My plan is to write a perl script that looks into the directory and fetch all *.sql 
scripts and then execute them in mysql console. But I can't running the mysql console 
with a script as parameter. I have tried the following commands:

mysql --user=USER --password=PASSWORD DATABASE \. C:/Files/data/WI_UPUSER.sql
mysql --execute=C:/Files/data/WI_UPUSER.sql --user=USER --password=PASSWORD DATABASE

None of them works!

How can I do this?

BR
Joacim

-
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




Placing database on a novell disk

2001-07-12 Thread Järkeborn Joacim

Hi there,

I have installed the Win32 mySQL binaries on 'C:\mysql' and databases on 
'C:\mysql-data'. I have also an configuration file 'C:\my.cnf' containing (and other 
things):

basedir = c:/mysql/
datadir = c:/mysql-data/

- Now I want to move the databases to a mapped novell disc 'K:\' and changes the 
'C:\my.cnf' according to the new path. When trying to start the NT service I gets an 
error

C:\mysql>NET START mysql
The MySql service is starting.
The MySql service could not be started.
A system error has occurred.
System error 1067 has occurred.
The process terminated unexpectedly.


What dependicies have mySQL? 
- Can I move the installed 'C:\mysql' dir, databases and 'C:\my.cnf' to another 
machine and get it to work? 
- Has it keys in the registry and/or files in some windows system directory?

BR
Joacim

-
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




Field name LEFT and RIGHT

2001-07-09 Thread Järkeborn Joacim

Hi,

I need to create a table that have field names 'LEFT' and 'RIGHT'. I have tried the 
following but it doesn't work:

CREATE TABLE WI_POSITION (
PICTUREFILE   VARCHAR(200) NOT NULL,
PICFILEXT VARCHAR(5),
POSITIONNOVARCHAR(10) NOT NULL,
SEQUENCENOVARCHAR(3),
LEFT  NUMERIC(4,0) NOT NULL,
TOP   NUMERIC(4,0) NOT NULL,
RIGHT NUMERIC(4,0) NOT NULL,
BOTTOMNUMERIC(4,0) NOT NULL,
UNIQUE POSITION_XPK (PICTUREFILE,POSITIONNO,SEQUENCENO)
);

and

CREATE TABLE WI_POSITION (
"PICTUREFILE"   VARCHAR(200) NOT NULL,
"PICFILEXT" VARCHAR(5),
"POSITIONNO"VARCHAR(10) NOT NULL,
"SEQUENCENO"VARCHAR(3),
"LEFT"  NUMERIC(4,0) NOT NULL,
"TOP"   NUMERIC(4,0) NOT NULL,
"RIGHT" NUMERIC(4,0) NOT NULL,
"BOTTOM"NUMERIC(4,0) NOT NULL,
UNIQUE POSITION_XPK (PICTUREFILE,POSITIONNO,SEQUENCENO)
);

But nothing works. How should I do?

Best regards

Joacim Järkeborn

-
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