Re: sequences and auto_increment

2007-01-02 Thread Ken Brown

I had a similar problem a while ago and I got round it by using a trigger -

called a function on an insert to
read a value from a table (use for update when selecting)
update with incremented value
then use the return value from the ffunction to set the new value - 
you can do all your login or your primary key in it.


Not at a machine where I have the code handy and not sure if mysql has 
implemented an autonomous pragma for this kind of thing yet but select 
for update should deal with things as long as you keep the function tight


Ken

Luca Ferrari wrote:
On Tuesday 02 January 2007 16:51 Brent Baisley's cat, walking on the keyboard, 
wrote:


  

CREATE TABLE competenza (
competenza varchar(30) NOT NULL default 'comp-06-',
id_competenza int unsigned not null auto_increment,
descrizione varchar(100),
PRIMARY KEY (competenza, id_competenza)
)

Since your PRIMARY KEY is a combination of 2 fields (competenza +
id_competenza ), each competenza value will have it's own auto increment
(id_competenza ) sequence. So id_competenza  won't be unique, but the
combination of competenza + id_competenza will be.





Thanks for your suggestion, but this would make my queries more complex, since 
to get the id of a skill (italian is competenza) will require querying two 
fields.
It's true that I can simulate sequences with a table with auto_increment, but 
this means I need to insert a record before in such table to get the new id 
and then insert in my competenza table. This would require a transaction and 
will result even more complex than the above, I guess.


Any other idea?
Thanks,
Luca

  




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



Newbie: Rewriting A Query- How?

2004-03-09 Thread Ken Brown
Anyone any idea how I could rewrite this as a join - all the indexes are in
place and each of the components of this work fine - its only when the
combined subqueries are passed to the root query does it appear to go wrong
(Takes around 1.5 mins to complete and causes 100% processor utilisation
while executing).  (May be something for the developers to look at).
 
But in the meantime I need to get this going 
 
SELECT PROJID,PROJECTNAME
FROM  S_PROJECTREGISTER
WHERE  SNAPSHOTID = 56
AND   PROJID IN ( SELECT PROJID
  FROM  SL_PROGPROJ
  WHERE  SNAPSHOTID = 56
  AND   PROGID IN ( SELECT PROGID
FROM  SL_PORTPROG
WHERE  SNAPSHOTID = 56
 AND PORTID IN(100994,100996) ) )
AND PROJECTSTATUS  'Potential'
 
Ken

 mailto:[EMAIL PROTECTED]  


RE: MySql and Oracle Forms 6i

2004-02-03 Thread Ken Brown
Yip I kinda figured that and tend to code that way anyhow
But
There is OCA which does work with a number of other database it's just there
isn't a ready built MySql setup.
I'll try converting one of the others to run
Thanks anyhow

Ken

