Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 1238 - VFP 9

Status
Not open for further replies.

lpgz

IS-IT--Management
Jul 27, 2002
9
US
Hello--I have what seems to be a unique instance of this error. It began occurring in an executable on Monday--having worked fine for several years. Note that it does not occur when running as an app on my local. The data table is on a old Novell network.

INSERT INTO emerge_gist(cAcctID,cContact,cTarget,cGist,cCalltrack,tCallTime,cMsgFile) VALUES (gcAcctID,lstrName,lstrCall,lstrMsg,lcCallTrack,lcCallTime,lcRecFile)

The routine does a simple insert into the table. When the insert is invoked, the 1238 No parameter statement found is displayed. No insert occurs.
In the routine, I have set up a series of wait windows at each step to confirm where I am in the code, and track exactly what statement fails.

I use the table, then display the ALIAS() result in the window, so I know I can open it.
I display the variables being inserted prior to insertion in another window, all good.
I have also tried appending, with the same result.
I checked the Novell permissions on the table. They are set to shrw as they should be.

I reverted to an earlier executable, and it still happens. There is no config.fpw associated with the app, so no help there. I am baffled. Your thoughts?

Thanks!

~Laura
 
I'm looking at your code, and I can't see a space between the emerge_gist and the brackets after it - this MIGHT me interpreted as a function call (like space(8) or whatever).

Can you check that before you get back to us ?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Laura,

Whenever someone says that a program has worked perfectly for years and then suddenly started to give an error, the question is: What has changed?

Something must have changed either in the program itself or the environment or the data or some other aspect of the system. The key to solving the problem is to figure out what has changed.

Having said that, I would add that Griff's idea sounds plausible. If you happened to have a function named emerge_gist(), that would explain the exact error you are seeing.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thanks Mike!

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
IMHO having no space between emerge_gist and opening parentheses doesn't explain it anyway because:
Code:
insert into emerge_gist(...
and:
Code:
insert into emerge_gist (...
are equally the same syntax. That is how VFP works. Likewise VFP ignores the spaces after a function name. ie: alltrim ('Ignoreed spaces ') works as alltrim(...). Even this is valid syntax (yes I accept it is ugly):

Code:
? alltrim  ;
   ('hello    ')

The point is that VFP doesn't decide of it is a fuction call or not depending on the spacing before parentheses. A space is a word boundary in syntax just like a parentheses is.

Having said that and your 'I have also tried appending, with the same result.' statement as a supporting indicator to idea my guess is that someone has changed the table itself. Probably now it is calling a trigger, field or table rule which expects a parameter but fails to get. I would dump the structure using afields() or manually check with modify structure.

PS: Please prefix your memory variables with m. Probably you meant:

Code:
INSERT INTO emerge_gist ; 
 (cAcctID,cContact,cTarget,cGist,;
  cCalltrack,tCallTime,cMsgFile) ;
VALUES  ;
  (m.gcAcctID,m.lstrName,m.lstrCall,m.lstrMsg,;
   m.lcCallTrack,m.lcCallTime,m.lcRecFile)

That by itself is not clear and might be a source of hard to catch bug in code.

Cetin Basoz
MS Foxpro MVP, MCP
 
Cetin is certainly right for calls to functions in the IDE, I tried ? Replicate("a",8) and ? Replicate ("a",8) and they worked fine.

I would like to CLAIM I meant what Mike said, but I was going for the space!

B-(

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Yep--the space doesn't matter, but in the spirit of good housekeeping I did insert it.
To add some complexity, the insert does occur on 1/20 or so requests. Since I posted this I have replaced the table with a 2.6 version, and then a clean 9.0 version, reverted the exe to a known good one (from Jan), compiled and recompiled the apps that are called from the exe. It usually works when I run the app from my computer as the call center agents do, but rarely works when they run it from their workstations.

~Laura

 
Laura,

OK, let's have a closer look.

The message "No parameter statement found" usually occurs when you are calling a procedure or function, and you are passing one or more parameter, and either the called procedure or function does not have a PARAMETERS (or LPARAMETERS) statement in its first line, or it does have such a statement, but the number of parameters listed is fewer than the number you are passing.

Now, since you are doing an INSERT into a table, this would appear to have nothing to do with functions or parameters.

So, are you sure the error is actually happening on the INSERT? Have you got an error-handler which tells you which line of code caused the error? Is it possible that the error occurred on some other statement?

If you are certain it's the INSERT, it is possible that the table has a trigger? If so, could there be some code in the trigger that could be causing the problem?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Use

Code:
do home()+'tools\gendbc\gendbc'

and select your database. Creating the programmatic version of your database you can spot the routine that is called with a parameter. It is likely a default, check or trigger function.



Cetin Basoz
MS Foxpro MVP, MCP
 
Hi again--yes, I have an error handler that shows that it is in fact the INSERT statement. And the APPEND BLANK I tried as well. There are no triggers on the table, in fact, I even converted it to a 2.6 table to see if that would make a difference in the behavior, and it didn't.
You asked what has changed, always the right question! :) I am updating the app to use MySQL instead of VFP tables. In this phase, I am updating both data types. The MySQL INSERT follows the VFP and it works fine.

~Laura
 
If append blank is causing an error then it IS a table property be it an index expression, default, check, trigger or whatever. Did you do gendbc thing? Would you give that table's generation code (as well as its indexes).

Cetin Basoz
MS Foxpro MVP, MCP
 
By the way a corrupted index might be causing errors that cannot be explained.

Cetin Basoz
MS Foxpro MVP, MCP
 
I am updating the app to use MySQL instead of VFP tables. In this phase, I am updating both data types. The MySQL INSERT follows the VFP and it works fine.

Even though the MySQL update is working, I'd suggest you temporarily remove it to see if the problem goes away. If it's true that the addition of MySQL is the only thing that's changed, then that must surely be a prime suspect.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Cetin--the table is not in a database, so gendbc() isn't applicable. Also, I created a new table and built a new index to ensure that it wasn't data related.
And Mike, I took out the MySQL (even though it occurs after the VFP INSERT) and it didn't help.
I do appreciate all the suggestions, though!

~Laura
 
Could one of the memory variables being inserted be a .NULL. value? That's one thing I would imagine, just my shot-in-the-dark wild guess outside the focus of my expertise, to trigger "no parameter"?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top