Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Re sqlexec() and Mysql and alter table. - Alter Cursor
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00501806
Message ID:
00501816
Views:
16
Bob,
Maybe you could use the CAST() T-SQL command? The following examples are against the northwind customer table:
SQLEX(lnSql, "SELECT customerid, companyname FROM customers")
*-- creates the following SPT cursor:
Field  Field Name      Type                Width    Dec   Index   Collate Nulls
    1  CUSTOMERID      Character               5                             No
    2  COMPANYNAME     Character              40                             No
SQLEX(lnSql, "SELECT CAST(customerid AS char(10)) AS CustomerId, CAST(companyname AS char(255)) AS companyName FROM customers")
*-- creates the following SPT cursor:
Field  Field Name      Type                Width    Dec   Index   Collate Nulls
    1  CUSTOMERID      Character              10                            Yes
    2  COMPANYNAME     Memo                    4                            Yes
As you see in the second sample, we forced VFP to create a memo field in the resulting SPT cursor. This is SQL Server, I don't know if this helps in MySQL.

>Can I use alter table on a temp cursor, I need to expand field lengths made by a sqlexec command.
>
>or if not,
>any suggestions, to get a cursor from sqlexec. which has proper field lengths, using Mysql, the data being send back to VFP is trimmed - becuase it stores it trimmed.
>I have tried to change the type of fields on the server to regualr chr(20) instead of varchars() . same result. trimmed results. which dont work all that well for editing.
>
>What I guess I am looking for is the ability to change field widths of cursors or create a new cusror (readwrite) with valus from my old cursor. .. set with proper field widths.?
>
>AM I making any sense. ?
>
>thanks
>Bob Lee
Daniel
Previous
Reply
Map
View

Click here to load this message in the networking platform