unote 書けば書くほどに

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

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…