-Original Message-
From: David Griffiths [mailto:[EMAIL PROTECTED] 
Sent: 02 February 2004 23:42
To: Ken Brown; [EMAIL PROTECTED]
Subject: Re: MySql and Oracle Forms 6i

Someone posted an answer:

Oh wow... I can't think of how you'd get that to work without a ton of
custom. For starters, you'll have to write your own transactional triggers
and intercept every one of Oracle's select, lock, update, insert, delete,
like On-Lock, On-Insert, etc. since Forms will want things like rowids.
You'll also have to write your own on-Login.

Mike

Oracle and MySQL differ in date handling, functions, triggers/stored
prodedures (or lack of), outer-join syntax, and a hundred other ways that
would make Forms incompatible with MySQL. Not to mention the fact that Forms
probably uses SQL*Net and a TNSNames.ora entry.

David.


- Original Message -
From: Ken Brown [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 02, 2004 3:11 PM
Subject: MySql and Oracle Forms 6i


 Is there any way of using MySql as a back end to Oracle Forms?





 Ken Desperately trying to justify not going back to oracle db Brown



Mail was checked for spam by the Freeware Edition of No Spam Today!
The Freeware Edition is free for personal and non-commercial use.
You can remove this notice by purchasing a full license! To order
or to find out more please visit: http://www.no-spam-today.com

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



MySql and Oracle Forms 6i

2004-02-02 Thread Ken Brown
Is there any way of using MySql as a back end to Oracle Forms?

 

 

Ken Desperately trying to justify not going back to oracle db Brown



Passwords and ODBC - what am I missing

2004-01-31 Thread Ken Brown
Just installed 4.1.1 on windows 2000 with current odbc layer

Connects fine with root and no password

But if I set a password on root or create a user with a password odbc fails
with

 

Client does not support authentication protocol requested by the server -
consider upgrading MYSql Client

 

So what have I done wrong?

 

Ken

 

 



RE: Passwords and ODBC - what am I missing

2004-01-31 Thread Ken Brown
I've did some more checking - I cannot set passwords anywhere (that is if I
want to connect with the account)

There are no logs as to why its not working.

I can only presume 4.1.1 is in the middle of a security overhaul and that's
why its now working here but perhaps someone could advise otherwise - or at
the very least how to switch on a security log

Ken

-Original Message-
From: Ken Brown [mailto:[EMAIL PROTECTED] 
Sent: 31 January 2004 15:56
To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: Passwords and ODBC - what am I missing

Just installed 4.1.1 on windows 2000 with current odbc layer

Connects fine with root and no password

But if I set a password on root or create a user with a password odbc fails
with

 

Client does not support authentication protocol requested by the server -
consider upgrading MYSql Client

 

So what have I done wrong?

 

Ken

 

 


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



How do I - upgrade client libraries to 4.1.1 on Windows?

2004-01-31 Thread Ken Brown
I need to do this to get round password issues as -old-passwords doesn't
work

Anyone any ideas?

 

Kwn



Oracle Question

2004-01-31 Thread Ken Brown
Anyone managed to get oracle forms 6i to talk to MySQL - if so how?

 

I've got ODBC working but it will not connect and the ODBC trace is less
than useful

 

Ken



RE: Passwords and ODBC - what am I missing

2004-01-31 Thread Ken Brown
Got it thanks - set-variable=old-passwords=1 in the ini file

-Original Message-
From: Randy Chrismon [mailto:[EMAIL PROTECTED] 
Sent: 31 January 2004 21:11
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: Re: Passwords and ODBC - what am I missing

Oh, and one other thing, you have to create the passwords AFTER you use 
the switch! That was probably obvious to you but it took me a while to 
figure out.

Randy

Randy Chrismon wrote:

 Ken Brown wrote:

 Just installed 4.1.1 on windows 2000 with current odbc layer

 Connects fine with root and no password

 But if I set a password on root or create a user with a password odbc 
 fails
 with



 Client does not support authentication protocol requested by the 
 server -
 consider upgrading MYSql Client



 So what have I done wrong?



 Ken


  

 Ken:

 You will have to look up the exact switch in the MySQL manual but the 
 problem is that the OBDC driver is sending the old style password 
 hash to MySQL 4.1.1 which is expecting the new -- longer -- password 
 hash. You can easily find the switch by searching the MySQL 
 documentation at their site.

 Randy



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


Mail was checked for spam by the Freeware Edition of No Spam Today!
The Freeware Edition is free for personal and non-commercial use.
You can remove this notice by purchasing a full license! To order
or to find out more please visit: http://www.no-spam-today.com

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



Newbie - from Oracle

2004-01-14 Thread Ken Brown
Oracle has Dual does MySql have something similar?

 

In Oracle I use SYSDATE and USER a lot as default column values when
creating a table. Can you do something similar in MySql and how?

 

Does MySql support sequences? How?

 

Relationships - can the code be interfered with or do I have to wait for
triggers?

 

Thanks

 

Ken