Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select doesn't produce an array
Message
 
À
30/10/2008 16:31:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01358484
Message ID:
01358494
Vues:
15
>Given the below:
>
>dbc2Convert = "\\tpdfiles\data\dfreeman\tip\data\rta\rta.dbc"
>aTables = GetDBCTableNames(dbc2Convert)
>for i = 1 to alen(aTables)
>? aTables(i)
>next
>
>**************************************************************************
>function GetDBCTableNames()
>lparameters myDBC
>select objectname as tablename ;
>from (myDBC) ;
>where objecttype = "Table" ;
>into array A1
>return A1
>
>Why do I get an error that says A1 is not an array? The select produces 6 records.
>
>Thanks

Return array is not that simple :o)
You should pass the array as parameter by reference:
DIMENSION laArray[1]
dbc2Convert = "\\tpdfiles\data\dfreeman\tip\data\rta\rta.dbc"
lnTables = GetDBCTableNames(dbc2Convert, @laArray)
for i = 1 to lnTables
   ? aTables(i)
next

**************************************************************************
function GetDBCTableNames(myDBC, laArray)
select objectname as tablename ;
       from (myDBC) ;
where objecttype = "Table" ;
into array laArray
return _TALLY
(that is not tested also) :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform