Err: Not enough values for host variables??

I am trying to execute a Query from Delphi3 to select a group of rows
from a table using a TQuery component in Delphi. I specify the query
with a parameter and add the parameter details in the query properties.
When I try to open the query I get the following error.

General SQL error.
 [Sybase][ODBC Driver]Wrong number of parameters: not enough values for 
host variables.

Why is this?

If I replace the parameter with a hard-coded value (ie 2) then the query
works, but my users might want to see other selections. :<

How can I fix this?

Glenn.
0
Glenn
10/23/1997 5:44:27 AM
sybase.sqlanywhere.general 32637 articles. 4 followers. Follow

6 Replies
1894 Views

Similar Articles

[PageSpeed] 50

This error is sometimes difficult to track down.  It can occur on INSERT or
UPDATE statements as well as SELECT.  

In some cases the cause was multiple rows being returned when only one row
was expected.  The variables that were to hold the return values were
insufficient.

Another problem can occur when passing variables to procedures and also
specifying them as OUT parameters when that really isn't necessary.

In the cases I have seen it was a programming error, not a bug.
-- 
Jim Egan [TeamPS]
Dealer Solutions, LLC
Houston, TX
0
Jim
10/23/1997 11:15:12 AM
> In the cases I have seen it was a programming error, not a bug.

Gee, this is really bugging me! :>

I didn't think it was a bug, most likely some config or declaration
problem on my part. 

Glenn.
0
Glenn
10/23/1997 12:47:35 PM
I am using Borland C++ Builder, and getting the same error about "not
enough host variables."  As was mentioned before, there is no problem if
the query WHERE values are hard-coded.  But as soon as I try to do a
parameterized query (i.e. WHERE col = :param) I get the "host variables"
error.

One would assume that Delphi 3 and C++ Builder use identical methods of
accessing ODBC databases, since they are practically the same product. 
After many, many hours of trying to solve this one, I am starting to
become convinced that the problem is in the Borland stuff, not mine or
Sybase's.  I have done the exact same query in PowerBuilder with no
problems...

- Brett Langston
0
Brett
11/5/1997 11:59:22 PM
Brett,

After fussing with the SQL SELECT for a while and not having solid
results with the parameterized queries I moved to coding the WHERE line
of the query in source code and forcing the value.  I would really like
to know the answer to the parameter problem.

Someone had claimed that adding an integer parameter as the first
parameter would solve the problem. Unfortunately their example was for a
stored proc and mine was a query that already had only a single integer
parameter.

Glenn.
0
Glenn
11/6/1997 8:40:05 AM
Hi,

When SQL code is placed in SQL editor Delphi, & I am presume C++ Builder
does the same since it's based on Delphi, reformats it knowing
that there is a parameter via :. For run-time situations, create the SQL
string and pass the parameter as a STRING value, i.e.

var SQLcode : String;

begin

SQLcode := 'SELECT * FROM finally WHERE whatever = ' + TRIM(Edit1.Text);

with Query1 do
begin
	Close;
	SQL.Clear;
	SQL.Add(SQLcode);
	Open;
end;

end;

I also made an earlier posting explaining how to get around problem with
stored proc's - Oct 30.

Shew


Brett Langston <langst00@zodiac.cs.newpaltz.edu> wrote in article
<3461085A.1D7F7F32@cs.newpaltz.edu>...
> I am using Borland C++ Builder, and getting the same error about "not
> enough host variables."  As was mentioned before, there is no problem if
> the query WHERE values are hard-coded.  But as soon as I try to do a
> parameterized query (i.e. WHERE col = :param) I get the "host variables"
> error.
> 
> One would assume that Delphi 3 and C++ Builder use identical methods of
> accessing ODBC databases, since they are practically the same product. 
> After many, many hours of trying to solve this one, I am starting to
> become convinced that the problem is in the Borland stuff, not mine or
> Sybase's.  I have done the exact same query in PowerBuilder with no
> problems...
> 
> - Brett Langston
> 
0
Shew
11/6/1997 12:03:44 PM
Seems like I had this same problem in O++.  If I remember correctly, I got 
around it at runtime by specifically preparing the query before running it.  I 
never did get it solved for design time.

I don't know if that will help under BCB but it's worth a shot.

Good Luck
Jeff

0
Jeff
11/6/1997 3:31:01 PM
Reply:

Similar Artilces:

Not enough values for host variables?????
I am trying to pass the parameter like this. (See below) BUT...I am getting the error not enough values for host variables and I don't understand why. Can you help? Thanks, chance alter function ItemLookup(SubscriptionId char(40), IdType char(10), ItemId char(13), ResponseGroup char(10) ) RETURNS LONG VARCHAR url 'http://soap.amazon.com/onca/soap?Service=AWSECommerceService' namespace 'http://webservices.amazon.com/AWSECommerceService/ 2005-03-23' type 'SOAP:DOC' ; call sa_make_object('procedure', 'ItemLookupWra...

Not enough values for host variables
When we try to replicate a table from ASE to SQL anywhere and if the SQL Anywhere table contains user defined datatypes with check constraints bound to it the DSI stops with the Open Server Gateway giving an SQL Anywhere error -188(Not enough values for host variables). If the same datatypes are used without the check constraints it works fine. We have a ASE 11.9.2 replication to Sql Anywhere 5.5.04 setup using RS 11.5. The description for the error as mentioned in the manuals is Item Value SQLCode -188 Constant SQLE_NOT_ENOUGH_HOST_VARS SQLSt...

SOS:: Not enough values for Host Variables
Hi ALL, When trying to replicate a table from ASE(11.9.2) to SQL anywhere(5.5.04), if the SQL Anywhere table contains an user defined datatype with check constraint bound to it the DSI stops with the Open Server Gateway giving an SQL Anywhere error -188(Not enough values for host variables). If the same datatype is used without the check constraints it works fine. We have a ASE 11.9.2 replication to Sql Anywhere 5.5.04 setup using RS 11.5. The description for the error as mentioned in the manuals is Item Value SQLCode -188 Constant SQLE_NOT_ENOUGH_HOST_V...

Not enough values for host variables error
I have this for statement in a stored procedure. I get the error: 'Not enough values for host variables' when I test it out in sybase central. I can't see what is wrong with it, can anyone else? Thanks. alter procedure dba.CreditInfo(in @arnum char(6)) begin declare @OrdCrInfo char(6); declare @ItemCrInfo integer; declare @OrdCrInfo2 char(6); declare @ItemCrInfo2 integer; for shipnotinv as cur_shipped dynamic scroll cursor for select I.Ordernum as @Ordernum,I.Item as @Item,I.Prodcode as @Prodcode,I.Quantity as @Quantity, I.Unitprice as @Unitprice,S...

Error -188: Not enough values for host variables
I found a problem in ASA 7 whereby I have a data type CREATE DATATYPE D_YesNo char(1) not null default 'N' check (@col in ('Y','N')) and then in a table with a column defined using this type, the check clause does not seem to be adjusting to the column name in place of the @col variable. When I try to select frmo teh table using the NativeDB lib and Delphi I get an error of -188: Not enough values for host variables (07001). After lots of tracking by me and Harald at Liodden it appears that the check condition was causing the problem. I changed the c...

Not enough values for host variables: ERROR Message
Help: When calling a stored procedure within out application, the error message Not enough values for host variables is displayed. The stored procedure works fin within isql but not with the application when testing. Can anyone give me a clue on this problem?? Thanks, Peggy Check to make sure you have variables that match the result set in datatype as well as number (10 columns returned, 10 variables to accept it). Also, make sure you do not have duplicates of the SQL Anywhere DLL files. Duplicates have been known to cause a problem before. -- Jim Egan [TeamPS] Dealer So...

ASA Error -188: Not enough values for host variables
Hi All. I have a table that when I send a statement from ISQL, this report the following error: Statement in the ISQL: delete empleado The error reported by ISQL is: Could not execute statement ASA Error -188: Not enough values for host variables I validated integrity of this database and no error was reported. So what are doing wrong. Thank you for your help and sorry my english. -- Juan Carlos Marin Ingesoftware Ltda. Tels: (096) 325 4714 - 325 8833 What version and build are you using? Do you have triggers defined on this table? If so, you should examine the...

Error -188 Not enough values for host variables / PowerBuilder / SQLCache
Hi all, ASA 9.01 1751 (Same error on 9.00 1108,and asa8.02 3601) PowerBuilder 9.01 build 6533 I get the error "Error -188 Not enough values for host variables" at random (insert/update)- if i use the PB performance option SQLCache=50 in my ODBC connect string The reson for using SQLCache is purely to gain performnce withch acording to PB documentation can be significantly better. If I do not specify sqlcache in the connect string then all work just fine. To begin with I nedded to execute the following statement to workarround another error witch also came as a ...

SQLSTATE 7001 Wrong number of parameters; not enough values for host variables
How do I fix error SQLSTATE 7001 Wrong number of parameters;not enough values for host variable ? This error is occurring when I run a pipeline from a text datasource to SQLAnywhere. The pipeline worked until we made a copy of the destination database. I have checked the field sizes and column names in both source and destination tables. They are correct. ...

