下面是我的代码,当我执行此代码时,在12行中出现错误为“语法错误在或接近”202382_“在字符15”。
Set con=createobject("adodb.connection")
Set rs=createobject("adodb.recordset")
con.open"DSN=WC_Vertica_PROD;Autocommit=1;BackupServerNode=;ColumnsAsChar=0;ConnectionLoadBalance=0;ConnSettings=;Database=shr4_hdp_vrt_pro_001;Description=WC_Vertica_PROD;DirectBatchInsert=0;Driver=Vertica;DriverStringConversions=OUTPUT;KerberosHostname=;KerberosServiceName=vertica;Label=;Locale=en_US@collation=binary;Port=5433;PromptOnNoPassword=0;PWD=W0rk1ngCap!pro;ReadOnly=0;ResultBufferSize=131072;Servername=g4t8735.houston.hp.com;SSLMode=prefer;ThreePartNaming=1;TransactionIsolation=Server Default;UID=srvc_wc_hpro"
rs.open "select * from 202382_gf_workingcapital_pro.ovr_spnd_po_drvd_vw",con
Msgbox ("Connection Established")
TotalRows = rs.RecordCount
TotalCols = rs.Fields.Count
Do
For i = 0 To TotalCols-1
For j = 0 To TotalCols-1
Next
ColNames = rs.Fields(i,j).name
Next
rs.MoveNext
Loop until rs.EOF
答案 0 :(得分:1)
Oracle中的标识符不能以数字开头。如果这确实是您的架构名称,则需要引用它:
SELECT *
FROM "202382_gf_workingcapital_pro".ovr_spnd_po_drvd_vw
-- Here^---------------------------^