Variables can only be declared in Java stored procedures. In VoltDB, all complex stored procedures, like the one you are showing here, must be done in Java.
An example of what you want could be something like this:
public class TN extends VoltProcedure {
int kkk = 5;
public final SQLStmt sql1 = new SQLStmt(
"SELECT * FROM XXXX;");
public final SQLStmt sql2 = new SQLStmt(
"SELECT * FROM XXXX WHERE YYYY ='French';");
public VoltTable[] run(int kkk) throws VoltAbortException {
if (kkk < 10) {
voltQueueSQL( sql1 );
return voltExecuteSQL();
} else {
voltQueueSQL( sql2 );
return voltExecuteSQL();
}
}
}
See the Stored Procedures part of the docs for more information:
https://docs.voltdb.com/tutorial/Part5.php
Full disclosure: I work at VoltDB.