Hi To All,

I have written this procedure in the primebase scripts folder.

declare procedure ShowPrincipals(oq,pn,sd,ed)
returns varchar;

{

        close database;
        open database "TWCdb";
select WiOnhand len from workingInventory where wiPartNumber = pn and wiLocation = "Portland";
        fetch;
        int BeginningInventory = len;
        print BeginningInventory;
select sum(odQuanOrdered) TotalReserved from OrderDetail, Ordermaster where odPrincPartNum = pn and
        OMTWCOrdNum = ODTWCOrdNum and OMMustShip >= sd and OMMustShip <= ed;
        fetch;
        int NewTotal = (BeginningInventory + TotalReserved) - oq;
        Print NewTotal;
        
        
}
end procedure ShowPrincipals;


Using the Primebase Console, I do the following and get the results just fine.

1:     1> execute file "showprincipals.dal";
 1:     2> showprincipals("15","6800","01/01/2004","01/31/2004");
 1:      > go
 1:      > 56812
 1:      : Done OK.

So it works just great.

However, when I do the same in a DBMS Action:

execute file "showprincipals.dal" in location "/Applications/ PrimeBase_DS.4229/setup/scripts/";
showprincipals("15","6800","2004-01-01","2004-01-31");

(changing the dates to ODBC Style of course)

It executes just fine, but @@resultset returns nothing.

Does anyone know what I need to do do get text to return calling a procedure?

The reason for this is that I have some complex calculations to do, and updating to do, that requires loops and Witango just isn't set up for a long execution of loops. The procedures work great and are lighting fast executed that way.

Thanks for any tips you can pass on.


Mark Weiss
http://trustthechildren.blogspot.com

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to