CTS Based Simple Bike Speedometer - Problem with CTS Pulse
Everytime a magnet rotates, a sensor sends a CTS signal...I know the hardware works, as it works with another Speedometer writen with Delphi (Spinner on SourceForge). However, my program is getting the right speed, then numbers way too big for about three pulses, the right speed, garbage again, etc.... I'm assuming there is something about the CTS protocol and how the Java program needs to respond to a CTS event that I'm not getting. Or could it be my use of systemtime?
Here's code snippets.....
Oh, and I'm using DSR for cadence, and RI for heartrate, any similar issues that I need to be aware of using them?
Thanks
serialPort = (SerialPort)portID.open("IntervalTrack", 0);
serialPort.setSerialPortParams(9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
serialPort.addEventListener(this);
serialPort.notifyOnDSR(true);
serialPort.notifyOnCTS(true);
serialPort.notifyOnCarrierDetect(true);
serialPort.notifyOnRingIndicator(true);
serialPort.notifyOnDataAvailable(true);
serialPort.setDTR(false);
serialPort.setRTS(true);--- snip ----
public void serialEvent(SerialPortEvent e) {
System.out.println(e.getEventType());
switch (e.getEventType())
case SerialPortEvent.CTS:
doCTS();
break;
case SerialPortEvent.DSR:
doDSR();
break;
case SerialPortEvent.RI:
doRI();
break;
private void doCTS(){
double dblSpeedT2 = System.currentTimeMillis();
double dblDeltaSpeedTime = dblSpeedT2 - this.dblSpeedT1;
//todo resolve divide by zero if (dblDeltaSpeedTime == 0.0)
// dblDeltaSpeedTime = 1;
this.dblSpeedKmPerHour = 3.6 * this.getWheelSizeInMM() /
dblDeltaSpeedTime;
this.dblSpeedT1 = dblSpeedT2;
}
Just for future reference if someone googles this unanswered question (so much for Java forums help.....).
The problem was that I needed to distinguish between the evt. changing from true to false and only computing for one or the other. So if it was false I computed, if it was true I continued. (err....or was it the other way around?) either way, thats the fix.....not sure on the why of this though..
Similar Messages
-
In Delayed Pulse Generation vi,Problem With THE PULSE WIDTH??
In Delayed Pulse Generation vi, I want to input a very low number for the Pulse Width while using an external timebase source. But the minimum pulse width has to be 2. Does anyone know how can I solve this problem??
Hey 45,
Unfortunately, there is no way to generate a pulse width smaller than 2x your external timebase.
There is an option to create a pulse of arbitrary width of your external source if you can afford some software processing in between. What you can do is use 1 counter to measure how many source edges of your card's internal timebase (80 MHz for TIO only, 20MHz or 100kHz for TIO and STC) your external signal is. This uses pulse width measurement as the counter application. Once you know how many source edges it takes to represent your pulse, then you can use triggered pulse generation and use the internal timebase with the pulse specs set to create the exact pulse width you want (and delay) and you can use your external pulse as the trigger. Th
is works well if your pulse is always the same width and you can measure it before hand. As an example, let's say your pulse is 20 internal timebase pulses when measured. This means you can use the pulse specs to specify a pulse width of 0.75 your pulse width by using only 15 internal timebase edges for your pulse width.
I don't know if I was clear above or not but if you give me your exact application you are looking to achieve, I might be able to help you out. Hope that helps.
Ron -
Apex form based on a table problems with ID column
Hi all,
Am going round and round in circles trying to get this to work and i'm not getting anywhere fast.
Trying to get a form to process an single row insert into a table.
Using Automatic Row Processing to insert, the pk column page item is hidden and protected.
I would like to put the source of the PK (hidden and protected) item to be the next value of my sequence:
CREATE SEQUENCE "MODULEFEEDBACKID_SEQ" MINVALUE 1 MAXVALUE 99999 INCREMENT BY 1 START WITH 196 NOCACHE NOORDER NOCYCLE
/But I can't manage to get it to work.. every time i try to submit the page it just says "ORA-01400: cannot insert NULL into ( table )"
Any ideas?!
Thanks in advance
Ashleighwhen you create the form you said that the sequence is associated to pk? i think not
then you can create a trigger that set the pk and in the mru return the value of the pk to the item associated with the pk
or recreate the form with wizard and set the sequence to the pk there -
Problem with the Pulse With Measurement with FP-CTR-502
I use a sensor that outputs a PWM-signal (10 Hz; "normal": Duty Cycle 20% (20 ms high, 80 ms low); high = 6 V, low = 0.5 V).
The sensor is connected to the Gate Input Channel of the FP-CTR-502 with an external supply voltage (Vsup) of 5 V.
I tried to measure the pulse width with the "Pulse_Width_Measurement_with_FP-CTR-50x.vi".
I know, that (due to the specifications) the FP-CTR-502 registers an ON
state when Vin is 2 or lower and an OFF state when Vin is 3 or higher -
which means that the measurement would be "upside down".
But my problem is that the (measurement-)results of the VI vary from
0.03 to 1.8 (without the presents of the substance that should be
measured!).
Does anyone know what the problem might be?I can answer this question myself!
The answer is in the *OLD* version (July 2000) of the operator's manual for the FP-CTR-502. For some reason, this has been removed from the latest version (June 2003).
See page 11 of this link for more information:
http://www.ni.com/pdf/manuals/322660a.pdf
Christopher Farmer
Certified LabVIEW Architect
Certified TestStand Developer
http://wiredinsoftware.com.au -
Problems with sound (pulse audio) configuration
My sound system is somehow not working properly. Only one playback at a time is working. Either flash player, a media player, a game. But never both at the same time. I want to use Cinnamon + Pulse Audio. I don't know what I need to install to get it working (pulseaudio, also, oss, ....) I assume the problem is that I installed several sound systems at the same time.
Could you be so nice and help me to determine and fix the problem? I have no clue where to start. I read the appropriate Wiki articles but I'm not sure what exactly I need to do. All I want is a working and autostarting/respawning pulse audio ...
Thank you in advance!
Last edited by cRaZy-bisCuiT (2014-04-27 17:27:26):: Installation fortsetzen? [J/n] n
[crazy@tuxgaming ~]$ pidof pulseaudio
1481
[crazy@tuxgaming ~]$ fuser -v /dev/snd/*
Specified filename /dev/snd/by-path is not a mountpoint.
Specified filename /dev/snd/controlC0 is not a mountpoint.
Specified filename /dev/snd/controlC1 is not a mountpoint.
Specified filename /dev/snd/hwC0D2 is not a mountpoint.
Specified filename /dev/snd/hwC1D0 is not a mountpoint.
Specified filename /dev/snd/hwC1D1 is not a mountpoint.
Specified filename /dev/snd/hwC1D2 is not a mountpoint.
Specified filename /dev/snd/hwC1D3 is not a mountpoint.
Specified filename /dev/snd/pcmC0D0c is not a mountpoint.
Specified filename /dev/snd/pcmC0D0p is not a mountpoint.
Specified filename /dev/snd/pcmC0D1c is not a mountpoint.
Specified filename /dev/snd/pcmC0D1p is not a mountpoint.
Specified filename /dev/snd/pcmC0D2c is not a mountpoint.
Specified filename /dev/snd/pcmC1D3p is not a mountpoint.
Specified filename /dev/snd/seq is not a mountpoint.
Specified filename /dev/snd/timer is not a mountpoint.
So this is the trouble?! What to do now? -
MOVED: [AthlonFX] problems with flashing MS-6593 (KT3 Ultra2-C)
This topic has been moved to AMD SocketA based board.
[AthlonFX] problems with flashing MS-6593 (KT3 Ultra2-C)Quote from: Tiresmoke on 19-August-05, 01:48:32
I guess you think your Athlon XP CPU is a 64 bit huh?
LOL Post moved...
It's my first time at this forum. I just saw AMD, VIA. Sorry I didn't pay attention!
Quote from: osnavi on 19-August-05, 01:59:22
What do you need to upgrade your Mobo Bios for ? Do you have any problem running your KT3 Ultra 2 ?
I have some problems with driving games (GTR & GPL from SimBim and RBR) and I saw that there
was a fix for 2400+ processors in one BIOS! I couldn't find anybody with the same problem, so I think
this could be it! Otherwise everything works OK!
Fredrik thanks for the link... -
MOVED: Installation Problems with PM8M2-V
This topic has been moved to Intel P4 & Celeron P4 based board.
Installation Problems with PM8M2-Vport 1. I did try it on port 2. The odd thing is that this mobo is the first that I have seen where SATA is not recognized in the BIOS setup.
I did solve the problem, though. I bought a Via chipset mobo from a different manufacturer. I was tired of spending hours on this project and the fact that MSI tech support told me that it was Microsoft's problem was no help. I didn't want to create a separate drive image of this one mobo. The fact is that MSi created a mobo that required loading additional drivers for SATA to be recognized- I have not worked with any other manufacturer who required additional drivers loaded to work with SATA (a drive standard).
The new mobo fired right up, recognized the SATA, and I was able to Sysprep the PC in no time. Case solved! -
APEX - Problem with column attributes - Simple Checkbox
Hi,
I've a problem with one of my report.
select * from (
SELECT
APEX_ITEM.CHECKBOX(2,audsid,'UNCHECKED') KILL,
INST_ID,
AUDSID,
SID,
I changed the attributes one of the column in report to Simple Checkbox. Display is working fine and I see correctly checkbox inside the column, but when I trying to trigger process which is based on that column, I'm getting below error:
wwv_flow.accept: SIGNATURE (parameter names) MISMATCH
VARIABLES IN FORM NOT IN PROCEDURE: F01_NOSUBMIT
NON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM:
Process code looks like below:
BEGIN
FOR i IN 1..APEX_APPLICATION.G_F02.count
LOOP
rec_audsid := APEX_APPLICATION.G_F02(i);
stmt...
stmt...
Could you pls help me with this? How I can submit correctly data to my process from that Simple Checkbox item?
Thank in advance for help.
Regards
Mariusz
Edited by: user8763881 on 17-Aug-2010 08:12
Edited by: user8763881 on 17-Aug-2010 08:12
Edited by: user8763881 on 17-Aug-2010 08:12Hi Marc,
I am trying to use this simple check box to update records in a tabular form that is created through tabular form wizard.
Now as what you said I included one more column in the tabular form sql query for my check box column.
Lets say, if my table column name is sent_msg_ind then I have this included as below
select sent_msg_ind, --hidden
sent_msg_ind as sent_msg_ind_no_submit --simple check box
from table_x;Now how to propogate the value of simple check box(1 - checked and 0 - unchecked) value into hidden field.
I am using this tabular form to just update the records based on what is being fetched using the primary key from the previous page.
Any example or demo would be highly appreciated here.
Thanks,
Teku
Edited by: Teku on May 19, 2011 10:05 AM -
Problem with 2 View Objects based on One Entity -Probably a Bug in ADF BC
Hi
I am using JDeveloper 10.1.3(SU5) and adf faces and ADF BC and to explain my problem I use HR schema.
First, I created 2 view objects based on countries table named as TestView1 and TestView2. I set TestView1 query where clause to region_id=1 and TestView2 query where clause to region_id!=1 in the view object editor and then I created 2 separated form on these 2 view objects by dragging and dropping from data control palette.
Now when I insert a record in the form based on TestView1 with region_id set to 1 and commit the record and go to the next form I can see the record in the second form which is completely wrong since it is against the where clause statement of the second form.
I am really confused and the situation is very wired and it seems to me something like bug in adf bc.Am I right.Is there any work around or solution for solving this problem.
Any help would be highly appreciated.
Best Regards,
NavidDear Frank,
Thank you very much for your quick response.
Reading your helpful comments now I have some questions:
1- I have commited the record in the database so shouldn't the query of view objects be re-queried?
2- We try to use ClearVOCaches (entity_name,false) in afterCommit of the base entity object but unfortunately it does not work correctly. after that,We got root app module and used findViewObject method to find all the view of that entity (we have found them by using name not automaticlly) and called executeQuery of all views. From my point of view it has 2 big disadvantages. First suppose that this entity is an important entity and 4 or 5 viow objects are based on it. Now, For inserting one record we should re-execute 4 or 5 view which I think makes some performance issues. Besides, If during the development one programmer add a new view object based on this entity and don't add the executeQuery in the afterCommit for this view, again we have the same problem. Isn't there at least a way that automatically refresh all related view objects however the performance issue still exists.
3- You mentioned that this issue is handled in the developer guide. Could you kindly give me a refrence which developer guide you mean and which section I should read to overcome this problem.(I have ADF Developer's Guide for Forms/4GL Developer's Guide , however I search for clearVOCaches and surprisingly nothing was found!!!)
4- Could you please give me some hints that from your point of view what is the best method to solve this problem with minimum performance effect.
Any comment would be of some great help.
Thanks in advance,
Navid -
Problems with a simple stop watch program
I would appreciate help sorting out a problem with a simple stop watch program. The problem is that it throws up inappropriate values. For example, the first time I ran it today it showed the best time at 19 seconds before the actual time had reached 2 seconds. I restarted the program and it ran correctly until about the thirtieth time I started it again when it was going okay until the display suddenly changed to something like '-50:31:30:50-'. I don't have screenshot because I had twenty thirteen year olds suddenly yelling at me that it was wrong. I clicked 'Stop' and then 'Start' again and it ran correctly.
I have posted the whole code (minus the GUI section) because I want you to see that the program is very, very simple. I can't see where it could go wrong. I would appreciate any hints.
public class StopWatch extends javax.swing.JFrame implements Runnable {
int startTime, stopTime, totalTime, bestTime;
private volatile Thread myThread = null;
/** Creates new form StopWatch */
public StopWatch() {
startTime = 0;
stopTime = 0;
totalTime = 0;
bestTime = 0;
initComponents();
public void run() {
Thread thisThread = Thread.currentThread();
while(myThread == thisThread) {
try {
Thread.sleep(100);
getEnd();
} catch (InterruptedException e) {}
public void start() {
if(myThread == null) {
myThread = new Thread(this);
myThread.start();
public void getStart() {
Calendar now = Calendar.getInstance();
startTime = (now.get(Calendar.MINUTE) * 60) + now.get(Calendar.SECOND);
public void getEnd() {
Calendar now1 = Calendar.getInstance();
stopTime = (now1.get(Calendar.MINUTE) * 60) + now1.get(Calendar.SECOND);
totalTime = stopTime - startTime;
setLabel();
if(bestTime < totalTime) bestTime = totalTime;
public void setLabel() {
if((totalTime % 60) < 10) {
jLabel1.setText(""+totalTime/60+ ":0"+(totalTime % 60));
} else {
jLabel1.setText(""+totalTime/60 + ":"+(totalTime % 60));
if((bestTime % 60) < 10) {
jLabel3.setText(""+bestTime/60+ ":0"+(bestTime % 60));
} else {
jLabel3.setText(""+bestTime/60 + ":"+(bestTime % 60));
private void ButtonClicked(java.awt.event.ActionEvent evt) {
JButton temp = (JButton) evt.getSource();
if(temp.equals(jButton1)) {
start();
getStart();
if(temp.equals(jButton2)) {
getEnd();
myThread = null;
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new StopWatch().setVisible(true);
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel1;
// End of variables declaration
}Although I appreciate this information, it still doesn't actually solve the problem. I can't see an error in the logic (or the code). The fact that the formatting works most of the time suggests that the problem does not lie there. As well, I use the same basic code for other time related displays e.g. countdown timers where the user sets a maximum time and the computer stops when zero is reached. I haven't had an error is these programs.
For me, it is such a simple program and the room for errors seem small. I am guessing that I have misunderstood something about dates, but I obviously don't know.
Again, thank you for taking the time to look at the problem and post a reply. -
View with columns based on function - problem with query
Hi,
I'm using Oracle 9i;
I've created a view which has columns based on a table columns (multiple columns from 1 table) and funtion (multiple columns based on 1 function).
The function takes ID as the first argument and name of the column to determine which value to return as the second one.
Here is a sample of such function (simplified):
FUNCTION my_function
(in_id IN NUMBER, in_col_name IN VARCHAR2)
RETURN VARCHAR2
IS
c_name VARCHAR2(100);
c_last_name VARCHAR2(100);
BEGIN
SELECT T.NAME, T.LAST_NAME
INTO c_name, c_last_name
FROM TABLE_1 T, TABLE_2 Z
WHERE T.PK = Z.FK
AND Z.ID = in_id;
IF in_col_name = 'NAME' THEN
RETURN c_name;
ELSIF in_col_name = 'LAST_NAME' THEN
RETURN c_last_name;
END IF;
END;
For simplicty I've restricted the number of columns.
CREATE OR REPLACE VIEW my_view
(ID, NAME, LAST_NAME)
AS
SELECT
T.ID ID
,CAST(my_function(T.ID,'NAME') AS VARCHAR2(100)) NAME
,CAST(my_function(T.ID,'LAST_NAME') AS VARCHAR2(100)) LAST_NAME
FROM TABLE T;
There is no problem with query:
SELECT * FROM my_view;
The problem arises when I query the view (regardles of '=' or 'LIKE'):
SELECT * FROM my_view
WHERE name LIKE '%some_part_of_name%'
The query returns rows for same names, for same it doesn't. If I put '=' and the whole name the query returns nothing, but when I put 'LIKE' and the first letter it returns rows in some cases.
I've tried to debug this situation and I've discovered that the function recives ID not in the proper order and not the same amount of times - in explicit:
for each ID in (1, 2, 3, 4, 5, 6, ... , 100) the function should be called twice for each ID and in the same order, but it does not.
I get 1, 1, 2, 3, 3, 6, 20, 20 and so on.
Help needed.
Greetings.The problem is more complicated than the solutions provided here.
The reason why I'm using the function is this:
the original view was constructed using multiple union all selects and the speed was terrible. I've created the index on the base table to obtain a proper sort. For retriving all records at once the view works perfectly, but if one wants to query by columns based on function the results are suprisng - sometimes there are, some times there are none, or if you serch with "like" and only a part of string there are results, but with "=" there are no results.
Here are real DDLs:
View:
CREATE OR REPLACE VIEW V_DOK_ARCH
(ID_ZDAR, TYP, STAN, DATE_CREATED, CREATED_BY,
DATE_MODIFIED, MODIFIED_BY, SPRA_ID_SPRA, PODM_ID_PODM, PODM_UMOW_ID_UMOW,
NR_WFS, WFS_NR_INTER, UWAGI_OPER, FUNDUSZ, NUMER,
DATA_PODPISANIA, RODZAJ, TYP_PRZY, TYP_UBEZ, NAZWISKO,
IMIE, IMIE_OJCA, NAZWA_FIRMY, NAZWA_FIRMY_SKR, DANE_KLIE)
AS
SELECT /*+ INDEX(Z ZDAR_DATE_CREATED_DESC_I) */
Z.ID_ZDAR ID_ZDAR
, Z.TYP TYP
, Z.STAN STAN
, Z.DATE_CREATED DATE_CREATED
, Z.CREATED_BY CREATED_BY
, Z.DATE_MODIFIED DATE_MODIFIED
, Z.MODIFIED_BY MODIFIED_BY
, Z.SPRA_ID_SPRA SPRA_ID_SPRA
, Z.PODM_ID_PODM PODM_ID_PODM
, Z.PODM_UMOW_ID_UMOW PODM_UMOW_ID_UMOW
, Z.NR_WFS NR_WFS
, Z.WFS_NR_INTER WFS_NR_INTER
, Z.UWAGI_OPER UWAGI_OPER
, Z.FUNDUSZ FUNDUSZ
, CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NUMER') AS VARCHAR2(30)) NUMER
, F_Rej_Zdar_Date(Z.ID_ZDAR, 'DATA_PODPISANIA') DATA_PODPISANIA
, CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'RODZAJ') AS VARCHAR2(4)) RODZAJ
, CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'TYP_PRZY') AS VARCHAR2(4)) TYP_PRZY
, CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'TYP_UBEZ') AS VARCHAR2(3)) TYP_UBEZ
, CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWISKO') AS VARCHAR2(30)) NAZWISKO
, CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE') AS VARCHAR2(30)) IMIE
, CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE_OJCA') AS VARCHAR2(30)) IMIE_OJCA
, CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY') AS VARCHAR2(300)) NAZWA_FIRMY
, CAST(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY_SKR') AS VARCHAR2(100)) NAZWA_FIRMY_SKR
, CAST(LTRIM(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWISKO')||' '||F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE')||' '||F_Rej_Zdar_Char(Z.ID_ZDAR, 'IMIE_OJCA')||F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY')||DECODE(F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY'),NULL,F_Rej_Zdar_Char(Z.ID_ZDAR, 'NAZWA_FIRMY_SKR'),NULL)) AS VARCHAR2(492)) DANE_KLIE
FROM T_ZDARZENIA Z
WHERE F_Rej_Zdar_Char(Z.ID_ZDAR, 'JEST') = 'T';
and functions:
CREATE OR REPLACE FUNCTION F_Rej_Zdar_Char
(WE_ID_ZDAR IN NUMBER
,WE_KOLUMNA IN VARCHAR2
RETURN VARCHAR2
IS
c_numer T_PRZYSTAPIENIA.NUMER%TYPE;--VARCHAR2(30);
c_rodzaj T_KLIENCI.RODZAJ%TYPE;--VARCHAR2(1);
c_typ_przy T_PRZYSTAPIENIA.TYP_PRZY%TYPE;--VARCHAR2(1);
c_typ_ubez T_PRZYSTAPIENIA.TYP_UBEZ%TYPE;--VARCHAR2(3);
c_nazwisko T_KLIENCI.NAZWISKO%TYPE;--VARCHAR2(30);
c_imie T_KLIENCI.IMIE%TYPE;--VARCHAR2(30);
c_imie_ojca T_KLIENCI.IMIE_OJCA%TYPE;--VARCHAR2(30);
c_nazwa_firmy T_KLIENCI.NAZWA_FIRMY%TYPE;--VARCHAR2(300);
c_nazwa_firmy_skr T_KLIENCI.NAZWA_FIRMY%TYPE;--VARCHAR2(100);
c_jest VARCHAR2(1) := 'T';
c EXCEPTION;
BEGIN
--dbms_output.put_line('id zdar wykonania '||WE_ID_ZDAR);
BEGIN
SELECT p.NUMER, k.RODZAJ,p.TYP_PRZY,p.TYP_UBEZ,k.nazwisko, k.imie, k.imie_ojca, k.nazwa_firmy, k.nazwa_firmy_skr
INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D1, T_PODMIOTY D2
WHERE p.KLIE_ID_KLIE = k.ID_KLIE
AND z.PODM_ID_PODM = D1.ID_PODM
AND D1.KLIE_ID_KLIE = p.KLIE_ID_KLIE
AND Z.PODM_UMOW_ID_UMOW = D2.ID_PODM
AND D2.PRZY_ID_PRZY = P.ID_PRZY
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT p.NUMER, k.RODZAJ,p.TYP_PRZY,p.TYP_UBEZ,k.nazwisko, k.imie, k.imie_ojca, k.nazwa_firmy, k.nazwa_firmy_skr
INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D
WHERE z.PODM_UMOW_ID_UMOW IS NULL
AND z.PODM_ID_PODM = D.ID_PODM
AND D.KLIE_ID_KLIE = k.ID_KLIE
AND p.KLIE_ID_KLIE = k.ID_KLIE
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT NULL NUMER, NULL RODZAJ,NULL TYP_PRZY,NULL TYP_UBEZ, I.nazwisko, I.imie, I.imie_ojca, I.NAZWA NAZWA_FIRMY, I.NAZWA_SKR nazwa_firmy_skr
INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
FROM T_ZDARZENIA z, T_INSTYTUCJE I
WHERE Z.TYP IN ('WFS526','WFS542','WFS553','WFS609','WFS611','WYP_KS','WYP_PO','WYP_SB','DI_ZAT')
AND z.PODM_UMOW_ID_UMOW IS NULL
AND Z.PODM_ID_PODM = I.ID_INST
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT p.NUMER NUMER, DECODE(a.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(a.TYP_AGENTA,'P','R',a.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,a.nazwisko, a.imie, a.imie_ojca, a.nazwa_firmy, a.nazwa_firmy_skr
INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
WHERE a.ID_AGAG = p.AGAG_ID_AGAG
AND z.PODM_UMOW_ID_UMOW = p.ID_AGUM
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT p.NUMER NUMER, DECODE(a.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(a.TYP_AGENTA,'P','R',a.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,a.nazwisko, a.imie, a.imie_ojca, a.nazwa_firmy, a.nazwa_firmy_skr
INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
WHERE a.ID_AGAG = p.AGAG_ID_AGAG
AND z.PODM_ID_PODM = a.ID_AGAG
AND z.PODM_UMOW_ID_UMOW IS NULL
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT p.NUMER_UMOWY NUMER, DECODE(p.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(p.TYP_AGENTA,'P','R',p.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,p.nazwisko, p.imie_pierwsze, p.imie_ojca, p.nazwa_firmy, p.nazwa_firmy_skr
INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
AND z.PODM_UMOW_ID_UMOW = p.TECH_ID_AGUMT
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT p.NUMER_UMOWY NUMER, DECODE(p.TYP_AGENTA,'A','F','P') RODZAJ, DECODE(p.TYP_AGENTA,'P','R',p.TYP_AGENTA) TYP_PRZY,NULL TYP_UBEZ,p.nazwisko, p.imie_pierwsze, p.imie_ojca, p.nazwa_firmy, p.nazwa_firmy_skr
INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
AND z.PODM_ID_PODM = a.ID_AGKAN
AND z.PODM_UMOW_ID_UMOW IS NULL
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT k.NUMER_UMOWY NUMER, DECODE(k.TYP_PRZYSTAPIENIA,'P','F','P') RODZAJ,k.TYP_PRZYSTAPIENIA TYP_PRZY,'NPO' TYP_UBEZ, k.nazwisko, k.imie_pierwsze, k.imie_ojca, k.nazwa_firmy nazwa_firmy, k.nazwa_firmy_skr nazwa_firmy_skr
INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
FROM T_WE_UM_NPO_TAB k, T_ZDARZENIA z
WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
AND k.TYP_PRZYSTAPIENIA IN ('P','W')
AND z.PODM_ID_PODM IS NULL
AND z.PODM_UMOW_ID_UMOW IS NULL
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT k.NUMER_UMOWY NUMER, 'F' RODZAJ,'-' TYP_PRZY,'OPS' TYP_UBEZ, k.nazwisko, k.imie_pierwsze, k.imie_ojca, NULL nazwa_firmy, NULL nazwa_firmy_skr
INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
FROM T_WE_UM_OPS_TAB k,T_ZDARZENIA z
WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
AND z.PODM_ID_PODM IS NULL
AND z.PODM_UMOW_ID_UMOW IS NULL
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT NULL NUMER, NULL RODZAJ,NULL TYP_PRZY,NULL TYP_UBEZ, NULL nazwisko, NULL imie_pierwsze, NULL imie_ojca, NULL nazwa_firmy, NULL nazwa_firmy_skr
INTO c_numer, c_rodzaj, c_typ_przy, c_typ_ubez, c_nazwisko, c_imie, c_imie_ojca, c_nazwa_firmy, c_nazwa_firmy_skr
FROM T_ZDARZENIA z
WHERE z.TYP NOT IN ('UM_OPS','UM_NPO','NPO_OP','UZUP_U')
AND z.PODM_ID_PODM IS NULL
AND z.PODM_UMOW_ID_UMOW IS NULL
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
--dbms_output.put_line('id zdar wykonania '||WE_ID_ZDAR||' ostatni wyjatek');
NULL;
END;
END;
END;
END;
END;
END;
END;
END;
END;
END;
--raise c;
IF WE_KOLUMNA = 'NUMER' THEN
RETURN c_numer;
ELSIF WE_KOLUMNA = 'RODZAJ' THEN
RETURN c_rodzaj;
ELSIF WE_KOLUMNA = 'TYP_PRZY' THEN
RETURN c_typ_przy;
ELSIF WE_KOLUMNA = 'TYP_UBEZ' THEN
RETURN c_typ_ubez;
ELSIF WE_KOLUMNA = 'NAZWISKO' THEN
RETURN c_nazwisko;
ELSIF WE_KOLUMNA = 'IMIE' THEN
RETURN c_imie;
ELSIF WE_KOLUMNA = 'IMIE_OJCA' THEN
RETURN c_imie_ojca;
ELSIF WE_KOLUMNA = 'NAZWA_FIRMY' THEN
RETURN c_nazwa_firmy;
ELSIF WE_KOLUMNA = 'NAZWA_FIRMY_SKR' THEN
RETURN c_nazwa_firmy_skr;
ELSIF WE_KOLUMNA = 'JEST' THEN
RETURN c_jest;
END IF;
END;
CREATE OR REPLACE FUNCTION F_Rej_Zdar_Date
(WE_ID_ZDAR IN NUMBER
,WE_KOLUMNA IN VARCHAR2
RETURN DATE
IS
d_data DATE;
BEGIN
BEGIN
SELECT p.DATA_PODPISANIA
INTO d_data
FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D1, T_PODMIOTY D2
WHERE p.KLIE_ID_KLIE = k.ID_KLIE
AND z.PODM_ID_PODM = D1.ID_PODM
AND D1.KLIE_ID_KLIE = p.KLIE_ID_KLIE
AND Z.PODM_UMOW_ID_UMOW = D2.ID_PODM
AND D2.PRZY_ID_PRZY = P.ID_PRZY
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT p.DATA_PODPISANIA
INTO d_data
FROM T_KLIENCI k, T_PRZYSTAPIENIA p, T_ZDARZENIA z, T_PODMIOTY D
WHERE z.PODM_UMOW_ID_UMOW IS NULL
AND z.PODM_ID_PODM = D.ID_PODM
AND D.KLIE_ID_KLIE = k.ID_KLIE
AND p.KLIE_ID_KLIE = k.ID_KLIE
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT NULL DATA_PODPISANIA
INTO d_data
FROM T_ZDARZENIA z, T_INSTYTUCJE I
WHERE Z.TYP IN ('WFS526','WFS542','WFS553','WFS609','WFS611','WYP_KS','WYP_PO','WYP_SB','DI_ZAT')
AND z.PODM_UMOW_ID_UMOW IS NULL
AND Z.PODM_ID_PODM = I.ID_INST
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT p.DATA_PODPISANIA DATA_PODPISANIA
INTO d_data
FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
WHERE a.ID_AGAG = p.AGAG_ID_AGAG
AND z.PODM_UMOW_ID_UMOW = p.ID_AGUM
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT p.DATA_PODPISANIA DATA_PODPISANIA
INTO d_data
FROM T_AG_AGENCI a, T_AG_UMOWY p, T_ZDARZENIA z
WHERE a.ID_AGAG = p.AGAG_ID_AGAG
AND z.PODM_ID_PODM = a.ID_AGAG
AND z.PODM_UMOW_ID_UMOW IS NULL
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT p.DATA_PODPISU_AGENTA DATA_PODPISANIA
INTO d_data
FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
AND z.PODM_UMOW_ID_UMOW = p.TECH_ID_AGUMT
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT p.DATA_PODPISU_AGENTA DATA_PODPISANIA
INTO d_data
FROM T_AG_KANDYDACI a, T_AG_UMOWY_TAB p, T_ZDARZENIA z
WHERE a.ID_AGKAN = p.TECH_PODM_ID_PODM
AND z.PODM_ID_PODM = a.ID_AGKAN
AND z.PODM_UMOW_ID_UMOW IS NULL
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT k.DATA_PODPISANIA_UM DATA_PODPISANIA
INTO d_data
FROM T_WE_UM_NPO_TAB k, T_ZDARZENIA z
WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
AND k.TYP_PRZYSTAPIENIA IN ('P','W')
AND z.PODM_ID_PODM IS NULL
AND z.PODM_UMOW_ID_UMOW IS NULL
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT k.DATA_PODPISANIA_UM DATA_PODPISANIA
INTO d_data
FROM T_WE_UM_OPS_TAB k,T_ZDARZENIA z
WHERE z.ID_ZDAR = k.TECH_ZDAR_ID_ZDAR
AND z.PODM_ID_PODM IS NULL
AND z.PODM_UMOW_ID_UMOW IS NULL
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
SELECT NULL DATA_PODPISANIA
INTO d_data
FROM T_ZDARZENIA z
WHERE z.TYP NOT IN ('UM_OPS','UM_NPO','NPO_OP','UZUP_U')
AND z.PODM_ID_PODM IS NULL
AND z.PODM_UMOW_ID_UMOW IS NULL
AND z.ID_ZDAR = WE_ID_ZDAR;
EXCEPTION
WHEN NO_DATA_FOUND THEN
d_data := NULL;
END;
END;
END;
END;
END;
END;
END;
END;
END;
END;
IF WE_KOLUMNA = 'DATA_PODPISANIA' THEN
RETURN d_data;
END IF;
END; -
Problem with File Based replication in Weblogic Express 10
Hi,
We have Web application (exploded war) file deployed on Weblogic Express 10, to a Cluster of three Managed Servers (all three on different physical machines).
We are using File based session persistance in weblogic.xml
We have a shared location for all the three servers where we will be sharing the Session data.
When we start the application, its works fine and is very fast, but after sometime the application slows down.
Troubleshooting the Issue we found that its a problem with file based replication. By using File based replication every user session is stored in form of directory inside shared directory. So after sometime thousands of directories are created inside the shared directory where the session information is stored. So when we access the application, its waiting for lot of time with Message Session Monitor .... (this is because its browsing through the shared session storage directory for lot of time for session information as it has lot of directories) and finally after a long time like 10 mins we get the Application Home Page.
When we clean up all the saved sessions inside shared directory, the application works fine, But we will see the same sometime later may be after 3 or 4 hours when the shared session directory has lot of session information stored in it.
Is there a way to clean up the saved session information on file system as soon as that user session is closed by using file based replication.
We cannot used Inmemory replication as our Appl doesnt support it.
Please advice as it is a major show stopper in our Production Mirror env.
Weblogic ConsultantIt is possible to reduce number of live session by configuring very low timeout-secs weblogic.xml. Default is 60 minutes.
More details are here..
http://e-docs.bea.com/wls/docs100/webapp/weblogic_xml.html#wp1071982
Jayesh
Yagna Sys -
When I open the application the following alert appears: "Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory." There is a solution on the support site but only for Windows-based Firefox, and I'm a Mac user. I have plenty of room on my hard disk.
== This happened ==
Every time Firefox opened
== Two days ago, for no apparent reason.In Mac OS X v10.7, the $HOME/Library folder is a hidden folder.
Open Finder and use one of these:
* Go > Go To Folder (Shift-Command-G) and in the dialog type: ~/Library
* Open the "Go" menu and hold down the Option key to make the Library appear
You can also use this command in a Terminal window to remove the hidden flag.
* Mac HD > Applications > Utilities > Terminal
* chflags nohidden ~/Library -
A simple problem with sateful Session beans
Hi,
I have a really novice problem with stateful session bean in Java EE 5.
I have written a simple session bean which has a counter inside it and every time a client call this bean it must increment the count value and return it back.
I have also created a simple servlet to call this session bean.
Everything seemed fine I opened a firefox window and tried to load the page, the counter incremented from 1 to 3 for the 3 times that I reloaded the page then I opened an IE window (which I think is actually a new client) but the page counter started from 4 not 1 for the new client and it means that the new client has access to the old client session bean.
Am I missing anything here???
Isn�t it the way that a stateful session bean must react?
This is my stateful session bean source.
package test;
import javax.ejb.Stateful;
@Stateful
public class SecondSessionBean implements SecondSessionRemote
private int cnt;
/** Creates a new instance of SecondSessionBean */
public SecondSessionBean ()
cnt=1;
public int getCnt()
return cnt++;
And this is my simple client site servlet
package rezaServlets;
import java.io.*;
import java.net.*;
import javax.ejb.EJB;
import javax.servlet.*;
import javax.servlet.http.*;
import test.SecondSessionRemote;
public class main extends HttpServlet
@EJB
private SecondSessionRemote secondSessionBean;
protected void processRequest (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
response.setContentType ("text/html;charset=UTF-8");
PrintWriter out = response.getWriter ();
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet main</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Our count is " + Integer.toString (secondSessionBean.getCnt ()) + "</h1>");
out.println("</body>");
out.println("</html>");
out.close ();
protected void doGet (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
processRequest (request, response);
protected void doPost (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
processRequest (request, response);
}You are injecting a reference to a stateful session bean to an instance variable in the servlet. This bean instance is shared by all servlet request, and that's why you are seeing this odd behavior.
You can use type-leve injection for the stateful bean, and then lookup the bean inside your request-processing method. You may also save this bean ref in HttpSession.
@EJB(name="ejb/foo", beanName="SecondBean", beanInterface="com.foo.foo.SecondBeanRemote")
public MyServlet extends HttpServlet {
ic.lookup("java:comp/env/ejb/foo");
} -
Problem with JDBC results calling simple stored procedure in VC 7.0
Hi all,
I am building a simple VC model which calls a stored procedure on a JDBC database. I have created the system in the portal, defined the alias and user mapping, the connection test is fine and the VC "find data" lists my bespoke stored procedure.
The stored procedure is :
CREATE PROCEDURE dbo.dt_getBieUsers
AS
select * from dbo.emailuserlink
GO
When I test it using query analyser, it returns 3 records each with the two fields I expect - user and email address.
I drag the model onto the workspace in VC and create an input form ( with just a submit button ). i drag the result port out to create a table. This has no fields in it.
I build and deploy as flex and the app runs, I click the submit button and SUCCESS! I get 3 records in my table each with 2 fields. The data is all correct. The problem with this is the fields are determined at runtime it seems.
I go back to the table and add 2 columns "email" and "address".
i build and deploy and run the app. Again I get 3 records, but this time the contents of all of the rows is not data, but "email" and "address". The data has been replaced by the header texts in all of the rows.
Can anyone help? Why isn't the data being put in my columns as I would expect?
I tried to build and deploy the app as Web Dynpro rather than Flex to see if it was a bug in Flex. The application starts but when I click the submit button to run the JDBC stored procedure I get a 500 Internal Server Error
com.sap.tc.wd4vc.intapi.info.exception.WD4VCRuntimeException: No configuration is defined for the entry JDBCFunction
at com.sap.tc.wd4vc.xglengine.XGLEngine.createComponentInternal(XGLEngine.java:559)
at com.sap.tc.wd4vc.xglengine.XGLEngine.getCompInstanceFromUsage(XGLEngine.java:362)
at com.sap.tc.wd4vc.xglengine.XGLEngine.getCompInstance(XGLEngine.java:329)
at com.sap.tc.wd4vc.xglengine.wdp.InternalXGLEngine.getCompInstance(InternalXGLEngine.java:167)
at com.sap.tc.wd4vc.xglengine.XGLEngineInterface.getCompInstance(XGLEngineInterface.java:165)
The JDBC connection I am using has a connection URL of jdbc:sap:sqlserver://localhost;DatabaseName=BIEUSERS
and a driver class of com.sap.portals.jdbc.sqlserver.SQLServerDriver
Can anyone solve my wierd problems?
Cheers
RichardHi Richard,
After you drag and drop the data service, right click on it and choose "Test data service". Then click on "Execute" and after you see the result on the right, click on "Add fields" button (inside the same window). Now you'll see that the fields are on the tabel. This is required only for JDBC data services, since this data (how the resultset is built) is not know in DT and it needs to be run firest - then analysed and only then you have to add the fields to the table).
Regards,
Natty
Maybe you are looking for
-
Using javascript variable in spry if statement
is it possible to put a javascript variable in to the spry if statement to test? like <div spry:if="javascriptvar == {ds_RowNumber}".... thanks.
-
i'm preparing for scjp5 n using jdk1.4.2.will i've to change my jdk environment to jdk5 or it won't create any problem in exam.
-
ADF Faces tooltip text for datatable's columns impossible?
Hi, How can I show tooltip text for column in datatable? ShortDesc property for column is ignored. thanks, Branislav
-
this is what I'm getting driving me NUTS This page delivered to you by a web browser extension Click here to learn more.
-
Hi, I've a JSP page developed by JDeveloper 9.0.3, with a checkbox item: <input name="pluto" type="checkbox" value="1" onClick="" /> I need to execute some transactions on db everytime "pluto" is checked or uncheked. I'd like to handle this by a JBO