当我尝试将csv文件上传到C#中的Oracle数据库时遇到问题。出现错误消息,例如 {“ ORA-00936:缺少表达式”} 。我不知道要解决它。请问有人在这里可以帮助我解决这个问题吗?
这是我当前的代码;
conn.Open();
foreach(DataRow importRow in importData.Rows)
{
OracleCommand cmd = new OracleCommand("INSERT INTO TMCI_PPC_IMPORTDATA_PSI (ITEM, REQUIREMENT, REQ_DATE)" +
"VALUES (@Itm, @Req, @ReqDT)", conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add("@Itm", importRow["ITEM"]);
cmd.Parameters.Add("@Req", importRow["REQUIREMENT"]);
cmd.Parameters.Add("@ReqDT", importRow["REQ_DATE"]);
cmd.ExecuteNonQuery();
}
答案 0 :(得分:3)
几个问题:
class SearchPresenter<T>(val network: Network) : BasePresenter<NewsView<T>>()
而不是 TextView textView;
EditText editText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
editText = findViewById(R.id.editText);
textView.setText("0");
}
public void add(View v) {
int x = Integer.parseInt(textView.getText().toString());
textView.setText(String.valueOf(x + Integer.parseInt(editText.getText().toString())));
}
作为参数代码:
:
答案 1 :(得分:1)
我非常确定参数必须具有:作为前缀而不是@
client_src.describe_snapshots(OwnerIds=['012345678900'],Filters=[{'Name': 'tag:Disaster_Recovery', 'Values': ['Full']}])
并更改参数,如下所示:
OracleCommand cmd = new OracleCommand("INSERT INTO TMCI_PPC_IMPORTDATA_PSI (ITEM, REQUIREMENT, REQ_DATE)" +
"VALUES (:Itm, :Req, :ReqDT)", conn);