gpt4 book ai didi

sql - oracle查询查看数据类型列表

转载 作者:行者123 更新时间:2023-12-02 08:50:43 26 4
gpt4 key购买 nike

我尝试在 datagridview vb.net 中显示我的表格数据类型。这是示例代码:

        oradb = "Data Source=(DESCRIPTION=" _
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & txtServer1.Text & ")(PORT=" & port1.Value & ")))" _
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" & txtSID.Text & ")));" _
+ "User Id=" & txtUsername1.Text & ";" _
+ "Password=" & txtPassword1.Text
Dim connOracle As New OracleConnection(oradb)

Try
connOracle.Open()
connOracle.Close()
Catch ex As Exception
MessageBox.Show(ex.Message.ToString())
Finally
End Try

SQL = "desc hr.employees"
myCommand1.Connection = connOracle
myCommand1.CommandText = SQL
myAdapter1.SelectCommand = myCommand1
myAdapter1.Fill(myTablePreview)
DataGridView1.DataSource = myTablePreview

我尝试使用用户名“system”登录。当我运行这段代码时,我收到错误消息“ORA-00900:无效的 SQL 语句”

我的查询有问题吗??请帮助我。谢谢……

最佳答案

DESC 是一个 SQL PLus 命令。

你可能想做一个实际的查询,比如

select * 
from all_tab_cols
where table_name = 'EMP'

关于sql - oracle查询查看数据类型列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8648598/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com