မင်္ဂလာပါ!

လှိုက်လှဲစွာကြိုဆိုပါသည်။ ယခု ပထမဆုံးအကြိမ် ရောက်ဖူးခြင်းဖြစ်ပါသလား? ဝင်ရောက် ဆွေးနွေး မေးမြန်းလိုပါလျှင် အောက်တွင်ဖော်ပြထားသော button များမှတဆင့် ဝင်ရောက် ဆွေးနွေးနိုင်သကဲ့သို့ အဖွဲ့ဝင်အသစ်အနေဖြင့်လည်း လျှောက်ထားနိုင်ပါတယ်။

MYSTERY ZILLION တွင် English သို့မဟုတ် Unicode ဖြင့်သာ အသုံးပြုခွင့်ရှိသည်။ ဇော်ဂျီ ၊ ဧရာ စသည်တို့ကို အသုံးပြုခွင့် မရှိ။ Unicode fonts များမှာ Mon3,Yunghkio, Myanamr3 စသည်များ အသုံးပြုနိုင်သည်။ Unicode Guide ကို ဒီမှာ Download ချပါ။ Zawgyi to Unicode Converter
Don't share ebook or software if nobody request. You can find free book websites on here. We are welcome for discussion or asking question instead.

migrate T-SQL Storeproducure to MYSql StoreProducure

edited May 2015 in Database

I Have trouble in migration form T-SQL Store to Mysql store.I am not familar in using Mysql Datatbase.So I used this site to migrate
database.:D
http://www.sqlines.com/online.

USE [HIPS]
GO
/****** Object:  StoredProcedure [dbo].[spMainData]    Script Date: 05/13/2015 15:17:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[spMainData]
(
    @P_ActionID         tinyint                 = 0,
    @P_BankInitial          NVarChar(10)        = '' Output,
    @P_BankName         NVarChar(50)        = '' Output,
    @P_BranchID         Int         = 0,
    @P_DivisionCode     NVarChar(20)        = '',
    @P_DivisionName     NVarChar(50)        = '',
    @P_DivisionHeadName     NVarChar(50)        = '',
    @P_DivisionHeadRankID   Int         = 0,
    @P_DivisionOpenDate     DateTime        = '1900-01-01',
    @P_BackgroundImage      Image           = null,
    @P_ReportLogo       Image           = null,
    @P_BackUpName       NVarChar(50)        = ''
)
 AS
BEGIN
    SET NOCOUNT ON; 
    
    -- ###  Create a new record  ###
    IF @P_ActionID = 1
        BEGIN
                        DECLARE @P_Count INT
            SET @P_Count = (SELECT Count(*) FROM dbo.tblMainData)

            IF(@P_Count = 0)
            BEGIN
                -- Add a new record             
                SET NOCOUNT OFF
                INSERT INTO dbo.tblMainData
                (   BankInitial, BankName, BranchID, DivisionCode
                    , DivisionName, DivisionHeadName, DivisionHeadRankID, DivisionOpenDate
                    , BackgroundImage, ReportLogo, BackUpName) 
                VALUES
                (   @P_BankInitial, @P_BankName, @P_BranchID, @P_DivisionCode
                    , @P_DivisionName, @P_DivisionHeadName, @P_DivisionHeadRankID, @P_DivisionOpenDate
                    , @P_BackgroundImage, @P_ReportLogo, @P_BackUpName)
                
            END
            ELSE
            BEGIN
                -- Update the record
                SET NOCOUNT OFF 
                UPDATE dbo.tblMainData 
                SET BankInitial     =   @P_BankInitial,
                    BankName        =   @P_BankName,
                    BranchID        =   @P_BranchID,
                    DivisionCode        =   @P_DivisionCode,
                    DivisionName        =   @P_DivisionName,
                    DivisionHeadName    =   @P_DivisionHeadName,
                    DivisionHeadRankID  =   @P_DivisionHeadRankID,
                    DivisionOpenDate    =   @P_DivisionOpenDate,
                    BackgroundImage =   @P_BackgroundImage,
                    ReportLogo      =   @P_ReportLogo,
                    BackUpName      =   @P_BackUpName   
            END 
        END
        END 

........................
The following result outcome.

/* SQLINES EVALUATION VERSION TRUNCATES VARIABLE NAMES AND COMMENTS. */
/* OBTAIN A LICENSE AT WWW.SQLINES.COM FOR FULL CONVERSION. THANK YOU. */

USE `HIPS`;
 
/****** Objec... *** SQLINES FOR EVALUATION USE ONLY *** cript Date: 05/13/2015 15:17:18 ******/
/* SET ANSI_NULLS ON */
 
/* SET QUOTED_IDENTIFIER ON */
 
DELIMITER //

CREATE PROCEDURE spMainData
(
    p_P_ActionID            tinyint unsigned                /* = 0 */,
    p_P_BankInitial         NVarChar(10)        /* = '' */,
    p_P_BankName            NVarChar(50)        /* = '' */,
    p_P_BranchID            Int         /* = 0 */,
    p_P_DivisionCode        NVarChar(20)        /* = '' */,
    p_P_DivisionName        NVarChar(50)        /* = '' */,
    p_P_DivisionHeadName        NVarChar(50)        /* = '' */,
    p_P_DivisionHeadRankID  Int         /* = 0 */,
    p_P_DivisionOpenDate        DateTime(3)     /* = '1900-01-01' */,
    p_P_BackgroundImage     Longblob            /* = null */,
    p_P_ReportLogo      Longblob            /* = null */,
    p_P_BackUpName      NVarChar(50)        /* = '' */
)
BEGIN
    
    -- ###  Create ... *** SQLINES FOR EVALUATION USE ONLY *** 
    IF p_P_ActionID = 1
        THEN
                        DECLARE v_P_C_ INT;
            SET v_P_C_ = (SELECT Count(*) FROM tblMainData;);

            IF(v_P_C_ = 0)
            THEN
                -- Add a new re... *** SQLINES FOR EVALUATION USE ONLY *** 
                INSERT INTO tblMainData
                (   BankInitial, BankName, BranchID, DivisionCode
                    , DivisionName, DivisionHeadName, DivisionHeadRankID, DivisionOpenDate
                    , BackgroundImage, ReportLogo, BackUpName) 
                VALUES
                (   p_P_BankInitial, p_P_BankName, p_P_BranchID, p_P_DivisionCode
                    , p_P_DivisionName, p_P_DivisionHeadName, p_P_DivisionHeadRankID, p_P_DivisionOpenDate
                    , p_P_BackgroundImage, p_P_ReportLogo, p_P_BackUpName)
                
            ELSE
                -- Update the r... *** SQLINES FOR EVALUATION USE ONLY *** 
                UPDATE tblMainData 
                SET BankInitial     =   p_P_BankInitial,
                    BankName        =   p_P_BankName,
                    BranchID        =   p_P_BranchID,
                    DivisionCode        =   p_P_DivisionCode,
                    DivisionName        =   p_P_DivisionName,
                    DivisionHeadName    =   p_P_DivisionHeadName,
                    DivisionHeadRankID  =   p_P_DivisionHeadRankID,
                    DivisionOpenDate    =   p_P_DivisionOpenDate,
                    BackgroundImage =   p_P_BackgroundImage,
                    ReportLogo      =   p_P_ReportLogo,
                    BackUpName      =   p_P_BackUpName  
            END IF; 
        END IF;
        END;
//

DELIMITER ;

......
When I run these code on Mysql.
The face the following error

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DECLARE P_Count INT DEFAULT 0;
SET P_Count = SELECT Count(*) FROM tblMainDa' at line 21;

:-S :-S :-S :-S :-S :-S :-S :-S :-S :-S :-S :-S :-S :-S :-S :-S

Sign In or Register to comment.