General information
Title:
My SQLPREPARE is erroring out!
I have a VFP 6.0 application that runs as a front end against an Oracle database. I am getting an error message when running the following SQLPREPARE line:
**************************
SQLPREPARE (nSQLConnection, ;
"INSERT into mpd_laue_primary ;
(item_no, mold_no, mold_pos, operation_code, trace_id, ;
create_date, create_time, display_seq, inspector_id, ;
disposition_code, read_alpha, read_beta, read_gamma, ;
read_delta, orientation_actual);
VALUES ;
('"+pnItemNo+"', ?pcMoldNo, ?pcMoldPos, ?lcPriOperationCode, ;
?lcMold, trunc(sysdate), to_char(sysdate, 'HH24:MI:SS'), ;
?lnPriDispSeq, ?lnInspectorIDPrimary, ?pcDispCode, ;
?lnAlpha, ?lnBeta, ?lnGamma, ?lnDelta, ?lcMatch)")
nReturn = SQLEXEC (nSqlConnection)
**************************
The error message I'm getting is the following:
**************************
Error #: 36
Message: Command contains unrecognized phrase/keyword.
**************************
I know the problem is with ORIENTATION_ACTUAL (which is a char field) because when I replace that field name with another CHAR field in the table (see query below), my SQLPREPARE and SQLEXEC go through with no problems what-so-ever:
Good Query:
**************************
SQLPREPARE (nSQLConnection, ;
"INSERT into mpd_laue_primary ;
(item_no, mold_no, mold_pos, operation_code, trace_id, ;
create_date, create_time, display_seq, inspector_id, ;
disposition_code, read_alpha, read_beta, read_gamma, ;
read_delta, comments);
VALUES ;
('"+pnItemNo+"', ?pcMoldNo, ?pcMoldPos, ?lcPriOperationCode, ;
?lcMold, trunc(sysdate), to_char(sysdate, 'HH24:MI:SS'), ;
?lnPriDispSeq, ?lnInspectorIDPrimary, ?pcDispCode, ;
?lnAlpha, ?lnBeta, ?lnGamma, ?lnDelta, ?lcMatch)")
nReturn = SQLEXEC (nSqlConnection)
**************************
The only thing I can think of is that field name, "orientation_actual" is too long for Fox to handle. But there are other fields in the database (such as "dispositon_code") that are almost as long and Fox has no problems.
I am baffled by this one. Any ideas and/or suggestions would be greatly appreciated!
Thanks,
Joe
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only