PowerBuilder9.01 / SQLCache ASA returns this Error -188 Not enough values for host variables
Hi all, (This is a cross post from sybase.public.sqlanywhere.general - since the issue may be with PB) Platform is: ASA 9.01 1751 (Same error on 9.00 1108,and asa8.02 3601) PowerBuilder 9.01 build 6533 I get the error "Error -188 Not enough values for host variables" at random (insert/update)- if i use the PB performance option SQLCache=50 in my ODBC connect string The reson for using SQLCache is purely to gain performnce withch acording to PB documentation can be significantly better. If I do not specify sqlcache in the connect string then all work ...

Field1 value --> variable name ; Field2 value --> variable value (C# code behind)
 I would like to add quantities to variables based on two fields in a table.  The table includes two field names: ingredient, weight.  Assume a simple formulation: add 50 lbs water, add 20 lbs eggs, add 10 lbs water, add 5 lbs salt.The table would have: water, 50 eggs, 20 water, 10 salt, 5The variables water, eggs, water and salt have already been defined. I want something that will cycle through and add the quantities (lbs) to the variable. Ingredients can appear more than once in a formulation--notice that water appears twice and at the e...

compare single-valued-variable with multi-valued-variable
i�d like to compare a value with a list of values from a variable (see var2, where the notation is like regex) and set a local-var to 1 if match is found, else to 0. what i do not know how to compare one value regex-wise. i can make for each value a policy, but is there a more elegant way? <do-set-local-variable name="var2" scope="policy"> <arg-string> <token-text xml:space="preserve">154|155|157|175|330|530|719|745</token-text> </arg-string> </do-set-local-variable> this one should kind of loop through the...

NULL value for regular host variable with ct_param
When using a host variable (with an UPDATE statement) with ct_param, and one of my my variables in the WHERE is NULL, I can not seem to set the database value to NULL. I tried both the methods the manual describes, setting data to null and datalen to 0, or indicator to -1. But none of the two methods work. It does not error, it just does not find the ,atch for the WHERE. When I use a dynamic sql styatement and I prepare the statement, my code works fine. My update statement looks something like this: UPDATE mytable SET transaction_id=@transaction_id WHERE country=@w_country AND b...

SQL Anywhere 10: Not enough host variables
All, I'm working with SQL Anywhere 10.0.1 build 3559 and I get the "Not enough host variables" when I try the following:- 1. Create a domain:- "create domain em_id as unsigned integer check (@col is null or (@col >= 1 ))" 2. Create a table that uses the domain:- create table emp ( emp_id em_id not null default autoincrement, emp_name varchar(254) not null, primary key(emp_id) ); 3. Try to Insert some data:- insert into emp(emp_id, emp_name) values (1, 'dinesh pillay'); On the third statement, I get the error. Any ideas why...

Web resources about - Err: Not enough values for host variables?? - sybase.sqlanywhere.general

Variable - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Westpac interest rate rise is one of many variable loan rate rises
WESTPAC is not alone in hitting its owner-occupier customers with a surprise interest rate rise, as dozens of other variable rate home loans ...

Airbnb upgrades variable pricing tool for hosts
Online home rental group Airbnb is rolling out an upgraded variable pricing tool that automatically raises or cuts room rates based on supply ...

Commonwealth Bank raises variable home loan rates
Home owners' mortgage costs are set to rise by hundreds of dollars a year, after the Commonwealth Bank became the latest bank to hike interest ...

CBA lifts variable home loan rates to offset costs associated with stricter capital requirements
The Commonwealth Bank to lift its home loan interest rates independently of the Reserve Bank to partially offset costs associated with stricter ...

Washington Square Signs Spielbergs, Choi Joins Variable and More
... films and an episode of the HBO comedy series "Girls," on which he plays the role of Ray Ploshansky. New York-based creative collective Variable ...

YouTube v10.32 Tweaks Some Interface Elements And Includes Hints About Virtual Reality Content And Variable ...
Forget Update Wednesday! Monday is the new big day. Not only were we treated to the latest M preview release and the official Marshmallow name, ...

"You have to ignore many variables to think women are paid less than men. California is happy to try." ...
Writes Sarah Ketterer in The Wall Street Journal in "The ‘Wage Gap’ Myth That Won’t Die" (which you can get to without subscribing if you Google ...

Staley: 'A lot of different variables...been a hard year'
... 41° Navigation Home Giants A's Sharks Warriors Kings 49ers Raiders Quakes Insiders More Tickets Shop Watch Staley: 'A lot of different variables...been ...

Expert Reveals the Latest Variable Capacity Technology
Learn about gForce Ultra CRAC equipment, the latest variable capacity technology to lower energy usage and increase reliability.

Resources last updated: 1/22/2016 12:34:07 AM