DROP_Running , autonumber oracle
autonumber oracle
''----------------------------------------------
''--- ---autonumber oracle autonumber oracle autonumber oracle autonumber oracle
''-----------------------------------------------
Public Sub DROP_RunnoFG()
Dim ssql As String
Dim dtDATx As New DataTable
Dim DteTime As Date = ssCON.Exc_GETToday
Dim DS As DataSet = New DataSet("Table")
Dim Table As New Data.DataTable
Table.Columns.Add("TABLE1_", GetType(String))
Try
Dim SQL_DT As String = "SELECT * FROM TFG_MASTER WHERE CODEID = 'RU' " & _
" AND TO_CHAR(TO_DATE('" & Strings.Format(DteTime, formatDATEShort) & "', 'yyyyMMdd'),'YYYY/MM/DD') <> TO_CHAR(UPDDTE ,'YYYY/MM/DD')"
dtDATx = ssCON.Exc_Reader(SQL_DT)
If dtDATx.Rows.Count > 0 Then
''DROP SEQUENCE'''' -----------
''ssql = "DROP SEQUENCE emp_TFG_RECORDSEQ_J03 "
''ssCON.Exc_ExecuteNonQuery(ssql)
ssql = "DROP SEQUENCE emp_TFG_PALLETKEY_J03 "
ssCON.Exc_ExecuteNonQuery(ssql)
ssql = "DROP SEQUENCE emp_TFG__RCMANGENO_FG "
ssCON.Exc_ExecuteNonQuery(ssql)
ssql = "DROP SEQUENCE emp_TFG_RECEIVING_SEQ "
ssCON.Exc_ExecuteNonQuery(ssql)
''''CREATE RECORDSEQ -----------
''ssql = "Create sequence emp_TFG_RECORDSEQ_J03 " & _
' " start with 1 " & _
' " increment by 1 " & _
' " minvalue 1 " & _
' " maxvalue 99999 " & _
' " cache 10 "
''Table.Rows.Add(ssql)
''ssCON.Exc_ExecuteNonQuery(ssql)
''PALLET KEY
ssql = "Create sequence emp_TFG_PALLETKEY_J03 " & _
" start with 1 " & _
" increment by 1 " & _
" minvalue 1 " & _
" maxvalue 9999 " & _
" cache 10 "
Table.Rows.Add(ssql)
''ssCON.Exc_ExecuteNonQuery(ssql)
''FG = RC170715000154 = RC NO
ssql = "Create sequence emp_TFG__RCMANGENO_FG " & _
" start with 1 " & _
" increment by 1 " & _
" minvalue 1 " & _
" maxvalue 99999 " & _
" cache 10 "
Table.Rows.Add(ssql)
''ssCON.Exc_ExecuteNonQuery(ssql)
''SEQ
ssql = "Create sequence emp_TFG_RECEIVING_SEQ " & _
" start with 1 " & _
" increment by 1 " & _
" minvalue 1 " & _
" maxvalue 99999 " & _
" cache 10 "
Table.Rows.Add(ssql)
''ssCON.Exc_ExecuteNonQuery(ssql)
''UPD
ssql = "UPDATE TFG_MASTER SET " & _
" VALUE1 = TO_CHAR(TO_DATE('" & Strings.Format(DteTime, formatDATEShort) & "', 'yyyyMMdd'),'YYYYMMDD') " & _
",SYSDTE = TO_DATE('" & Strings.Format(DteTime, formatDATE) & "', 'yyyy/MM/dd hh24:mi:ss') " & _
",UPDDTE = TO_DATE('" & Strings.Format(DteTime, formatDATE) & "', 'yyyy/MM/dd hh24:mi:ss') " & _
" WHERE CODEID = 'RU' AND TO_CHAR(TO_DATE('" & Strings.Format(DteTime, formatDATEShort) & "', 'yyyyMMdd'),'YYYY/MM/DD') <> TO_CHAR(UPDDTE ,'YYYY/MM/DD')"
Table.Rows.Add(ssql)
''ssCON.Exc_ExecuteNonQuery(ssql) -->> ฯ no usedSP
DS.Tables.Add(Table)
If ssCON.Exc_DataSet(DS) = True Then
'ok
Else
MsgBox("Create sequence error")
End If
End If
Catch ex As Exception
MsgBox("Create sequence error")
End Try
End Sub
--autonumber oracle autonumber oracle,,autonumber oracle,,autonumber oracle,,autonumber oracle
''----------------------------------------------
''--- ---autonumber oracle autonumber oracle autonumber oracle autonumber oracle
''-----------------------------------------------
Public Sub DROP_RunnoFG()
Dim ssql As String
Dim dtDATx As New DataTable
Dim DteTime As Date = ssCON.Exc_GETToday
Dim DS As DataSet = New DataSet("Table")
Dim Table As New Data.DataTable
Table.Columns.Add("TABLE1_", GetType(String))
Try
Dim SQL_DT As String = "SELECT * FROM TFG_MASTER WHERE CODEID = 'RU' " & _
" AND TO_CHAR(TO_DATE('" & Strings.Format(DteTime, formatDATEShort) & "', 'yyyyMMdd'),'YYYY/MM/DD') <> TO_CHAR(UPDDTE ,'YYYY/MM/DD')"
dtDATx = ssCON.Exc_Reader(SQL_DT)
If dtDATx.Rows.Count > 0 Then
''DROP SEQUENCE'''' -----------
''ssql = "DROP SEQUENCE emp_TFG_RECORDSEQ_J03 "
''ssCON.Exc_ExecuteNonQuery(ssql)
ssql = "DROP SEQUENCE emp_TFG_PALLETKEY_J03 "
ssCON.Exc_ExecuteNonQuery(ssql)
ssql = "DROP SEQUENCE emp_TFG__RCMANGENO_FG "
ssCON.Exc_ExecuteNonQuery(ssql)
ssql = "DROP SEQUENCE emp_TFG_RECEIVING_SEQ "
ssCON.Exc_ExecuteNonQuery(ssql)
''''CREATE RECORDSEQ -----------
''ssql = "Create sequence emp_TFG_RECORDSEQ_J03 " & _
' " start with 1 " & _
' " increment by 1 " & _
' " minvalue 1 " & _
' " maxvalue 99999 " & _
' " cache 10 "
''Table.Rows.Add(ssql)
''ssCON.Exc_ExecuteNonQuery(ssql)
''PALLET KEY
ssql = "Create sequence emp_TFG_PALLETKEY_J03 " & _
" start with 1 " & _
" increment by 1 " & _
" minvalue 1 " & _
" maxvalue 9999 " & _
" cache 10 "
Table.Rows.Add(ssql)
''ssCON.Exc_ExecuteNonQuery(ssql)
''FG = RC170715000154 = RC NO
ssql = "Create sequence emp_TFG__RCMANGENO_FG " & _
" start with 1 " & _
" increment by 1 " & _
" minvalue 1 " & _
" maxvalue 99999 " & _
" cache 10 "
Table.Rows.Add(ssql)
''ssCON.Exc_ExecuteNonQuery(ssql)
''SEQ
ssql = "Create sequence emp_TFG_RECEIVING_SEQ " & _
" start with 1 " & _
" increment by 1 " & _
" minvalue 1 " & _
" maxvalue 99999 " & _
" cache 10 "
Table.Rows.Add(ssql)
''ssCON.Exc_ExecuteNonQuery(ssql)
''UPD
ssql = "UPDATE TFG_MASTER SET " & _
" VALUE1 = TO_CHAR(TO_DATE('" & Strings.Format(DteTime, formatDATEShort) & "', 'yyyyMMdd'),'YYYYMMDD') " & _
",SYSDTE = TO_DATE('" & Strings.Format(DteTime, formatDATE) & "', 'yyyy/MM/dd hh24:mi:ss') " & _
",UPDDTE = TO_DATE('" & Strings.Format(DteTime, formatDATE) & "', 'yyyy/MM/dd hh24:mi:ss') " & _
" WHERE CODEID = 'RU' AND TO_CHAR(TO_DATE('" & Strings.Format(DteTime, formatDATEShort) & "', 'yyyyMMdd'),'YYYY/MM/DD') <> TO_CHAR(UPDDTE ,'YYYY/MM/DD')"
Table.Rows.Add(ssql)
''ssCON.Exc_ExecuteNonQuery(ssql) -->> ฯ no usedSP
DS.Tables.Add(Table)
If ssCON.Exc_DataSet(DS) = True Then
'ok
Else
MsgBox("Create sequence error")
End If
End If
Catch ex As Exception
MsgBox("Create sequence error")
End Try
End Sub
--autonumber oracle autonumber oracle,,autonumber oracle,,autonumber oracle,,autonumber oracle
ไม่มีความคิดเห็น