Stored procedure with count of records

Hi
is there a way to get a records count when calling a stored procedure ? Like an include_count parameter.
As a workaround, the stores procedure returns 2 result sets : one with data, the second with a count of records. My problem is both result set are enclosed in array.
{
“components”: [
[
{
“count”: “1”
}
],
[
{
“ProductNumber”: “code”,
“description”: “description”
}
]
]
}

I would like to have an output like that :
{
“components”: [
{
“count”:1
},
{
“prmsProductNumber”:** “88787GR88” ,
“description”:** “Description of component” ,
}
]
]

Is it possible ?
Thank you
Gael

Hi
i solved my problem by using OUT parameters