unote 書けば書くほどに

2023-01-01から1年間の記事一覧

20230209

public void OraDropCreate(string TN) { DataTable dt = new DataTable(); Console.WriteLine("実行...\r\n"); try { //Drop strSql_DRP = "drop table " + TN + "_BK"; Console.WriteLine("drop実行..."); strSql = strSql_DRP; Console.WriteLine(strSql)…

■

//テーブル関数内に作成:検証関数 public void chkdata() { string repTN_BK = repTN + " _BK"; repTN = repTN + " R"; //_BK strSql = "create " + repTN_BK + " as select * from " + repTN; //dt = dbQ(strSql); //minusで差分を確認 strSql = "select c…

20230207

string repTN_tmp = ""; //一時テーブル作成 strSql = "create table " + repTN_tmp + " as select * from " + xbbTN + " where rownum = 1"; //更新行だけインサート strSql = "insert into " + repTN_tmp + " select * from " + xbbTN + " where R.KOUSHIN…

20230206

//テーブル関数内に作成:検証関数void chkdata() { //_BK strSql = "create " + repTN + "_BK as select * from " + repTN; //dt = dbQ(strSql);minus() { strSql = "select * from " + repTN + "_BK " + "minus select * from " + repTN; //dt = dbQ(strSq…

20230203

public void B_TableMarge() { DataTable dt = new DataTable(); DataColumn dc = new DataColumn(); string repTN = "DEPT_BK R"; string xbbTN = "DEPT X"; col1 = "DEPTNO"; whereON = "R." + col1 + " = X." + col1; string whereDEL_R = "R." + col1; s…

20230202

//全件数カウント chkCNT = CNT(repTN, xbbTN); dt = TableMinus_CNT(); if (dt.Rows[0][0].ToString() == "0") { Console.WriteLine("差分なし"); } else { //MARGE実行(差分抽出→項目更新→日付更新) MRG(repTN, xbbTN, colNum, chkCNT); //削除 DEL(repTN,…

20230131

INSERT INTO DEPT_BK SELECT * FROM DEPT MINUS SELECT * FROM DEPT_BK ■Sql Formatter VScode拡張機能 SQL Formatter - Visual Studio Marketplace

20230130

元テーブルに存在するが、複製テーブルには存在しない を追加するINSERT INTO DEPT_BK(DEPTNO,DNAME,LOC,ADDRESS,AGE) SELECT DEPTNO,DNAME,LOC,ADDRESS,AGE FROM DEPT MINUS SELECT DEPTNO,DNAME,LOC,ADDRESS,AGE FROM DEPT_BKINSERT INTO repTN(col1,col2)…

2023/01/29

2023/01/29以下参考に。目的 ゴール 背景 成果 結論 課題 @echo offecho SSIDを表示しますnetsh wlan show profiles:INPUT_CHECK SET INPUTSTR= SET /P INPUTSTR="入力してください:" IF "%INPUTSTR%"=="" GOTO :INPUT_CHECKecho SSID:%INPUT_STR% netsh wla…

20230128

SQL作成//KOUSHINBI → UPDATE REPRACE //差分抽出方法を変更 //■MRGでUPDATEとINSERTを実行する public void ComFunc() { //全件数カウント chkCNT = CNT(repTN,xbbTN); //MARGE実行(差分抽出→項目更新→日付更新) MRG(repTN, xbbTN, colNum, chkCNT); //削除…

20230125

string whereDEL_R = "R." + col1 + "," + "R." + col2; string whereDEL_X = "X." + col1 + "," + "X." + col2;string strSql_DEL = "delete from " + repTN + " where (" + whereDEL_R + ")" + " not in (select " + whereDEL_X + " from " + xbbTN + ")";…

20230124

public void DEL(string repTN,string xbbTN,string whereON) { Console.WriteLine("■DELETE実行…\r\n"); string strSql_DEL = "delete from " + repTN + " where not exists (select 'x' from " + xbbTN + " where " + whereON + ")"; strSql = strSql_DEL;…

20230122

public Form1() { InitializeComponent(); this.StartPosition = FormStartPosition.CenterScreen; } private void button1_Click(object sender, EventArgs e) { Excel.Application excelApp = new Excel.Application(); Excel.Workbooks excelBooks = exce…

20200118

public void chkDate() { DataTable dt = new DataTable(); Console.WriteLine("select"); strSQL = "select * from DEPT_BK R " + "where exists " + "(select * from DEPT X " + "where R.KOUSHINBI dt = DBA(strSQL); //SQL実行 Console.WriteLine(strSQL…

20230115

internal class Program { string strSQL; //表示SQL string selTN = "DEPT_BK"; //表示テーブル名 string strSQL_SEL = "select * from "; //string strSQL_SEL2 = " order by DEPTNO"; //新規追加SQL(テーブル複製) string creTN = "DEPT_BK"; //複製テー…

20230114

public void B_TableMarge() { DataTable dt = new DataTable(); DataColumn dc = new DataColumn(); string repTN = "DEPT_BK R"; string xbbTN = "DEPT X"; col1 = "DEPTNO"; whereON = "R.KOUSHINBI " and R." + col1 + " = X." + col1; int colNum = 1;/…

20230113

static void Main(string[] args) { Console.WriteLine("--- STRAT ---\r\n" + DateTime.Now + "\r\n"); Program pg = new Program(); DataTable dt = new DataTable(); //★実行内容★ pg.B_TableMarge(); //pg.OraTableDrop(); //テーブル削除 //pg.OraCopyC…

20230112

public void Count() { RTN = "DEPT_BK"; DataTable dt = new DataTable(); //全件数 strSQL = "select count(*) from " + RTN; ; dt = DBA(strSQL); //SQL実行 Console.WriteLine(RTN + " 全" + dt.Rows[0][0] + "行\r\n"); //カラムごとの件数 int num = 1…

20230111

public void B_Table_marge() { DataTable dt = new DataTable(); string repTN = "DEPT_BK R"; string xbbTN = "DEPT X"; int i = 1; //差分抽出 Console.WriteLine("差分抽出開始...\r\n"); strSQL_MINUS = "select * from " + repTN + " minus select * f…

20230110

string whereUp; string sql_upCase; public void Main() { Console.WriteLine("--- STRAT ---\r\n" + DateTime.Now + "\r\n"); Program pg = new Program(); DataTable dt = new DataTable(); pg.A_TableMarge(); //MARGE実行 pg.A_TableUpdate(); //UPDATE…

20230109

using Oracle.ManagedDataAccess.Client; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;namespace DBTest_Console { internal cl…

20230104

・summryの追加 ・テーブル名で変数化 ・関数の作成(select,update,insert,creat,drop) ・case文の追加、変数化■VScode拡張機能 ・Oracle Developer Tools for VS CodeVSCode DB接続 で検索■Visual studio拡張機能 ・Toggle Comment Ctrl+/でコメントアウト…

20230101

/// /// update ボタンクリック時 /// private void button4_Click(object sender, EventArgs e) { OraTableUpdate(); } public void OraTableUpdate() { Console.WriteLine("開始"); //データテーブル取得 string strSQL = "select * " + "from DEPT_BK"; D…