• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

changing from MSSQL to MySQL

 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im switching from MSSQL to MySQL. This is my first time using MySQL. I have to create tables.. stored procedures. However everything I try to copy from MSSQl come up with errors. Can someone point out what is wrong with this stored procedure? What are some of the differences between the two databases that I should keep in mind

CREATE PROCEDURE dbo.ObtainPhotoInfo @photoID varchar(255)
AS
SELECT [ID] , itemDescription, unitprice
FROM itemlist
WHERE [ID] LIKE @photoID
GO
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I see is the dbo user, he is MSSQL specific and will not work on MySQL.
 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried removing that but i still received errors.

I attempted the following

CREATE PROCEDURE ObtainPhotoInfo (@photoID varchar(255))
AS
SELECT [ID] , itemDescription, unitprice
FROM itemlist
WHERE [ID] LIKE @photoID
GO
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to remove GO
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the error message?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Procedures are defined differently in MySQL - for example you'll have to define an IN and OUT parameter for this procedure. Check the docs - theres a definition of the syntax plus an example in there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic