Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter and PostgreSQL Problem
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00840453
Message ID:
00840675
Views:
25
Hi Leland

Yes I have a field called "desc". I had this error previously when creating the tables and discovered that I needed to put quotes around the field names when using
SQLPrepare(1,[CREATE TABLE "uptable" ("desc" CHAR(30) NOT NULL....

This eliminated the error so I am guessing that the automatic InsertCMD is not putting quotes around the field names and that is the problem. So I assume the only way to fix this is to set value of the InsertCMD property of the cursoradapter instead of allowing autmatic generation.

I will check the ODBC and VFP for the boolean solution. I could also always use the ConversionFunc to solve this problem.

I will check your code examples.

Thanks,
Simon


>Hi Simon
>
>You indicate the error postgresql is returning is [ ERROR: parser: parse error at or near "desc" ]. This would indicate that your sql insert command is not properly parsed, with the error somewhere near "desc". Do you have "desc" somewhere in your insert command?
>
>Postgresql uses a boolean with 0 for false and 1 for true. You are probably using ODBC to connect to postgresql. I'm thinking there is a switch somewhere in VFP that instructs VFP to use a boolean 0 or 1 instead of the .F. or .T., but I cannot remember how to get to the switch.
>
>You can also have something like the following in your insert command to handle the difference between postgresql boolean and VFP's .F. or .T.
>
>the_insert ="insert into psqltable (istaxable) values (iif(is_taxable=.T.,1,0)"
>
>Then use the_insert in your sqlexec() or use something like the sql insert command in your CA.
>
>I have an example app using CA to connect to a postgresql database. It is in a zip file named smsql. It can be downloaded at http://www.smvfp.com. I lost the database which was used to connect to example app and have never re-created it, so all you can currently do is examine the example app for ideas.
>
>LelandJ
Simon White
dCipher Computing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform