Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 20th, 2004, 06:45 PM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delphi ADO Query

When I convert our Delphi-Oracle BDE applications to ADO, I get an error after I try to add the query fields. The SQL statement uses a parameter:

SELECT CO_KEY, DETAIL_DATA1 FROM CONTACT_DETAIL
WHERE CONTACT_KEY IS NULL AND DETAIL_CD = 'PHONE' and
CO_KEY = :CO_KEY

The error is:
Cannot add fields to qryCOMPANYPHONE. Parameter object is improperly defined. Inconsistent or incomplete info was provided.
 
Old January 30th, 2004, 03:19 PM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to fullerming
Default

Try using a questions mark...

I don't know Delphi, but in .Net (using C# code), the "Add" method for an OleDbCommand object binds the replacible parameters for a query. Consider the following C# code (from an application we have here at Maryland)

string queryError = "SELECT Count(*) " +
                    "FROM UM_ERROR_LOG " +
                    "WHERE TRANS_DATE = ? AND UNIT_CODE = ?";
            .
            .
            .
OleDbCommand cmd3 = new OleDbCommand(queryError, Global.cn);
             cmd3.Parameters.Add("prmTransDate", tdate);
             cmd3.Parameters.Add("prmUnitcode", unitcode);
             lblError.Text = cmd3.ExecuteScalar().ToString();

I hope this is helpful

Fuller Ming, Jr.
Assistant Director, MIS/IT
University of Maryland
Department of Dining Services
 
Old February 2nd, 2004, 12:49 PM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Using a ? resulted to "SQL command not properly ended". How I solved this was to remove the parameter clause, add the fields and restore the parameter clause. It worked but I hoped there was a neater solution. Thanks.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using ADO to Query Excel alex_w Excel VBA 1 October 19th, 2006 04:42 AM
Delphi to C++ conversion. Need help... Neeko C++ Programming 2 December 20th, 2005 01:51 AM
Using ADO to Query Excel alex_w Access VBA 1 May 18th, 2005 11:59 AM
AWSExpert for Builder/Delphi 5-6-7 sash2 C++ Programming 0 January 26th, 2005 10:15 AM
ADO Dynamic Query - Please help rudidoku Access 1 July 23rd, 2003 06:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.