Skip to content

Commit

Permalink
random changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeents committed Sep 7, 2023
1 parent c055c08 commit a2efa67
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 92 deletions.
22 changes: 11 additions & 11 deletions AppStatic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public static string SQLDefNullValueCSharp(string sqlType) {
public static string SQLDefNullValueSQL(string sqlType) {
string w = sqlType.ToLower().ParseString(" ()", 0);
string result = "";
if (w == "char") result = "\"\"";
else if (w == "varchar") result = "\"\"";
if (w == "char") result = "''";
else if (w == "varchar") result = "''";
else if (w == "int") result = "0";
else if (w == "bigint") result = "0";
else if (w == "binary") result = "null";
Expand All @@ -68,17 +68,17 @@ public static string SQLDefNullValueSQL(string sqlType) {
else if (w == "image") result = "null";
else if (w == "money") result = "0.0";
else if (w == "numeric") result = "0.0";
else if (w == "nchar") result = "\"\"";
else if (w == "ntext") result = "\"\"";
else if (w == "nvarchar") result = "\"\"";
else if (w == "nchar") result = "''";
else if (w == "ntext") result = "''";
else if (w == "nvarchar") result = "''";
else if (w == "real") result = "0.0";
else if (w == "smallint") result = "0";
else if (w == "smallmoney") result = "0.0";
else if (w == "smalldatetime") result = "null";
else if (w == "text") result = "\"\"";
else if (w == "text") result = "''";
else if (w == "timestamp") result = "null";
else if (w == "tinyint") result = "0";
else if (w == "uniqueidentifier") result = "\"\"";
else if (w == "uniqueidentifier") result = "''";
else if (w == "varbinary") result = "null";
return result;
}
Expand All @@ -100,13 +100,13 @@ public static string GetSQLInsertListAsSQLParam(this TreeNode tnTable, bool Incl
if (sFTT == "true") {
sFTT = "false";
if (IncludeFirstCol) {
sRes = "@" + tn.Text.ParseString(" ()", 0);
sRes = "@" + tn.Text.ParseString(" ()@", 0);
}
} else {
if (sRes == "") {
sRes = "@" + tn.Text.ParseString(" ()", 0);
sRes = "@" + tn.Text.ParseString(" ()@", 0);
} else {
sRes = sRes + ", @" + tn.Text.ParseString(" ()", 0);
sRes = sRes + ", @" + tn.Text.ParseString(" ()@", 0);
}
}
}
Expand Down Expand Up @@ -402,7 +402,7 @@ public static string GenerateCSharpExecStoredProc(this TreeNode tnStProc) {
public static string GetDeclareSQLParam(this TreeNode tnStProc) {
string s = "";
foreach(TreeNode cn in tnStProc.Nodes) {
s = s +"declare @"+ cn.Text + " set @" +cn.Text.ParseFirst(" ")+" = "+ SQLDefNullValueSQL(cn.Text.ParseLast(" "))+";" + CodeStatic.nl;
s = s +"declare "+ cn.Text + " set " +cn.Text.ParseFirst(" ")+" = "+ SQLDefNullValueSQL(cn.Text.ParseLast(" "))+";" + CodeStatic.nl;
}
return s;
}
Expand Down
2 changes: 2 additions & 0 deletions ClassDiagram1.cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />
Loading

0 comments on commit a2efa67

Please sign in to comment.