Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wrong numeric field size from SQLEXEC() call
Message
From
12/12/2005 15:15:04
 
 
To
12/12/2005 13:40:49
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01077250
Message ID:
01077278
Views:
46
Hi,

you can use SQLEXECEX from VFP2C32, or a CursorAdapter object.
cConnString ="DRIVER={PostgreSQL Unicode};DATABASE=postgres;"+ ;
   "SERVER=127.0.0.1;PORT=5432;UID=postgres;PWD=x;B9=0"
nconnh=SQLSTRINGCONNECT(cconnstring)
TEXT TO csql
CREATE table test ( test char(1));
insert into test values ('');
select 0 AS someField from test
ENDTEXT

IF SQLEXECEX(nconnh, csql,'','',0,'someField N(1)') < 0
  AERROREX('laError')
  DISPLAY MEMORY LIKE laError
  RETURN
ENDIF

SELECT sqlresult
DISPLAY STRUCTURE TO FILE t
MODIFY FILE t

&& cursoradapter approach

loCA = CREATEOBJECT('CursorAdapter')
loCA.SelectCmd = csql
loCA.CursorSchema = 'someField N(1)'
loCA.CursorFill(.t.)
.....
Regards
Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform