我正在使用sql developer / Oracle Server
在vb.net中进行审计跟踪当我构建解决方案时,我得到5个值
的错误“参数未指定参数”任何帮助将不胜感激
这是代码
Public Sub UserLog(ByVal Userlevel As String, ByVal FirstName As String,
ByVal LastName As String, ByVal Time As Integer,
ByVal Action As String)
Try
Dim queryLog As String = "INSERT * TBL_LOG where USERLEVEL = (USERLEVEL,FIRSTNAME,LASTNAME,TIME,ACTION) VALUES ( '" & Userlevel & "', '" & FirstName & "', '" & LastName & "', '" & Time & "', '" & Action & "') "
Dim connStr As String = ConstantsPub.connectionStr
Dim query As String = queryLog
Dim conn As New OracleConnection(connStr)
Dim da As OracleDataAdapter = New OracleDataAdapter
Dim ds As New DataSet()
conn.ConnectionString = connStr
conn.Open()
da.SelectCommand = New OracleCommand(query, conn)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
答案 0 :(得分:0)
您的INSERT语句不正确;它的格式应该是这样的:
INSERT INTO table_name (column1,column2,column3,...)
VALUES (value1,value2,value3,...);
但是,如果您想要从另一个表中将值插入TBL_LOG表,则需要使用INSERT INTO SELECT语句,其格式如下:
INSERT INTO table2 (column_name(s)) SELECT column_name(s) FROM table1;