dotConnect for MySQL Documentation
Devart.Data.MySql Namespace / MySqlScript Class / Delimiter Property
Example

In This Topic
    Delimiter Property
    In This Topic
    Gets or sets the command delimiter that is used in the script by default, i.e., before the DELIMITER statement is explicitly called.
    Syntax
    'Declaration
     
    Public Property Delimiter As String
    public string Delimiter {get; set;}

    Property Value

    The command delimiter that is used in the script by default.
    Remarks
    This functionality is mainly needed for compatibility with the code initially written for MySQL Connector/NET, where the DELIMITER statement cannot be used in the script text.
    Example
    In the following sample, the script creates a stored procedure and then inserts a row into the Dept table. The delimiter is set to '&&' via the Delimiter property for creating the procedure, and then changed back to default semicolon via the DELIMITER statement.
    MySqlScript script = new MySqlScript();
    script.Connection = mySqlConnection1;
    script.Delimiter = "&&";
    
    script.ScriptText = @"
            CREATE PROCEDURE procedure1 (OUT c INT) 
              BEGIN 
                select count(*) from Dept into c; 
              END&&
            DELIMITER ;
            INSERT INTO Dept VALUES (100, 'New dept', 'New York');
            ";      
          
    script.Execute();
    Dim script As New MySqlScript()
    script.Connection = mySqlConnection1
    script.Delimiter = "&&"
    script.ScriptText = _
            "CREATE PROCEDURE procedure1 (OUT c INT) " & vbCrLf & _
            "  BEGIN" & vbCrLf & _
            "    select count(*) from Dept into c;" & vbCrLf & _
            "  END&& & _" & vbCrLf & _
            "DELIMITER ; & _" & vbCrLf & _
            "INSERT INTO Dept VALUES (100, 'New dept', 'New York'); "
    script.Execute()
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also