ErrorCode:904消息:Oracle JDBC驱动程序ORA-00904 ::无效标识符SQLState:42S22
这个功能有什么问题?我用插件调用它并得到904错误?
<!---- create ---->
<cffunction name="create" returntype="void">
<cfargument name="dsn" type="any" required="true" />
<cfargument name="FNAME" type="string" required="true" />
<cfargument name="LNAME" type="string" required="true" />
<cfargument name="EMAIL" type="string" required="true" />
<cfargument name="PHONE" type="string" required="true" />
<cfargument name="TITLE" type="string" required="true" />
<cfargument name="EXPERTISE" type="string" required="true" />
<cfargument name="TASCS" type="string" required="true" />
<cfargument name="LEADERSHIP" type="string" required="true" />
<cfargument name="MANAGEMENT_TEAM" type="string" required="true" />
<cfargument name="PARTNERS" type="string" required="true" />
<cfargument name="CONSULTANTS" type="string" required="true" />
<cfargument name="MEDIA_EVENTS" type="string" required="true" />
<cfargument name="WEBSITE" type="string" required="true" />
<cfargument name="ORGANIZATION" type="string" required="true" />
<cfargument name="PHOTO_NAME" type="string" required="true" />
<cfargument name="CV_FILE" type="string" required="true" />
<cfargument name="BIO" type="string" required="true" />
<cfset var qry="" />
<!----TODO: Below code is for table without auto increment enabled for primary key .Change the query Appropriately---->
<!---- insert record ---->
<cftry>
<cfquery name="qry" datasource="#dsn.getName()#">
INSERT INTO DIRECTORY
(
DIRECTORY_ID,
FNAME,
LNAME,
EMAIL,
PHONE,
TITLE,
EXPERTISE,
TASCS,
LEADERSHIP,
MANAGEMENT_TEAM,
PARTNERS,
CONSULTANTS,
MEDIA_EVENTS,
WEBSITE,
ORGANIZATION,
BIO,
CREATEDBY,
ISACTIVE
)
VALUES
(
DIRECTORY_SEQ.nextval,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.FNAME#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.LNAME#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.EMAIL#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.PHONE#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.TITLE#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.EXPERTISE#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.TASCS#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.LEADERSHIP#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.MANAGEMENT_TEAM#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.PARTNERS#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.CONSULTANTS#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.MEDIA_EVENTS#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.WEBSITE#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ARGUMENTS.ORGANIZATION#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_LONGVARCHAR" value="#ARGUMENTS.BIO#" null="false" />,
<cfqueryparam cfsqltype="CF_SQL_TIMESTAMP" value="#now()#" null="false" />,
1
)
</cfquery>
<cfcatch type="Any" >
<cfdump var="#CFCATCH#" output="C:\data\directorydao_create.txt">
</cfcatch>
</cftry>
</cffunction>
最终出现在directorydao_create.txt文件中的错误。
struct
Cause:
[struct]
ErrorCode: 904
Message: [Macromedia][Oracle JDBC Driver][Oracle]ORA-00904: "BIO": invalid identifier
SQLState: 42S22
StackTrace: java.sql.SQLSyntaxErrorException: [Macromedia][Oracle JDBC Driver][Oracle]ORA-00904: "BIO": invalid identifier
at macromedia.jdbc.oraclebase.ddca.b(Unknown Source)
at macromedia.jdbc.oraclebase.ddca.a(Unknown Source)
at macromedia.jdbc.oraclebase.ddb9.b(Unknown Source)
at macromedia.jdbc.oraclebase.ddb9.a(Unknown Source)
at macromedia.jdbc.oracle.ddm.q(Unknown Source)
at macromedia.jdbc.oraclebase.ddem.v(Unknown Source)
at macromedia.jdbc.oraclebase.ddem.r(Unknown Source)
at macromedia.jdbc.oraclebase.dddg.execute(Unknown Source)
at macromedia.jdbc.oraclebase.dddk.execute(Unknown Source)
at coldfusion.server.j2ee.sql.JRunPreparedStatement.execute(JRunPreparedStatement.java:101)
at coldfusion.sql.Executive.executeQuery(Executive.java:1458)
答案 0 :(得分:1)
“BIO”似乎是表中不存在的列,或者是无效的列名(由于它不是reserved word,因此我认为不是真的所有其他条件都是有效的列名称)。确保数据库表中存在“BIO”列。