Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

load data from micros sp into table

Status
Not open for further replies.

raphael75

Programmer
Nov 15, 2012
67
US
I would like to load data from the micros.sp_R_sys_menuitem_fam_grp stored procedure into a temporary table so I can run some queries on it. I tried:

SQL:
select
*
into
#t_test_sp
from
micros.sp_R_sys_menuitem_fam_grp();

but I get this error:

Code:
COMMIT/ROLLBACK not allowed within atomic operation

Is there a different way to do this? Thanks!



 
I was able to create a php script that uses dbisql to grab the contents of micros.sp_R_sys_menuitem_fam_grp and save it in a csv. I then was able to load the data into our MySQL database and query it there. It took forever to grab the data (3.2GB!) but it worked.

After that, I copied the contents of the stored procedure to a new one and added this at the top:

SQL:
alter PROCEDURE "custom"."custom_sp_R_sys_menuitem_fam_grp_mdf" ([highlight #CC0000]in business_date_start timestamp,in business_date_end timestamp[/highlight])

and modified these lines:

SQL:
SET @start_business_date = COALESCE(@start_business_date,DATE([highlight #CC0000]business_date_start[/highlight])); -- YEARS(NOW(*),-10)
    SET @end_business_date = COALESCE(@end_business_date,DATE([highlight #CC0000]business_date_end[/highlight])); -- YEARS(NOW(*),10)

and if I call this new SP I can pass in a start and end date. I just tested it and it appears to work.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top