I'm attempting to load the result set from the sa_disk_free_space system stored procedure so that I can manipulate it and present it in MB. Below is what I have so far. BEGIN DECLARE LOCAL TEMPORARY TABLE varMoveToSQL (mydbspace_name nvarchar(20), myfree_space int, mytotal_space int); WITH Dataset (dbspace_name,free_space,total_space) AS ( EXEC sa_disk_free_space ) INSERT INTO varMoveToSQL SELECT * FROM Dataset; SELECT * FROM varMoveToSQL; END |
It is way easier with SQL Anywhere. You can simply use a stored procedure in the FROM clause of a SELECT or INSERT, no need to store the procedure's result set in a temporary table. Just something like "select * from my_proc(params) sp where..." answered 01 Mar '19, 15:09 Volker Barth ...for example: SELECT * FROM sa_disk_free_space(); If you really want a separate local temporary table... SELECT * INTO #varMoveToSQL FROM sa_disk_free_space();
(02 Mar '19, 09:03)
Breck Carter
Thanks for the quick response. That's exactly what I needed.
(04 Mar '19, 09:26)
dangris
|