| 4D v16ODBC_SQLFetch | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
 | 
    4D v16
 ODBC_SQLFetch 
         | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ODBC_SQLFetch ( stmtID ) -> Résultat | ||||||||
| Paramètre | Type | Description | ||||||
| stmtID | Entier long |   | Statement ID | |||||
| Résultat | Entier long |   | Returns the result of the MS ODBC API function SQLFetch | |||||
The ODBC_SQLFetch command fetches the next rowset of data from the result set and returns data for all bound columns.
stmtID is a valid statement ID returned by ODBC_SQLAllocStmt.
For more information, please see the SQLFetch function in the MS ODBC API Reference at http://msdn.microsoft.com/en-us/library/ms712424(VS.85).aspx.
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_STILL_EXECUTING, SQL_ERROR, or SQL_INVALID_HANDLE.
The following method selects all the records from the Employee table, ccreates a bind with our data source's Employee table and its four fields specified by the ODBC_SQLPrepare and ODBC_SQLBindCol commands, and then creates one record for each row of data in the 4D table [Employees]:
 $result:=ODBC_SQLPrepare($statementID;"SELECT * FROM Employee")
 $result:=ODBC_SQLExecute($statementID)
 
 $result:=ODBC_SQLBindCol($statementID;1;->[Employees]Emp_ID)
 $result:=ODBC_SQLBindCol($statementID;2;->[Employees]Emp_Fullname)
 $result:=ODBC_SQLBindCol($statementID;3;->[Employees]Emp_HireDate)
 $result:=ODBC_SQLBindCol($statementID;4;->[Employees]Emp_CurrentEmployee)
 
 While($result#SQL_NO_DATA)
    CREATE RECORD([Employees])
    $result:=ODBC_SQLFetch($statementID)
    If($result#SQL_NO_DATA)
       SAVE RECORD([Employees])
    End if
 End while
 UNLOAD RECORD([Employees])
 
 $result:=ODBC_SQLFreeStmt($statementID;SQL_UNBIND)
	Produit :  4D
	Thème :  ODBC_Results
	Numéro :  
        16960
        
        
        
	Nom intl. :  ODBC_SQLFetch
	Créé :  4D ODBC Pro 2004
	
	
	
	
	
	
	
	
	
	
	
	
	
	4D ODBC Pro ( 4D v16)
	
	
	
	
	
 Ajouter un commentaire
Ajouter un commentaire