Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
My SQLPREPARE is erroring out!
Message
 
 
À
26/02/2002 12:23:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00625241
Message ID:
00625246
Vues:
11
This message has been marked as the solution to the initial question of the thread.
The lenght of the string literal in VFP is limited to 255 characters. Split it into multiple parts.
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 " + ;
...
>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
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform