private void btnGo_Click(object sender, EventArgs e)
        {
            String SQL       = txtIn.Text.ToUpper();
            string tableName = txtTableName.Text.ToUpper();

            //Check the user has entered the correct table name
            if (SQL.Contains(tableName) == false)
            {
                DialogResult dlgRes = MessageBox.Show("Did you enter the correct Table Name: " + txtTableName.Text + " ?" + Environment.NewLine + "It doesn't exist in the Tabnle Definition script you pasted in!", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                //Exit if user needs to correct the table name
                if (dlgRes == DialogResult.No)
                {
                    return;
                }
            }

            //insert drop table
            SQL = PervasiveToOracle.DropObject(enums.ObjectType.table, tableName) + SQL;

            //convert datatypes
            SQL = PervasiveToOracle.ConvertDataTypes(SQL);

            //remove parameter quotes
            SQL = TableOps.RemoveQuotesAroundParameters(SQL);

            //Make a script to migrate the data in the table
            txtPopulateScript.Text = PervasiveToOracle.MigrateDataScript(SQL, tableName);
        }
Exemple #2
0
 /// <summary>
 /// Removes lines.
 /// </summary>
 /// <param name="sprocSqlLines">The sproc SQL lines.</param>
 /// <param name="wordThatLineStartContains">The word that line start contains.</param>
 /// <param name="wordThatLineEndContains">The word that line end contains.</param>
 /// <returns></returns>
 public static string[] RemoveLines(string[] sprocSqlLines, string wordThatLineStartContains, string wordThatLineEndContains)
 {
     for (int i = 0; i < sprocSqlLines.Length; i++)
     {
         if (sprocSqlLines[i].ToUpper().Contains(wordThatLineStartContains))
         {
             while (!sprocSqlLines[i].Contains(wordThatLineEndContains))
             {
                 sprocSqlLines[i] = string.Empty;
                 i++;
             }
             sprocSqlLines[i] = string.Empty;
             break;
         }
     }
     //Remove emplty lines
     return(PervasiveToOracle.SplitMultiLines(string.Join(Environment.NewLine, sprocSqlLines)));
 }
Exemple #3
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            String SQL       = txtIn.Text.ToUpper();
            string tableName = txtTableName.Text.ToUpper();

            //Check the user has entered the correct table name
            if (SQL.Contains(tableName) == false)
            {
                DialogResult dlgRes = MessageBox.Show("Did you enter the correct Table Name: " + txtTableName.Text + " ?" + Environment.NewLine + "It doesn't exist in the Tabnle Definition script you pasted in!", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                //Exit if user needs to correct the table name
                if (dlgRes == DialogResult.No)
                {
                    return;
                }
            }


            //insert drop table
            SQL = PervasiveToOracle.DropObject(enums.ObjectType.table, tableName) + SQL;

            //convert datatypes
            SQL = PervasiveToOracle.ConvertDataTypes(SQL);

            //remove parameter quotes
            SQL = TableOps.RemoveQuotesAroundParameters(SQL);

            SQL = SQL + TableOps.GetTableSpaceDefinition();

            //remove primary keys
            SQL = TableOps.RemovePrimaryKeys(SQL, tableName);

            //Grant CRUD Access
            if (chkGrantAccess.Checked)
            {
                SQL = PervasiveToOracle.GrantCRUDAccess(SQL, tableName);
            }

            txtOut.Text = SQL;

            txtOut.SelectAll();
        }
 private void btnGo_Click(object sender, EventArgs e)
 {
     txtOut.Text = PervasiveToOracle.ConvertPackageOfStoredProcs(txtIn.Text);
 }