Good day all. I have a table called [SPC] with just one column with column name as (Table name) and 20 rows, each row with its table. I am trying to create a for loop to add two new columns: count of rows for each table, count of column for each table.
I get count of rows for each table using:
nrow(sqlQuery(con,F[1]))
[1] 2500011
nrow(sqlQuery(con,F[2]))
[1] 384098
nrow(sqlQuery(con,F[3]))
[1] 1334394,
and get count of columns for each table as:
ncol(sqlQuery(con,F[1]))
[1] 15
where F[i] is the script that spools table for the ith element.
I have used this 'for loop', but still didnt work, kindly assist me.
for (i in 1:nrow(SPC)){
SPC_TABLE$Count_of_row= nrow(sqlQuery(con,F[i]));
SPC_TABLE$Count_of_column= ncol(sqlQuery(con,F[i]))}
view(SPC)