Dear Everyone,

I want to implement stored procedures in MySQL but don't know how. Below is
the algorithm that I want to make into a stored procedure. Can anyone help
me with this? Thanks.

sp_add_update { // NAME OF STORED PROC
        d1Value
        d2Value
        d3Value

        if exists (SELECT * FROM t_Data WHERE data1 = d1Value AND data2 = 
d2Value
AND data3 = d3Value)
                UPDATE
        else
                INSERT
        end if
}

*****************************************************

sp_add_update {
        IDValue
        d1Value
        d2Value

        if IDValue = 0
                INSERT
        else
                UPDATE
}

_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to