cancel
Showing results for 
Search instead for 
Did you mean: 

"Not enough values for host variables" warning from sasql_prepare()

3,218

I'm getting a strange error from the PHP function sasql_prepare().

Most of the time it works fine, but from time to time, usually right after I first start my system, I get the error "Warning: sasql_prepare(): SQLAnywhere: [-188] Not enough values for host variables".

This is a strange error to get from that function since the host variables are actually supplied later with sasql_stmt_bind_param_ex(). If I really have supplied the wrong number of variables, I would expect the error later from sasql_stmt_execute().

If I simply re-issue the same call, it always works.

I'm running Windows7, SQL Anywhere 16.0.0.1948, PHP 5.4.34, and the extension php-5.4.12_sqlanywhere.dll.

Has anyone else seen this?

Thanks, Terry

Accepted Solutions (1)

Accepted Solutions (1)

VolkerBarth
Contributor

There has been a bug fixed in v16.0.0.2007 that has also raised that error right after a started database though it's attributed to ODBC, so I don't know whether that meets your situation. However, trying the newest EBF might be of help.

Cf. the CR note 769156:

    ================(Build #2007  - Engineering Case #769156)================

    Given a simple stored procedure such as the following:
      create procedure sp_test( in @a integer, in @b integer )
      begin
        select @a + @b as c;
      end
    Binding two host variables and executing “SELECT * FROM sp_test(?, ?)" 
    just after starting the database server, then the error "Not enough 
    values for host variables" might have resulted.  Subsequent execution 
    attempts would have succeeded. A similar problem would have occurred when 
    "SELECT * FROM sp_test(?, ?)" was executed immediately after (dropping 
    and then) creating the stored procedure. This has now been fixed.
 
0 Kudos

Thanks Volker.

I didn't know there was a newer EBF; When I click "Help/SQL Anywhere 16/Check For Updates.", Sybase Central reports "You are Up-To-Date There are no updates for your installed software."

Can you please give me a link to the newest EBF?

Thanks, Terry

VolkerBarth
Contributor
0 Kudos

Hm, can't comment on that... Here's a general link how to download EBFs in the new SAP Marketplace - I don't have a particular link for a current EBF at hand (and I still don't feel home in that SAP places, sigh.):

A Guide to Downloading SAP SQL Anywhere Support Packages

0 Kudos

Hmmm. Don't have a support package, just using the free developer version at this time. Guess I'll have to wait and see if they will release the latest fixes to the Developer Edition.

jeff_albion
Product and Topic Expert
Product and Topic Expert
0 Kudos

This issue is also documented in KBA #2052460.

Answers (0)