Hi Neil
Heres one way you could try it. Its by bypassing CFquery and
CFStoredProc and writing the JDBC calls directly.
This may be a rare case where you need to do this. most of the time
cfquery and cfstoredproc should do the job.
The code you need to call a statement from JDBC is as follows
<cfset getPageContext().getClass().forName("<my_driver_name>")>
<cfset objDriver = createObject("java","java.sql.DriverManager") >
<cfset conn = objDriver.getConnection("<my_connection_string>",
"username", "password") >
<cfset con.prepareCall("{call ....... }") >
<cfset resultSet = cs.executeQuery() >
To get your driver name and connection string go to
C:\CFusionMX\lib\neo-query.xml
and check out the XML that desribes your data source.
More info on JDBC Here:
http://java.sun.com/docs/books/tutorial/jdbc/basics/
Hope this helps
Pat
[EMAIL PROTECTED] wrote:
Hello folks,
I've hit a major brick wall trying to run a Teradata stored procedure using
CFMX and for once Google doesn't seem to have the answer. If I call a
Teradata stored procedure using <cfquery>, the procedure executes ok. e.g.
<cfquery name="dropTeradataUser" dsn="myDSN">
Call USERADMIN.DropUser ('smithj','HAYWARDN','345345','v',cast(StmntOut as
Varchar(200)) );
</cfquery>
However, within the aforementioned stored procedure, integrity checks are
made and any error messages are captured and returned in the StmntOut
variable. The <cfquery> tag doesn't allow me to refer to this error message
variable however, using <cfstoredproc> should. I gave this a whirl but got
the error message:
[Macromedia][SequeLink JDBC Driver][ODBC Socket][NCR][ODBC Teradata
Driver][Teradata RDBMS] 'DropUser' is not a macro.
I think this is because <cfstoredproc> tries to execute (exec) a Stored
Procedure rather than call it. Teradata understands exec as trying to
execute a macro.
Is there a way to get round this or am I scuppered?
My cfstoredproc code for what it's worth:
<cfstoredproc
PROCEDURE="USERADMIN.DropUser"
DATASOURCE="myDSN"
USERNAME="myUsername" PASSWORD="myPassword" DEBUG="NO">
<cfprocparam TYPE="In" CFSQLTYPE="CF_SQL_VARCHAR" DBVARNAME="TeradataID'"
VALUE="JOHNSONR" >
<cfprocparam TYPE="In" CFSQLTYPE="CF_SQL_VARCHAR" DBVARNAME="userID"
VALUE="smithj">
<cfprocparam TYPE="In" CFSQLTYPE="CF_SQL_VARCHAR" DBVARNAME="Change_Nbr"
VALUE="00112233">
<cfprocparam TYPE="In" CFSQLTYPE="CF_SQL_VARCHAR" DBVARNAME="Valid_only"
VALUE="V" >
<cfprocparam TYPE="Out" CFSQLTYPE="CF_SQL_VARCHAR" VARIABLE="theResponse"
DBVARNAME="StmntOut">
</cfstoredproc>
Thanks in advance for any help you can give.
Neil H
This e-mail and any attachments are confidential and intended solely
for the addressee and may also be privileged or exempt from disclosure
under applicable law. If you are not the addressee, or have received
this e-mail in error, please notify the sender immediately, delete it
from your system and do not copy, disclose or otherwise act upon any
part of this e-mail or its attachments..
Internet communications are not guaranteed to be secure or virus-free.
The Barclays Group does not accept responsibility for any loss arising
from unauthorised access to, or interference with, any Internet
communications by any third party, or from the transmission of any
viruses. Replies to this e-mail may be monitored by the Barclays
Group for operational or business reasons..
Any opinion or other information in this e-mail or its attachments
that does not relate to the business of the Barclays Group is personal
to the sender and is not given or endorsed by the Barclays Group.
Barclays Bank PLC.Registered in England and Wales (registered no. 1026167).
Registered Office: 1 Churchill Place, London, E14 5HP, United Kingdom.
Barclays Bank PLC is authorised and regulated by the Financial Services
Authority.
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/