Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MyODBC 3.51 problem
Message
 
 
To
14/03/2003 13:36:30
Juan Carlos Gonzalez F.
Austin Reed Manufacturas - Arturo Calle
Pereira, Colombia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00765567
Message ID:
00765979
Views:
22
This message has been marked as the solution to the initial question of the thread.
What's the reason you are using macro substitution? Try SQLEXEC parameters instead.
lcCustcode = "5571"
lcCustname = "John Doe"
lcLongvar = PADL("TEST",500,"-")
SQLEXEC( h, ' INSERT INTO customers ' + ;
    'VALUES( ?lcCustcode, ?lcCustname , ?lcLongvar ) ' )
BTW, VFP character field size is limited to 254 characters.

>Thanks Sergey, I was wrong about the size limit of VFP char variables, i must say char field limit. My problem is the following:
>
>I'm using MySQL as database server, i sent SQL commands to the server using SQLEXEC, by example:
>
>Case 1 (using variables y less than 256 chars everything works fine)
>
>lcCustcode = "5571"
>lcCustname = "John Doe"
>SQLEXEC( h, ' INSERT INTO customers ;
> VALUES( "&lcCustcode","&lcCustname" ) ' )
>
>
>Case 2 (using a long char variable - i can´t use macro expansion because VFP rejects the lenght of the command)
>
>lcCustcode = "5571"
>lcCustname = "John Doe"
>lcLongvar = PADL("TEST",500,"-")
>SQLEXEC( h, ' INSERT INTO customers ;
> VALUES( "&lcCustcode","&lcCustname","&lcLongvar" ) ' )
>
>...So i decided to write my variables to a text file and then use:
>
>SQLEXEC(h, ' ;
> LOAD DATA LOCAL INFILE "DATA.TXT" ;
> INTO TABLE customers (custcode,custname,comments) ' )
>
>MyODBC 2.5 allowed me to do that, but the new versíon don´t.
>
>I don´t know another way of using SQLUPDATE to pass long variables, do you know how ?
>
>Thanks in advance !
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform