Skip to main content

Posts

MySQL Stored Procedure Error

In our project we had many many stored procedures and many parameters passes to those sps. But in only one sp it gives error message something like this; "Incorrect number of arguments for PROCEDURE sproc_t_l_Contract_Select_BySearchCriteria; expected 3, got 2” Work long time on this sp but coudnt find it. So i tried to write it again from the begining. In this time it was work perfectly.This problem occurs because of the space between data type and its length. Ex. pName varchar(50) - working pName varchar (50) - Not working But it does not mention syntax error or something.So this error message make us vulnerable.

MSSQL to MySQL Part II

We could able to finish our MSSQL to MySQL conversion project successful. During this project we had to used many client tools because each tool having pros and cons. we used following client tools; mysql-gui-tools-5.0 HeidiSQL SQLyog Toad for MySQL Nevicat 8.0 Lite Among those tools SQLyog Community edition the best tool even though Toad for MySQL provides many features.Toad for MySQL sometimes gives errors when running a query.Nevicat 8.0 Lite is simple and good.But it has not much features. HeidiSQL is also good but it doesn't show other database objects such as stored procedures,view. Only tables are displayed.

MSSQL to MySQL

To day i was struggling to catch a error inside a stored procedure using MySQL. Faced lot of difficulties and still not found good result. There is no equal function in MySql to RAISERROR in MSSQL. As a solution for this what we can we do is, we can call a function as this way CALL RaiseError(); There for because of the none existence of this function this will be raise an error. So it is very logical..:-) So procedure will be work very fine.....Great... Example: DROP PROCEDURE IF EXISTS `dbname`.`procedureName` $$ CREATE DEFINER=`root`@`%` PROCEDURE `edbname`.`procedureName`( pId bigint, pName varchar(50) BEGIN IF EXISTS (SELECT 1 FROM tableName WHERE ((Id = pId) ) THEN UPDATE tableName SET Name = pName, WHERE (Id = pId); ELSE CALL RaiseError(); /*There is no RaiseError metho in MySql. Because of that reason here call nonexistent method which is 'Rais...

Orgnized well

When buying things like clothes, set a rule for yourself that you can only buy something new, to replace something you already have. For example, from a practical point of view, let’s say you need to have 15 business shirts. Set a ‘budget’ of having 15 shirts, and then when you want to buy one, first throw away (or give to charity) the worst of the other. Can’t make a choice which one to throw out? Guess what: you won’t need a new shirt. [ http://www.iwillteachyoutoberich.com/blog/tip-9-only-buy-new-things-when-replacing-something-old ]

Codesmith problem

In my mechine i have installed Codesmith and when trying to connect to Mysql DB it is not allowed to access it. Basically it doesnt enable the connection establishing window. Even if you mannually typethe connection string and click on 'Test' button it will say Mysql.data.dll not exist. This is because of compatibility issue... To sortout this.....:-) So i had t installed earlier version. It also did not work. So copy 'MySql.Data.dll' to bin folder of codesmith (C:\Program Files\CodeSmith\v5.0\bin). Mannaully type the connction string and test. Then it will works fine................................