Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 03-22-2004, 07:06 AM
YED YED is offline
Junior Member
 
Join Date: Feb 2001
Posts: 28
Default ":" character problem in sqls

Hi,
When I use : character in TAdo's SQL.Text;
ExecSql method return this error:
"Parameter object is improperly defined. inconsistent or incomplete information was provided"

AdoQuery1.Sql.Text :=
'CREATE PROCEDURE proc_STD AS' +
'--Author: Dolphin ' + //there is a problem in this line because of ":" character
'...'
AdoQuery1.ExecSql;

How can I use ":" characters in TAdoQuery's. (they'are not parameter only sql text)
Best Regards...
Reply With Quote
  #2  
Old 03-22-2004, 10:42 AM
johnjces johnjces is offline
Senior Member
 
Join Date: Oct 2001
Posts: 444
Default RE: ":" character problem in sqls

Anytime you use a ":" in SQL text such as

SQLQuery1.SQL.Add('Select * from MyTable Where MyField =:MyParam

Delphi expects you to have created a parameter that is a variable that can be changed for input or output. Look at a query.params or ADOQuery.parmaeters.

I know of no way to use a colon in SQL syntax and SQL syntax doesn't use colons unless you are prefixing host variable names, i.e. the paramater. if Dolphin is a parmeter or a host variable then the colon must be immediately before the name i.e. AUTHOR OLPHIN not
AUTHOR: DOLPHIN

Hope I may have helped a bit.



John Jarrett
Reply With Quote
  #3  
Old 03-22-2004, 10:01 PM
YED YED is offline
Junior Member
 
Join Date: Feb 2001
Posts: 28
Default RE:

Hi, John
Thanks for your answer.
The line which include ":" charecter is a only comment line, not a parameter you know.
When I create sql stored procs I usualy use ":" charecter in comment lines or messages.
But I can't use in TAdo.query.sql
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 10:40 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.