Link to home
Start Free TrialLog in
Avatar of Shehzad
Shehzad

asked on

Host command not working/ printing data without commit/ slow working

hi ,
Recently i installed a fresh copy of oracle on my clients system but the problem is that the host command is not working

The next question is the suppose there is a system on cash sale counter and a slip is printed on commit of every sales the problem is the it takes about four seconds for the slip to start printing as it first starts the report background engine and then formats / processes the report . is there a way to speed up this process i.e can i print the slip without running a report ( the sales form is master-detail) further is it ok that i am tracking the current stock through views from all the transaction tables i.e purchase, sales ,returns,etc.

how can i speed up the populating of a record group made through these views as it take about 3 sec to populate the list ( populating for validation of qty as it cannot be greater than stock

please help me out sorry for asking many questions in one posting
Avatar of venkotch
venkotch

Shehzad,
  If your client is Windows system, and host() doesn't work, I would suggest to use DDE.App_Begin (forms build-in) instead of host(). Read more about it in the Forms help.
  I used to do printing of slips and really it is slow if you want to run a report for each single one. Instead I have created a text file, formatted by the form with all offsets and spaces needed. Then with the "copy filename lpt1:" command, where lpt could be any valid printer port it prints fast. The copy command could be also executed through app_begin('command.com /c copy filename printer_port')
  About the record group - the speed depends on the indexes you have, but if the list is long it still will take a while. So, try to limit the list rows by effective (dynamic) where clause. I don't know what is the business case, but I think instead of lists you can use direct validation with select statements/cursors etc. against the tables you have. Also analyze the performance of the view - look at the joins you have, build the appropriate indexes. You can also use materialized views if/where appropriate. If you give more details of what you're doing and want to do, you will get more detailed answers at this forum.

Venko
Avatar of Shehzad

ASKER

can you provide some detail on the text file printing and sending data to it ( one master and many detail records).
*****if possible ******



Speed:
======
the scenerio is that a view is made from 6 tables through which the stock in hand is calculated (it returns item_code (multiple) and the calculate record , and then  another view is created which sums the qty returned from the previous view (select item_code, sum(stock_qty) from stk group by item_code) , finally i am populating a record group from the above view to query all records.
ASKER CERTIFIED SOLUTION
Avatar of venkotch
venkotch

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shehzad

ASKER

thanks for the script

as for the record group if i dont populate each time how can i validate the stock
i.e. a item not in stock cannot be sold
how do you use a record group to validate somenthing - through the LOV or you have a special logic? You can just validate your item using a cursor:

Function Is_Item_In_Stock(p_item in datatype) Return Boolean is
cursor
  c_item_in_stock(p_item_id in number) is
    select count(*) --or whatever
      from VIEW_ITEMS_IN_STOCK
     where item_id = p_item_id
       and date_valid >= .....;
begin
  open c_item_in_stock;
  fetch c_item_in_stock into v_cnt;
  close c_item_in_stock;

  if c_cnt = 0 then
     Return False;
  else
     Return True;
  end if;
end Is_Item_In_Stock;
Avatar of Shehzad

ASKER

Thanks And sorry for the delay in point awarding

regards,

Shehzad