Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLEXEC, records not ordered
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01579404
Message ID:
01579409
Views:
42
Hi Naomi

Yes, my table: 1,2,3,4,5...>>Remotely becomes: 1,3,2,4,5... and when I dowload records
back they have no order.

I think problem is in phpmyadmin environment and not VFP or ODBC.

I am solving the problem.

Moises





>>Hi
>>
>>I am uploading data to database via SQLEXEC command, ODDBC, in phpmyadmin, MySQl database.
>>
>>It works, but problem records are not ordered.
>>
>>If my my table: 1,2,3,4,5...
>>
>>Remotely it becomes: 1,2,4,5...
>>
>>As scan commmad treat records one by one, I can not understand why it happens.
>>
>>Code is as below:
>>
>>*******************************************************************
>>
>>SELECT certificados
>>
>>SET ORDER TO 
>>
>>   SCAN FOR cert_pt = 0  AND lib = 1
>>
>>
>>thisform.pageframe1.page1.status.Value = "Enviando certificados...: " + ALLTRIM(Reembolso.cl)
>>
>>Text to cSQL Noshow Pretext 1+2+4+8
>>   
>>   INSERT INTO certificado    
>>                (nome,nome_cert, email,endereco,bairro,cidade,CEP,estado,telefone, CPF,horas,curso,data_curso,dt_pt_cert,code,forma_env )
>>VALUES    (?nome, ?nome_cert,?e_mail, ?end,?bairro, ?cidade,?cep,?est,?telefone, ?cpf, ?horas,?curso,?data_curso,?dt_pt_cert,?cod,?forma_env  )   
>> 
>>  
>>ENDTEXT
>>
>>asa=SQLEXEC(lnHandle,cSQL ) 
>>
>>IF asa = 1
>>
>>replace certificados.cert_pt WITH 1
>>        
>>    DPT = DATE ()
>>
>>SELECT certificados
>>
>>
>>
>>    
>>    
>>    ELSE 
>>    
>>       
>>    return
>>    
>>     ENDIF
>>        
>>     
>>ENDSCAN
>
>So, it looks like row 3 is missing, right?
>
>Also, table is unordered set of rows, so it does not really matter what you get if you do select * from myTable. You should always add ORDER BY at the end if you want to retrieve rows in particular order.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform