Unix Technical Forum

converting mysql 4 statements to mysql 5

This is a discussion on converting mysql 4 statements to mysql 5 within the MySQL forums, part of the Database Server Software category; --> Hi, I have few mysql4 statements that I would like to convert to mysql 5 format. As you can ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:28 AM
secSwami
 
Posts: n/a
Default converting mysql 4 statements to mysql 5

Hi,

I have few mysql4 statements that I would like to convert to mysql 5
format. As you can tell, I am not a programmer. Any help will be
highly appreciated.

Thanks

CREATE TABLE resume (
id INT UNSIGNED AUTO_INCREMENT,
ip_addr INT UNSIGNED NOT NULL,
counter INT UNSIGNED NOT NULL,
last_update DATETIME NOT NULL,default 'now()',

PRIMARY KEY ( id ),

);

Whenever I execute it, I get syntax error with the defaul 'now()' ,
after doing some research I found that this now() function has been
replaced.

Help!!!!

Thanks in advance!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:28 AM
Captain Paralytic
 
Posts: n/a
Default Re: converting mysql 4 statements to mysql 5

On 27 Sep, 08:54, secSwami <parvind...@gmail.com> wrote:
| I have few mysql4 statements that I would like
| to convert to mysql 5 format.
This statement fails in version 4 as well. Have you thought of reading
the relevant section of the manual and following the instructions? I
don't think the format of this statement has changed between the
versions.

| after doing some research I found that this now()
| function has been replaced.
It has? What research did you do? No one told me that it had been
replaced and it appears that no one told the developers either since I
am still using it in version 5 and so are lots of other people.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 11:28 AM
Kees Nuyt
 
Posts: n/a
Default Re: converting mysql 4 statements to mysql 5

On Thu, 27 Sep 2007 00:54:28 -0700, secSwami
<parvinderb@gmail.com> wrote:

>Hi,
>
>I have few mysql4 statements that I would like to convert to mysql 5
>format. As you can tell, I am not a programmer. Any help will be
>highly appreciated.
>
>Thanks
>
>CREATE TABLE resume (
> id INT UNSIGNED AUTO_INCREMENT,
> ip_addr INT UNSIGNED NOT NULL,
> counter INT UNSIGNED NOT NULL,
> last_update DATETIME NOT NULL,default 'now()',
>
> PRIMARY KEY ( id ),
>
>);
>
>Whenever I execute it, I get syntax error with the defaul 'now()' ,
>after doing some research I found that this now() function has been
>replaced.


1: One comma too many
2: qouted 'now()' is a string, not a function call.

In other words, instead of:
NOT NULL,default 'now()',
try:
NOT NULL default now(),

>Help!!!!
>
>Thanks in advance!


Regards,
--
( Kees
)
c[_] The reasonable man adapts himself to the world; the
unreasonable one persists in trying to adapt the world
to himself. Therefore all progress depends on the
unreasonable man. (George Bernard Shaw) (#467)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:55 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com