Home » Developer & Programmer » Forms » How to know from which input device data is entered into application (oracle 9.2.0.8.0, forms 6.9.8.22.1)
icon7.gif  How to know from which input device data is entered into application [message #432921] Fri, 27 November 2009 05:38 Go to next message
shashikoor
Messages: 25
Registered: April 2006
Location: india
Junior Member
Hi,

Is there any way to know from which input device data is entered into froms 6i application.

We are supporting point of sales (retail domain)application .

Normally items will be scanned through bar code scanner at teh time of biling.

Some times when items will not get scanned cashiers enter the barcode data through key board.

We want to capture those bar codes which are entered though key board.

Can you please help?

thanks,
shashanka.

[3 topics MERGED by LF]

[Updated on: Fri, 27 November 2009 07:17] by Moderator

Report message to a moderator

icon7.gif  how to know from which input device data ia enetred into application [message #432922 is a reply to message #432921] Fri, 27 November 2009 05:42 Go to previous messageGo to next message
shashikoor
Messages: 25
Registered: April 2006
Location: india
Junior Member
Hi,


I there asny way to capture the input device from which data is entered?

Like some times data will be entered through barcode scanners , key boards or any other device.


Can any body healp on this?


thanks,
shashanka
how to know whether the input is given through keyboard or any other device like bar code [message #432923 is a reply to message #432921] Fri, 27 November 2009 05:46 Go to previous messageGo to next message
shashikoor
Messages: 25
Registered: April 2006
Location: india
Junior Member
Hello ,

is there any way to know whether the input is given through keyboard or any other device like bar code scanner in oracle9i/forms 6i application.

I am a IT team member in an organization which is into retail business.

The above question is one of the requirements to capture how many times a particular bar code is captured manually through key board rather than bar code scanner.

Thanks in advance,
shashanka.
Re: how to know whether the input is given through keyboard or any other device like bar code [message #432934 is a reply to message #432923] Fri, 27 November 2009 07:21 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
From Forms point of view, I'd say that this is not possible. Barcode scanner is attached to keyboard cable and Forms can't distinguish whether someone has typed those characters or you have read them with a scanner. (It reminds me of how to know whether you have typed that with your left or right hand?).
Re: how to know whether the input is given through keyboard or any other device like bar code [message #648357 is a reply to message #432934] Mon, 22 February 2016 03:22 Go to previous messageGo to next message
siva_1959
Messages: 2
Registered: February 2016
Location: INDIA
Junior Member
How to distinguish a data captured in a form is from manual input or barcode scanner interface.

Usually barcode scanner is used for capturing data in a form like Library, Departmental store applications etc.

The User sometimes makes a manual key-in data for the field or data captured through barcode interface. The manual entry may be wrong due to human errors but barcode scanner interface will be right always. So it is necessary to differentiate in the programming level itself and make necessary field to insert data in the underlying table.

To distinguish the data whether it is from manual entries or barcode scanner the following procedure has been followed in oracle forms6i and achieved the result.

WHEN-NEW-ITEM-INSTANCE
Begin
select to_char(sysdate,'HH:MM:SS') into :global.cursor_in_time from dual;
end;

KEY-NEXT-ITEM
Begin
select to_char(sysdate,'HH:MM:SS') into :global.cursor_out_time from dual;
end;

In the Save Button as you designed :
-------------------------------------------

WHEN_BUTTON_PRESSED
--------------------------------------
Declare
data_passing_from_time number(5) := 0; -- in seconds
data_passing_to_time number(5) := 0; -- in seconds
passing_duration number(5) := 0; -- in seconds
usr_id varchar2(20) := null;

Begin
if :system.form_status = 'CHANGED' then
--
-- Conversion to Hours to Minutes + Minutes and total Minutes to Seconds + Seconds ..
--
data_passing_to_time := ((to_number(substr(:global.cursor_out_time,1,2)) * 60) +
to_number(substr(:global.cursor_out_time,4,2))) * 60) +
to_number(substr(:global.cursor_out_time,7,2));

data_passing_from_time := ((to_number(substr(:global.cursor_in_time,1,2)) * 60) +
to_number(substr(:global.cursor_in_time,4,2))) * 60) +
to_number(substr(:global.cursor_in_time,7,2));
--
-- Now we can get the passing duration in Seconds of the Scanner / Manual Entry.
--
passing_duration := data_passing_to_time - data_passing_from_time;
--
-- If you want to see the passing duration, put in message .. other-wise put -- before message ..
--
message('Passing Duration : '|| passing_duration||' secs');
--
-- We can conclude the data read by the Scanner would be 1 or 2 seconds
-- otherwise we could easily conclude the data entered by manually.
--
select user into usr_id from dual;
:USER_ID := usr_id||'-'||passing_duration||' secs';
commit_form;
--
-- The information saved into the concern database for later use.
--
end if;
end;

Re: how to know whether the input is given through keyboard or any other device like bar code [message #648359 is a reply to message #648357] Mon, 22 February 2016 03:45 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Welcome to the forum.
Please read and follow How to use [code] tags and make your code easier to read?

What happens if the user enters the field hits a single key followed by tab? That'll take 1 second.

The passing_duration calculation can be more simply written as:
passing_duration := (to_date(:global.cursor_out_time, 'HH:MI:SS') - to_date(:global.cursor_out_time, 'HH:MI:SS')) * 24 * 60 * 60

Assuming you fix the WNII and KNI triggers to use the format mask for minutes (MI), rather than months (MM).
Or you could create a couple of non-database datablock items set to date datatype and skip the conversions altogether.
Re: how to know whether the input is given through keyboard or any other device like bar code [message #648360 is a reply to message #648359] Mon, 22 February 2016 03:46 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Also what happens if user uses the bar-code scanner but then tabs back through the field before saving?
Re: how to know whether the input is given through keyboard or any other device like bar code [message #648907 is a reply to message #648359] Mon, 07 March 2016 02:57 Go to previous message
siva_1959
Messages: 2
Registered: February 2016
Location: INDIA
Junior Member
Thank you.
Previous Topic: Please Help : Creating dynamic Menu
Next Topic: How to clear form/block in item level triggers?
Goto Forum:
  


Current Time: Thu Mar 28 23:42:25 CDT 2024