Forum: Managing VoltDB

Post: how to return a string from the stored procedure.

how to return a string from the stored procedure.
Shanky
Oct 24, 2013
Hi,

I have a stored procedure which returns a string like aa,bb,cc

How should i return this from the stored procedure as run method returns long, Long Volttable[] only.

Shanky Goyal
jhugg
Oct 24, 2013
You can embed the String into a one-row/one-column VoltTable like so:

public VoltTable run() {
VoltTable t = new VoltTable(new VoltTable.ColumnInfo("str", VoltType.STRING));
t.addRow("aa,bb,cc");
return t;
}

I haven't actually compiled this, but I think it's mostly correct.