SlideShare a Scribd company logo
1 of 115
Download to read offline
DOCUMENTATION OF LIMS FOR
FARM PRODUCTS.
PREPARED BY – RAHUL SINGH
2015
LIMS DOCUMENTATION
FARM PRODUCTS
INSTALLING ORACLE DATABASE AND DEVELOPER SUITE AND
CONNECTING THEM
1. The table description for farm product phase is in the C:projfilestable script and
definition.txt in the server.
2. How to install database.(refer youtube for installing.)
3. Install the oracle database 10g, sql developer.
4. Install the oracle developer suite.
5. Oracle SID– soiltest
6. We have to create some system variables for the oracle to run.
7. Go to Control PanelAll Control Panel ItemsSystem>advanced system settings>environment
variables
8. Check for a variable named LOCAL with value ORCL. If not present create it.
9. Check the path variable and add
C:DevSuiteHome_2jdkjrebinclassic;C:DevSuiteHome_2jdkjrebin;C:DevSuiteHome_2j
dkjrebinclient;C:DevSuiteHome_2jlib;C:DevSuiteHome_2bin;C:DevSuiteHome_2jre1.4
.2binclient;C:DevSuiteHome_2jre1.4.2bin;C:ProgramDataOracleJavajavapath;C:appr
ksinghoraclebaseproduct11.2.0dbhome_1bin;%SystemRoot%system32;%SystemRoot%;%
SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;C:Pro
gram
FilesJavajdk1bin;C:DevSuiteHome_2reportsjlibrwbuilder.jar;C:DevSuiteHome_2reports
jlibrwrun.jar;C:DevSuiteHome_2jlibzrclient.jar;C:DevSuiteHome_2j2eehomeoc4j.jar;C:
DevSuiteHome_2j2eehomelibojsp.jar
10.There should be no spaces in the name of any folder. If there is please rename the folders and
path and use _.
11.Create a new variable REPORTS_PATH and give the value as
C:DevSuiteHome_2reportsjlibrwbuilder.jar;C:DevSuiteHome_2reportsjlibrwrun.jar;C:D
evSuiteHome_2jlibzrclient.jar;C:DevSuiteHome_2j2eehomeoc4j.jar;C:DevSuiteHome_2j
2eehomelibojsp.jar;C:proj
12.The underlined path is the folder where the reports are being stored. In this project it is c:proj.
make sure all the reports are in the given folder. This helps the forms to directly fetch the
reports from the folder.
13.Check for a variable called TNS_ADMIN . If not there create and put value
C:apprksinghoraclebaseproduct11.2.0dbhome_1NETWORKADMIN;C:DevSuiteHome_2
NETWORKADMIN.
14.The folder depends on the individual system but the path should be like mentioned above.
15.Open run type cmd
16.Type tnsping ORCL
17.Open run and type rwserver server=rep_soiltestservto create the reports server. This server
has to be started everytimemanually . We will make an environment variable for this path in
later steps.
18.Open run and type regedit.
19.Compare the system variable with the given screen shots in next few slides.
20.
21.
22.Install the oracle developer suite.
23.copy the files sqlnet.ora, tnsnames.ora from
C:apprksinghoraclebaseproduct11.2.0dbhome_1NETWORKADMIN and paste in
C:DevSuiteHome_2NETWORKADMIN (this connects the database with the forms and
reports)
24.Run the jinit file in C:DevSuiteHome_2jinit
25.Copy the C:DevSuiteHome_2jdkjrebinserverjvm.dll file and paste in C:Program Files
(x86)OracleJInitiator 1.3.1.22binhotspotjvm.dll and replace it.
26.Install Mozilla 2.0.
27.Open and run and connect the oracle forms builder.
28.Use the credentials as used in oracle database .
29.Go to edit>preferences>runtime>default> and search for the installation file for Mozilla2.0
version (C:Program Files (x86)Mozilla Firefox)
30.Install plugins.
31.Open run type cmd
32.Type sqlplus sys/tiger@ORCL
33.Username ---system (admin)
34.Password --- tiger1
35.Run ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE;
36.This step is important as it helps in directly connecting with the servers and login when reports
are called.
CONNECTING THE REPORTS BUILDER WITH FORMS AND DATABASE
37. The connection with database is already made.(copying of tnsnames and sqlnet to the network
directory)
38. The backup for these files are in C:projfiles folder.
39. Open reports builder and connect with the same credentials.
40. The connection forms are made in some last steps where we altered the case sensitive login. If that is
not done please run cmd
41. Sqlplus sys/tiger1@ORCL
42. Username- system password – tiger1
43. ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE;
44. If this is not done then the connection fails when we run any reports.
45. To increase the servlet size for forms
46. Open C:DevSuiteHome_2formsserverformsweb.cfg
47. Edit-- # Forms applet parameter
width=90%
# Forms applet parameter
height=100%
48. Some changes in the configuration files of reports are necessary.
49. After making the report server by running rwserver server=rep_soiltestservin the run.
50. We get the config file for the server in C:DevSuiteHome_2reportsconf folder.
51. Open the config file for the respective server.
52. Change
1. <!--property name="maxCacheFileNumber" value="max number of cache files"/-->
<property name="maxCacheFileNumber" value="50"/>
2. <!--property name="sourceDir" value="your reports source directory"/-->
<property name="sourceDir" value="C:proj"/>
3. <connection maxConnect="20" idleTimeOut="50">
<queue maxQueueSize="1000"/>
53. Open C:DevSuiteHome_2reportslogsrep_soiltestservrwserver.txt
54. check
1. <property name="cacheSize" value="50"/>
2. <property name="maxCacheFileNumber" value="50"/>
<connection maxConnect="20" idleTimeOut="50">
Steps to run the tool
1. Open the server.(all the development and deployment files are in the server.)
2. Start OC4J instance for forms and reports.
3. Open the SQL developer and start the database --- soiltest
4. Open the oracle forms tool.
5. Login details for oracle database, SQL developer, forms and reports builder are :-
6. username ----- HR
7. Password ----- tiger1
8. Database ----- ORCL
9. The other user are sys, system, HR, SCOTT with the same password and database.
10. Server name is soiltestserv.agron.iastate.edu
11. Open cmd from run.
12. Type rwserver server=rep_soiltestserv START and press enter.(this is the report server which needs to
be started in order to run the reports)
13. We can traverse to different pages from the menu which appears in the top section of the tool.
TABLE DESCRIPTION AND DEFINITION
FARM PRODUCT CLIENT DETAILS
-------------------------------
CLIENT_DETAILS
----------------
CREATE TABLE "HR"."CLIENT_DETAILS"
( "CLIENT_ID" NUMBER(6,0) NOT NULL ENABLE,
"FIRST_NAME" VARCHAR2(20 BYTE),
"LAST_NAME" VARCHAR2(20 BYTE),
"DOC" DATE,
"ADDRESS" VARCHAR2(30 BYTE),
"CITY" VARCHAR2(20 BYTE),
"STATE" VARCHAR2(20 BYTE),
"ZIP" NUMBER(6,0),
"COUNTY" VARCHAR2(15 BYTE),
"EMAIL" VARCHAR2(40 BYTE),
"PHONE" NUMBER(10,0),
"SUBMITTER_ID" NUMBER(6,0),
"SUB_FIRST_NAME" VARCHAR2(20 BYTE),
"SUB_LAST_NAME" VARCHAR2(20 BYTE),
"USERNAME" VARCHAR2(20 BYTE),
"PASSWORD" VARCHAR2(20 BYTE),
"COMMENTS" VARCHAR2(30 BYTE),
CONSTRAINT "CLIENT_DETAILS_PK" PRIMARY KEY ("CLIENT_ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
Note – 1. If client is a contractor or he has a number of other client for which he is submitting the soil samples then we
use the submitter ID and submitter name.
2. username and password is not used as of now, it will be used when we design the client side of the tool.
==================================================================================================
==================================
FARM PRODUCTS SUGGESTION DATA
--------------------------------------
FARM_COMMENTS
--------------------------------------
CREATE TABLE "HR"."FARM_COMMENTS"
( "CROP_CODE" NUMBER,
"COMMENTS" VARCHAR2(1000 BYTE)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
-----------------------------------------
CROP_CODE COMMENTS
----------------------------------
3 FOR CROP CODE 3: Corn or Sorghum Grain--The recommended amounts of P2O5 and K2O for the
optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in
the table for this optimum soil test category are based on 180 bu corn grain per acre. Nutrient removal amounts can be
adjusted higher or lower for other yield levels. In the high soil test category, banded NP or NPK starter fertilizer may be
advantageous under conditions of limited soil drainage, cool soil, crop residues on the soil surface, or late planting dates
with full-season hybrids.
4 FOR CROP CODE 4: Soybeans--The recommended amounts of P2O5 and K2O for the optimum soil test
category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this
optimum soil test category are based on 55 bu soybean grain per acre. Nutrient removal amounts can be adjusted
higher or lower for other yield levels.
5 FOR CROP CODE 5: Corn/soybean grain sequence--The recommended amounts of P2O5 and K2O for the
optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in
the table for this optimum soil test category are based on 180 bu corn grain per acre and 55 bu soybean per acre.
Nutrient removal amounts can be adjusted higher or lower for other yield levels.In the high soil test category, consider
application of a partial removal rate. Also, banded NP or NPK starter fertilizer may be advantageous under conditions of
limited soil drainage, cool soil, crop residues on the soil surface or late planting dates with full-season hybrids.
6 FOR CROP CODE 6: Oat Grain--The recommended amounts of P2O5 and K2O for the optimum soil test
category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this
optimum soil test category are based on 80 bu oat grain per acre. Nutrient removal amounts can be adjusted higher or
lower for other yield levels.
7 FOR CROP CODE 7: Wheat--The recommended amounts of P2O5 and K2O for the optimum soil test
category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this
optimum soil test category are based on 60 bu wheat grain per acre and straw. Nutrient removal amounts can be
adjusted higher or lower for other yield levels.
8 FOR CROP CODE 8: Sunflowers--The recommended amounts of P2O5 and K2O for the optimum soil test
category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this
optimum soil test category are based on 2000 lb sunflower seed per acre. Nutrient removal amounts can be adjusted
higher or lower for other yield levels.
9 FOR CROP CODE 9: Corn or sorghum silage--The recommended amounts of P2O5 and K2O for the
optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in
the table for this optimum soil test category are based on 22 tons corn silage per acre. Nutrient removal amounts can be
adjusted higher or lower for other yield levels. In the high soil test category, banded NP or NPK starter fertilizer may be
advantageous under conditions of limited soil drainage, cool soil, crop residues on the soil surface, or late planting dates
with full-season hybrids.
10 FOR CROP CODE 10: Alfalfa and alfalfa grass hay and pastures--For soils that test in the high soil test P
category, 30 lb P2O5 per acre is recommended at seeding time. The recommended amounts of P2O5 and K2O for the
optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in
the table for this optimum soil test category are based on 5 ton per acre harvested hay. Nutrient removal amounts can
be adjusted higher or lower for other yield levels. For pastures, reduce the amount in all soil test categories for
phosphorus to two-thirds and for potassium to one-half of the amount indicated for hay because more nutrients are
returned to the soil when grazing.
13 FOR CROP CODE 13: bluegrass--**no comments**
11 FOR CROP CODES 11 : Hay and pastures--The recommended amounts of P2O5 and K2O for the optimum
soil test category are based on 3 ton per acre of harvested hay. Nutrient removal amounts can be adjusted higher or
lower for other yield levels. For pastures, reduce the amount in all soil test categories for phosphorus to two-thirds and
for potassium to one-half the amount indicated for hay because more nutrients are returned to the soil when grazing.
12 FOR CROP CODES 12: Hay and pastures--The recommended amounts of P2O5 and K2O for the optimum
soil test category are based on 3 ton per acre of harvested hay. Nutrient removal amounts can be adjusted higher or
lower for other yield levels. For pastures, reduce the amount in all soil test categories for phosphorus to two-thirds and
for potassium to one-half the amount indicated for hay because more nutrients are returned to the soil when grazing.
==================================================================================================
=================================
FARM CROP CODE AND DETAILS
-----------------------------------------
FARM_CROP_DETAILS
-----------------------------------------
CREATE TABLE "HR"."FARM_CROP_DETAILS"
( "CROP_CODE" NUMBER(3,0) NOT NULL ENABLE,
"CROP_NAME" VARCHAR2(130 BYTE),
CONSTRAINT "FARM_CROP_DETAILS_PK" PRIMARY KEY ("CROP_CODE")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
----------------------------------------------------------
CROP_CODE CROP_NAME
------------------------------------
3 Corn or sorghum grain
4 Soybeans
5 Corn/soybean grain sequence(two year rotation, applied before either corn or soybean)
6 Oat grain
7 Wheat
8 Sunflowers
9 Corn or sorghum silage
10 Alfalfa and alfalfa grass hay and pastures
11 Clover- and –trefoil-grass hay and pastures
12 Tall and cool season grasses, warm season grasses and sorghum-sudan hay and pastures
13 Bluegrass
Note – All the crop codes used here are the new crop codes.
==================================================================================================
=================================
FARM PRODUCT k RANGE FOR CALCULATING RECOMMENDATIONS
--------------------------------------------------------------
FARM_K_RANGE
--------------------------------------
CREATE TABLE "HR"."FARM_K_RANGE"
( "K_MIN" NUMBER(4,0),
"K_MAX" VARCHAR2(6 BYTE),
"TEST_TYPE" VARCHAR2(8 BYTE),
"KR" VARCHAR2(3 BYTE)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
----------------------------------------------------
K_MIN K_MAX TEST_TYPE KR
--------------------------------------
0 50 moist VL
51 85 moist L
86 120 moist O
121 155 moist H
156 100000 moist VH
0 120 dry VL
121 160 dry L
161 200 dry O
201 240 dry H
241 100000 dry VH
IT IS USED TO DETEMINE THE VALUE OF KR BASED ON THE VALUE OF K WE GET FROM THE LAB TESTS. WE HAVE
DEFINED THE RANGES AND THE TYPE OF TESTS WE ARE DOING ON THE SAMPLE TO FIND CORRESPONDING KR.
THIS KR HELPS IN DEFINING THE FINAL K RECOMMENDATION FOR SANDY AND FINE SOIL.
select KR from farm_K_ranges where test_type='moist' and K_min<= x and K_max>= x
select KR from farm_K_ranges where test_type='dry' and K_min<= x and K_max>= x
==================================================================================================
===========================================
FARM PRODUCT P RANGE FOR CALCULATING RECOMMENDATIONS
-------------------------------------------------------
FARM_P_RANGE
---------------------------
CREATE TABLE "HR"."FARM_P_RANGE"
( "CROP_CODE" NUMBER(3,0),
"P_MIN" NUMBER(3,0),
"P_MAX" NUMBER(6,0),
"PR" VARCHAR2(23 BYTE)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
--------------------------------------------------------------
CROP_CODE P_MIN P_MAX PR
---------------------------------------------------------------
3 9 15 L
3 16 20 O
3 21 30 H
3 31 100000 VH
4 0 8 VL
4 9 15 L
4 16 20 O
4 21 30 H
4 31 100000 VH
5 0 8 VL
5 9 15 L
5 16 20 O
5 21 30 H
5 31 100000 VH
6 0 8 VL
6 9 15 L
6 16 20 O
7 0 15 VL
7 16 20 L
7 21 25 O
7 26 30 H
7 31 100000 VH
8 0 8 VL
8 9 15 L
8 16 20 O
8 21 30 H
8 31 100000 VH
9 0 8 VL
9 9 15 L
9 16 20 O
9 21 30 H
9 31 100000 VH
10 0 15 VL
10 16 20 L
10 21 25 O
10 26 30 H
10 31 100000 VH
11 0 8 VL
11 9 15 L
11 16 20 O
11 21 30 H
11 31 100000 VH
12 0 8 VL
12 9 15 L
12 16 20 O
12 21 30 H
12 31 100000 VH
13 0 8 VL
13 9 15 L
13 16 20 O
13 21 30 H
13 31 100000 VH
6 31 100000 VH
3 0 8 VL
6 21 30 H
IT IS USED TO DETEMINE THE VALUE OF PR BASED ON THE VALUE OF P WE GET FROM THE LAB TESTS. WE HAVE
DEFINED THE RANGES AND THE TYPE OF TESTS WE ARE DOING ON THE SAMPLE TO FIND CORRESPONDING PR.
THIS PR HELPS IN DEFINING THE FINAL P RECOMMENDATION FOR THE SOIL.
select PR from farm_p_ranges where crop_code = 1 and p_min<= x and P_max>= x;
==================================================================================================
============================
FARM PRODUCT P AND K RECOMMENDATION VALUE TABLE
------------------------------------------------------------------
FARM_RECOMMENDATION_BRAY_M3
------------------------------------------
CREATE TABLE "HR"."FARM_RECOMMENDATION_BRAY_M3"
( "VALUE" VARCHAR2(3 BYTE),
"CROP_CODE" NUMBER(3,0),
"P_REC" NUMBER(3,0),
"KF_REC" NUMBER(3,0),
"KS_REC" NUMBER(3,0)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
VALUE CROP_CODE P_REC KF_REC KS_REC
-----------------------------------------------------
VL 3 100 130 110
L 3 75 90 70
O 3 58 40 40
VL 4 80 120 100
L 4 60 90 85
O 4 40 66 66
VL 5 160 220 195
L 5 115 156 136
O 5 98 106 106
VL 6 60 70 70
L 6 50 40 40
O 6 25 15 15
VL 7 60 70 70
L 7 50 40 40
O 7 30 15 15
L 8 50 50 50
O 8 15 15 15
VL 9 120 250 235
L 9 100 220 215
O 9 80 200 200
VL 10 110 280 280
L 10 80 240 240
O 10 65 215 215
VL 11 80 180 180
L 11 60 140 140
O 11 35 95 95
VL 12 90 170 170
L 12 60 130 130
O 12 35 100 100
VL 13 40 50 50
L 13 30 35 35
O 13 10 0 0
THIS TABLE HELPS IN DETERMINING THE P AND K RECOMMENDATIONS BASED ON THE PR AND KR VALUE WE GET FROM
THE P AND K RANGE TABLES. BASED ON THE VALUE AND CROP CODE WE MATCH THE
P_REC ,KF_REC AND KS_REC.
selectp_rec from farm_recommendation_bray_M3 where crop_code = 10 and value = ''VL";
selectKF_rec,KS_rec from farm_recommendation_bray_M3 where crop_code = 11 and value = ''L";
==================================================================================================
================================================
FARM SOIL INFORMATION ENTRY TABLE.
------------------------------------------
FARM_SOIL_FERT_SAMPLE_INFO
------------------------------
CREATE TABLE "HR"."FARM_SOIL_FERT_SAMPLE_INFO"
( "CLIENT_ID" NUMBER(7,0),
"CLIENT_SAMPLE_ID" VARCHAR2(6 BYTE),
"TOOL_SAMPLE_ID" NUMBER(7,0),
"LAB_ID" NUMBER(7,0) NOT NULL ENABLE,
"DOS" DATE,
"TILLAGE_DEPTH" NUMBER(2,0),
"LIME" VARCHAR2(4 BYTE),
"CROP_CODE" NUMBER(2,0),
"TEST_SERIES_CODE" VARCHAR2(3 BYTE),
CONSTRAINT "FARM_SOIL_FERT_SAMPLE_INFO_PK" PRIMARY KEY ("LAB_ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
THIS TABLE CONTAINS ALL THE FIELDS FOR WHICH THE FARMERS WILL PROVIDE THE VALUE. TOOL SAMPLE ID IS AN
EXTRA COLUMN WHICH KEEPS TRACK OF ALL THE SAMPLE ID BEING SAVED IN THE
LIMS. TOOL_SAMPLE_ID AND LAB_ID ARE AUTOMATICALLY FILLED BY THE LIMS SOFTWARE.
==================================================================================================
======================================================
FARM SOIL TEST RESULT TABLE
----------------------------------------------------
FARM_SOIL_FERT_TEST_RESULTS
-----------------------------------------------------
CREATE TABLE "HR"."FARM_SOIL_FERT_TEST_RESULTS"
( "CLIENT_SAMPLE_ID" NUMBER(4,0),
"TOOL_SAMPLE_ID" NUMBER(6,0),
"LAB_ID" NUMBER(7,0) NOT NULL ENABLE,
"DOR" DATE,
"CLIENT_ID" NUMBER(6,0),
"FIRST_NAME" VARCHAR2(20 BYTE),
"LAST_NAME" VARCHAR2(20 BYTE),
"TEST_METHOD" VARCHAR2(4 BYTE),
"TILLAGE_DEPTH" NUMBER(3,0),
"CROP_CODE" NUMBER(3,0),
"OM" NUMBER(5,2),
"P" NUMBER(4,0),
"K" NUMBER(4,0),
"ZN" NUMBER(6,2),
"PH" NUMBER(5,2),
"BPH" NUMBER(5,2),
"P_REC" NUMBER(4,0),
"K_REC_FINE" NUMBER(4,0),
"K_REC_SANDY" NUMBER(4,0),
"ZN_BROAD" NUMBER(3,0),
"ZN_BAND" NUMBER(3,0),
"PH_1" NUMBER(7,2),
"PH_2" NUMBER(7,2),
"PH_3" NUMBER(7,2),
"COMMENTS" VARCHAR2(1000 BYTE),
"COMMENTS2" VARCHAR2(1000 BYTE),
CONSTRAINT "FARM_SOIL_FERT_TEST_RESULT_PK" PRIMARY KEY ("LAB_ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
THIS TABLE CONTAINS ALL THE COLUMNS WHICH ARE FILLED WHEN RESULTS OF ALL THE TESTS ARE RECEIVED FROM
THE LAB. WHEN RUNNING THE SOFTWARE WE JUST HAVE TO FILL THE OM, P, K, ZN, PH, BPH
VALUE AND REST ARE AUTOMATICALLY FILLED BY THE SOFTWARE. COMMENTS2 COLUMN IS FOR FILLING ANY EXTRA
COMMENTS WE WILL HAVE ON EACH LAB_ID.
==================================================================================================
===============================================
THE FARM SOIL TEST METHOD LAB IS FOLLOWING
--------------------------------------------------
FARM_SOIL_TEST_METHOD
--------------------------------------------
CREATE TABLE "HR"."FARM_SOIL_TEST_METHOD"
( "TEST_CODE" NUMBER(2,0) NOT NULL ENABLE,
"TEST_NAME" VARCHAR2(25 BYTE),
CONSTRAINT "FARM_SOIL_TEST_METHOD_PK" PRIMARY KEY ("TEST_CODE")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
TEST_CODE TEST_NAME
---------------------------------
1 bray and M3
2 olsen
3 M3ICP
IT CONTAINS NAMES OF ALL THE KIND OF TEST TECHNIQUES WE USE.
==================================================================================================
=============================================
FARM SOIL TEST SERIES NAMES AND CODES
-----------------------------------------------
FARM_SOIL_TEST_SERIES_CODE
----------------------------------------------
CREATE TABLE "HR"."FARM_SOIL_TEST_SERIES_CODE"
( "TEST_CODE" VARCHAR2(3 BYTE) NOT NULL ENABLE,
"TESTS" VARCHAR2(70 BYTE),
"COST" NUMBER(4,0),
"TEST_TYPE" VARCHAR2(20 BYTE),
CONSTRAINT "FARM_SOIL_TEST_SERIES_CODE_PK" PRIMARY KEY ("TEST_CODE")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
TEST_CODE TESTS COST TEST_TYPE
------------------------------------------------------------------------------------
M1 Moist K and P and dry pH and lime 12 moist
M2 Moist K and P and dry pH, lime and OM 15 moist
M3 Moist K and P and dry pH, lime and Zn 16 moist
M4 Moist K and P and dry pH, lime, OM and Zn 18 moist
1 Dry K and P and dry pH and lime 9 dry
2 Dry K and P and dry pH, lime and OM 12 dry
3 Dry K and P and dry pH, lime and Zn 13 dry
4 Dry K and P and dry pH, lime, OM and Zn 15 dry
5 pH and lime only 8 dry
THIS TABLE CONTAINS ALL THE TEST SERIES CODE AND NAMES ALONG WITH THE COST AND TYPE OF TEST. TEST TYPE IS
VERY IMPOPRTANT TO MAINTAIN AS IT DETERMINES THE K RECOMMENDATION.
IT SHOULD BE "moist" or "dry".
==================================================================================================
=================================================
FARM PRODUCT ZINC RANGES FOR RECOMMENDATIONS
-------------------------------------------------------
FARM_ZN_RANGE
-----------------------------------------------------
CREATE TABLE "HR"."FARM_ZN_RANGE"
( "ZN_MIN" NUMBER(6,2),
"ZN_MAX" NUMBER(6,2),
"ZN_BROAD" NUMBER(3,0),
"ZN_BAND" NUMBER(3,0),
"ZN_VALUE" VARCHAR2(2 BYTE)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
ZN_MIN ZN_MAX ZN_BROAD ZN_BAND ZN_VALUE
------------------------------------------------------
0 0.4 10 2 L
0.5 0.8 5 1 M
0.9 1000 0 0 A
THIS TABLE CONTAINS THE RANGES OF ZINC VALUE FOR DETERMINING THE RECOMMENDATION VALUE FOR ZINC. WE
CALCULATE THE ZINC VALUE FROM LAB TEST AND DETERMINE ZN_BROAD AND
ZN_BAND FROM THAT VALUE WHICH ARE THE FINAL RECOMMENDATION.
selectzn_broad, zn_band from farm_zn_range where zn_min<= x and zn_max>= x;
==================================================================================================
=================================================
LAB ID AND TOOL SAMPLE ID TRACKER
--------------------------------------------------------
LAB_ID_TRACKER
------------------------------------
CREATE TABLE "HR"."LAB_ID_TRACKER"
( "LAB_ID" NUMBER(7,0) NOT NULL ENABLE,
"CLIENT_ID" NUMBER(7,0),
"CLIENT_SAMPLE_ID" VARCHAR2(5 BYTE),
"DOS" DATE,
"TOOL_SAMPLE_ID" NUMBER(7,0),
CONSTRAINT "LAB_ID_TRACKER_PK" PRIMARY KEY ("LAB_ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ;
THIS IS A AUTO FILLED TABLE WHICH HELPS GENERATION OF SEQUENTIAL LAB ID AND TOOL SAMPLE ID FOR
GENERATING REPORTS AND GIVING ALL TESTS UNIQUE ID.
Note - The data on the client details, soil info and the result table can be entered from back end as well but the proper
header should be maintain. The proper format and the program to calculate and load are in a ------document.
LIMS tool explanation.
1. This is the homepage of the tool.
2. NAME- HOMEPAGE.fmb
3. This page contains a custom menu , a header section and the main page.
4. The header section is the part with the logo and auto generated date.
5. For menu explanation see the next section.
• Menu – this is a custom menu with the links to all the pages and some functionality such as closing the windows
, saving the values, executing the queries, clearing the forms and deleting the value from the given text field.
• It is basically broken into categories based on the type of clients we work for.
• Logo – this is automatic loading logo of Iowa state university with the Soil and Plant Analysis Lab logo.
• Date – this is a display item which shows the current date. It is automated and can’t be changed in running
mode.
• In the WHEN_NEW_FORM_INSTANCE TRIGGER OF THE FORM WE HAVE TO GIVE THE CODE TO VIEW THIS PART.
• declare
--x date;
begin
read_image_file('C:projlogo.jpg','any','image4');
SELECT to_date(sysdate,'dd-mon-yy') into :date FROM dual;
end;
• Enter – this is button when pressed go to client search page to search for existing client. We check if client is
present in the system or not. If present then we directly enter the soil information we get from the paper form
submitted by the clients.
new_form('C:projclient_search.fmx',no_rollback,no_query_only,share_library_data);
MENU DESIGN
NAME – MENU.MMX
1. This menu contains all the links to different pages in the tool for different work. Like for farm products,
horticulture products, research work, reports etc.
2. Right click on any tab here and click on the PL/SQL editor and there is a code for moving to that page .
3. Eg .new_form('c:projsoilinfo1.fmx',no_rollback,no_query_only,share_library_data);
4. This menu has to be explicitly attached to all the forms to see this menu on any page we open or else
we will see the Default menu bar.
5. To attach this to any form open PROPERTY PALLETE of the form and look for the MENU MODULE tab as
shown In the figure below and attach the menu file here.
6. The location of the menu bar is c:projmenu1.mmx
3. CLIENT SEARCH PAGE
1. NAME- CLIENT_SEARCH.FMX
2. This page also contains 3 section – Menu bar, header, body.
3. Menu bar and the header section are same for all the forms.
4. This page is for searching the details for existing clients and entering the soil samples information if
client data is already present.
5.
6. This page is used for checking if we have the client present in our system. When we get soil info in form
of a paper format we have to check for the presence of the client. If the user is present in the system
we press ENTER button to enter the page where we enter and save the soil information.
DECLARE
p_idparamlist;
p_name varchar(20) := 'client_id';
BEGIN
--check if parameter already exists
p_id := get_parameter_list(p_name);
ifid_null(p_id) then
p_id := create_parameter_list(p_name);
else
--destroy and recreate
destroy_parameter_list(p_id);
p_id := create_parameter_list(p_name);
end if;
--adding parameter to parameter list
add_parameter(p_id,'ID', text_parameter, to_char(:block2.text_item11));
new_form
('c:projSOILINFO1.fmx',no_rollback,no_query_only,share_library_data,p_id);
if not form_success then
message('ERROR: Unable to open the form. ');
raiseform_trigger_failure;
end if;
EXCEPTION
when others then
message('ERROR: Unable to create parameter list. ');
raiseform_trigger_failure;
end;
This code sends the client ID as a parameter to the next soil info page so that we don’t have to enter
the value of the ID, and other details like NAME, etc. again.
7. If the user is not present in our system we can use the menu to enter the Client information and the
corresponding soil information in the designated page.
8. Link for new user is MENU > FARM PRODUCTS > SOIL INFO ENTRY (N).
9. We can check for various client at a time and then enter the values of soil information for all the clients
one-by-one.
10. Home – this is a button which takes to the homepage when pressed. We can also use the menu for the
same purpose.new_form('C:projhomepage.fmx',no_rollback,no_query_only,share_library_data);
11. Search fields- these are the fields through which we can search the user. We can use any of the fields
to locate information for any user.
12. We have to enter any value and press TAB and all fields are automatically filled. If user is not present
tool gives appropriate message.
13. LOV – first name , last name, ID has a LOV attached with it where we can easily search for any user.
14.
As we know there are many client who subsequently have their own clients (submitter) we maintain
separate instance for all client and submitter instance. Like we see McCorkle Kent is repeated twice in the
client details but the submitter is different. This helps in generating separate reports for separate clients.
15. When these fields are clicked the LOV open automatically and we can choose any user.
16. When we select any user from LOV or search from other text fields all the other fields are filled
automatically.
17. To make the LOV we go through LOV wizard and then attach it with the required text fields.
18. These LOV are present on CLIENT_ID,CLIENT_FIRST_NAME,CLIENT_LAST_NAME.
19. Phone_number- this field has a POST_TEXT-ITEM TRIGGER on it to search from the database if we
search with phone number.
BEGIN
selectclient_id into :text_item11 from client_details where phone = :text_item9;
selectfirst_name into :text_item7 from client_details where phone = :text_item9;
selectlast_name into :text_item8 from client_details where phone = :text_item9;
select phone into :text_item9 from client_details where phone = :text_item9;
select email into :text_item10 from client_details where phone = :text_item9;
EXCEPTION
whentoo_many_rows then
message('Multiple value detected. Try different filters.');
whenno_data_found then
message('No matching records could be found in the database. try different filters.');
END;
20. This code will fill all the details in all the respective fields if data is present.
21. EMAIL_ID – this is also a search field if we search with EMAIL_ID. It works the same as the phone
number text item.
BEGIN
selectclient_id into :text_item11 from client_details where email = :text_item10;
selectfirst_name into :text_item7 from client_details where email = :text_item10;
selectlast_name into :text_item8 from client_details where email = :text_item10;
select phone into :text_item9 from client_details where email = :text_item10;
select email into :text_item10 from client_details where email = :text_item10;
EXCEPTION
whentoo_many_rows then
message('Multiple value detected. Try different filters.');
whenno_data_found then
message('No matching records could be found in the database. try different filters.');
END;
22. When a user is found we have to press ENTER button to enter the next page for soil info entry.
23. New search – this button clears the form and we can do a new search.
go_block('block2');
clear_block;
SOILINFO ENTRY PAGE(FOR EXISTING USERS)
NAME – SOILINFO1.FMX
1. This form is to enter the soil information given by the clients.
2. We get to this page from the CLIENT_SEARCH page. This page automatically fills the client
information by taking the parameter from last page and having a trigger
WHEN_NEW_FORM_INSTANCE.
declare
id1 varchar(10);
BEGIN
read_image_file('C:projlogo.jpg','any','image4');
SELECT to_date(sysdate,'dd-mon-yy') into :date FROM dual;
--showing id intoclient_id text item
:block7.client_id:= :parameter.ID;
id1 :=:parameter.ID;
--showing all the values in the respective text items.
selectfirst_name into :block7.first_name from CLIENT_DETAILS where client_id = id1;
selectlast_name into :block7.last_name from CLIENT_DETAILS where client_id = id1;
select doc into :block7.doc from CLIENT_DETAILS where client_id = id1;
select address into :block7.address from CLIENT_DETAILS where client_id = id1;
select city into :block7.city from CLIENT_DETAILS where client_id = id1;
select state into :block7.state from CLIENT_DETAILS where client_id = id1;
select zip into :block7.zip from CLIENT_DETAILS where client_id = id1;
select county into :block7.county from CLIENT_DETAILS where client_id = id1;
select phone into :block7.phone from CLIENT_DETAILS where client_id = id1;
select email into :block7.email from CLIENT_DETAILS where client_id = id1;
selectsubmitter_id into :block7.submitter_id from CLIENT_DETAILS where client_id = id1;
selectsub_first_name into :block7.sub_first_name from CLIENT_DETAILS where client_id = id1;
selectsub_last_name into :block7.sub_last_name from CLIENT_DETAILS where client_id = id1;
select username into :block7.username from CLIENT_DETAILS where client_id = id1;
select password into :block7.password from CLIENT_DETAILS where client_id = id1;
select comments into :block7.comments from CLIENT_DETAILS where client_id = id1;
go_block('block60');
go_item('block60.text_item62');
END;
3. Client info frame – This frame is filled automatically and cannot be changed here. It takes the
parameter from client search page and displays all the information about the client.
4. If we wish to change any value in the CLIENT INFO then we can make the change here and press
ENTER key to save it.
DECLARE
BEGIN
update CLIENT_DETAILS set client_id= :BLOCK7.client_id ,first_name = :BLOCK7.first_name , last_name
= :BLOCK7.last_name, doc = :BLOCK7.doc, address= :BLOCK7.address,
city=:BLOCK7.city,state=:BLOCK7.state,zip=:BLOCK7.zip,county=:BLOCK7.county,email=:BLOCK7.email,p
hone=:BLOCK7.phone,submitter_id=:BLOCK7.submitter_id,sub_first_name=:BLOCK7.sub_first_name,su
b_last_name=:BLOCK7.sub_last_name,username=:BLOCK7.username,password=:BLOCK7.password,com
ments=:BLOCK7.comments where client_id = :BLOCK7.client_id;
EXCEPTION
when DUP_VAL_ON_INDEX then
message('CLIENT ID NOT RECOGNIZED');
END;
5. For entry for a new client we have to go back to client_searchpage to search the user and press
ENTER in that page to come to this page. It helps in removing any discrepancies while entering
values.
6. Soil sample info frame – this frame is for entering the value of soil sample.
7. The client ID is automatically filled.
8. Click on client sample ID and enter the value given by the client.
9. When we click on the SOIL SAMPLE INFO FRAME We will get the client ID filled automatically.
10. For that purpose we have a Trigger on client ID text fields
11. :block60.text_item62 := :BLOCK7.CLIENT_ID; -- this copies the value from CLIENT_INFO FRAME -
CLIENT_ID
12. This is a custom form so the navigation was done manually. In the property pallet of all the fields we
change the NEXT NAVIGATION FIELD to the next item we want to go.
13. While running the tool just press tab as everything is done.
14. LAB_ID is generated automatically for the first time as it takes value from LAB_ID_TRACKER table
with the help of code written in the POST_TEXT_ITEM trigger in CLIENT_SAMPLE_ID.
declare
-- x number;
y number;
begin
select max(coalesce(lab_id,0))+1 into y from lab_id_tracker;
:TEXT_ITEM103 :=y;
end;
15. The next LAB_IDs are generated by adding 1 to the previous LAB_ID. This is done in this way to make
it easy to enter values of all the soil info without maintaining the requirement of entering
consecutive LAB_ID.
16. Crop code and test code have a check on them to accept only accepted value listed in right hand
side of page. It does not allow any invalid value.
17. Both CROP_CODE and TEST_CODE fields have a POST_TEXT_ITEM trigger on them.
18. For CROP_CODE
DECLARE
a varchar2(130);
b number;
BEGIN
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
select count(crop_name) into b from FARM_CROP_DETAILS where crop_code =:text_item154;
if b=0 then
message('CROP CODE NOT RECOGNIZED');
raiseform_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
else
selectcrop_name into a from FARM_CROP_DETAILS where crop_code =:text_item154;
message(a);
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
END IF;
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
--set_item_property('block60.TEXT_ITEM154', next_navigation_item,'block60.TEXT_ITEM164');
EXCEPTION
whenno_data_found then message ('no data');
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
END;
19. For TEST_CODE
DECLARE
a varchar2(130);
b number;
BEGIN
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
select count(TEST_code) into b from FARM_SOIL_TEST_SERIES_CODE where TEST_code
=:text_item164;
if b=0 then
message('TEST CODE NOT RECOGNIZED');
raiseform_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
else
select TESTS into a from FARM_SOIL_TEST_SERIES_CODE where TEST_code =:text_item164;
message(a);
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
END IF;
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
--set_item_property('block60.TEXT_ITEM154', next_navigation_item,'block60.TEXT_ITEM164');
EXCEPTION
whenno_data_found then message ('no data of test');
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
END;
20. These value are dynamically matched with the values in the FARM_CROP_DETAILSand
FARM_SOIL_TEST_SERIES_CODE table .
21. These values can be edited from MENU >FARM_PRODUCTS> EDIT VALUES tab.
22. All the rows except row 1 are disabled.
23. After entering 1 row press ENTER to save the values in database and enable the next row for entry
of a new information for same client.
DECLARE
BEGIN
insert into HR.FARM_SOIL_FERT_SAMPLE_INFO
values(:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM93,:BLOCK60.TEXT_ITEM1
03,:BLOCK60.TEXT_ITEM113,:BLOCK60.TEXT_ITEM124,:BLOCK60.RADIO_GROUP134,:BLOCK60.TEXT_ITE
M154,:BLOCK60.TEXT_ITEM164,:BLOCK60.TEXT_ITEM343);
COMMIT;
insert into HR.lab_id_tracker
values(:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM
113,:BLOCK60.TEXT_ITEM93);
COMMIT;
SET_ITEM_PROPERTY ( 'BLOCK60.ITEM73',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.ITEM73',background_color,'r88g100b75');
GO_ITEM('BLOCK60.ITEM73');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM84',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM84',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM94',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM94',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM104',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM104',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM114',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM114',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM125',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM125',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.radio_group183',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.radio_group183',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM155',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM155',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM165',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM165',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM344',ENABLED ,PROPERTY_TRUE);
SET_ITEM_PROPERTY ( 'BLOCK60.push_button175',ENABLED ,PROPERTY_TRUE);
SET_ITEM_PROPERTY ( 'BLOCK60.push_button211',ENABLED ,PROPERTY_TRUE);
GO_ITEM('BLOCK60.ITEM73');
--message('color');
END;
24. The DELETE button delete any information entered.
DECLARE
BEGIN
DELETE FROM HR.FARM_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID = :BLOCK60.TEXT_ITEM104;
DELETE FROM HR.lab_id_tracker WHERE LAB_ID = :BLOCK60.TEXT_ITEM104;
commit;
GO_ITEM('BLOCK60.ITEM73');
END;
25. After the last row is filled press ENTER/CLEAR button to clear the whole frame and enter new value.
It just clears the frame and all the previous rows entered previously are saved in the database.
declare
begin
insert into HR.FARM_SOIL_FERT_SAMPLE_INFO
values(:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM101,:BLOCK60.TEXT_ITEM
111,:BLOCK60.TEXT_ITEM121,:BLOCK60.TEXT_ITEM132,:BLOCK60.RADIO_GROUP204,:BLOCK60.TEXT_IT
EM162,:BLOCK60.TEXT_ITEM172,:BLOCK60.TEXT_ITEM351);
commit;
insert into HR.lab_id_tracker
values(:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM
121,:BLOCK60.TEXT_ITEM101);
commit;
go_item ('BLOCK60');
clear_block;
GO_ITEM('BLOCK60.ITEM62');
END;
26. BACK TO SEARCH button takes back to the client search page for entering new information.
27. new_form('C:projclient_search.fmx',no_rollback,no_query_only,share_library_data);
28. CLEAR FORM clears the form.
declare
begin
GO_block('BLOCK7');
CLEAR_BLOCK(no_validate);
GO_block('BLOCK60');
CLEAR_BLOCK(no_validate);
message('d');
end;
SOIL INFO ENTRY PAGE(FOR NEW USERS)
NAME - NEW_USER_SOILINFO.fmx
1. THIS form is used to enter the user information and the soil information for any new client when
the client is not already present in the system.
2. it is almost the same as the above explained form with 2-3 modification.
3. To come to this page we have to navigate through the MENU BAR >FARM PRODUCTS>SOIL INFO
ENTRY(N) .
4. The CLIENT INFORMATION FRAME has a CLIENT ID field which is auto generated and no parameter
passing is being done as in the last case.
5. Here the WHEN_NEW_FORM_INSTANCE Trigger is quite different.
DECLARE
id1 varchar(10);
BEGIN
read_image_file('C:projlogo.jpg','any','image4');
SELECT to_date(sysdate,'dd-mon-yy') into :date FROM dual;
select max(client_id)+1 into id1 from hr.client_details;
message('The new grower ID is '|| id1);
:BLOCK7.client_id := id1;
END;
This code checks the maximum CLIENT_ID from CLIENT_DETAILS TABLE and adds 1 to generate new ID.
6. The client information frame is for entering the value of client details.
7. The text boxes have individual checks on them like:
8. Id – number only (auto)
9. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to
FM999999999
10. Doc – sysdate(auto) can be changed (date of profile creation)
SELECT to_date(sysdate,'dd-mon-yy') into :DOC FROM dual;
11. Zip – 5 digit number only
12. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to 99999
13. Phone – 10 digit number only
14. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to 9999999999
15. Email – in the format of ‘xyz@ab.com’ only
16. For this we have a POST_TEXT_ITEM trigger on EMAIL Text field.
DECLARE
v_emailvarchar2(100);
v_length number(10);
v_errorvarchar2(10):='OK';
v_rates number(5):=0;
v_dots number(5):=0;
v_spfoundboolean;
v_retvarchar2(100);
BEGIN
v_email := :email;
v_length:=length(v_email);
fori in 1..v_length loop
ifsubstr(v_email,i,1)='@' then ---counting @
v_rates:=v_rates+1;
end if;
ifsubstr(v_email,i,1)='.' then ---counting dots
v_dots:=v_dots+1;
end if;
end loop;
--message (v_length);
--if v_length = 0 then
--gotoexitif;
ifascii(substr(v_email,1,1)) between 48 and 57 then
v_error:='SN';
elsifascii(substr(v_email,1,1)) not between 97 and 122 then
v_error:='FS';
elsif
v_rates =0 or v_dots = 0 then
message ('Incomplete email address');
elsif notv_rates=1 or v_dots> 2 then
v_error:='SE';
elsifv_dots =2 then
ifinstr(v_email,'.',1,2) <instr(v_email,'@') then
v_error:='DFM';
elsif abs(instr(v_email,'.',1,2)-instr(v_email,'@'))=1 then
v_error:='DFM';
elsif abs(instr(v_email,'.')-instr(v_email,'@'))=1 then
v_error:='DFM';
elsifinstr(v_email,'@') not between instr(v_email,'.') and instr(v_email,'.',1,2) then
v_error:='DFM';
end if;
elsifv_dots=1 then
ifinstr(v_email,'@') >instr(v_email,'.') then
v_error:='FM';
elsif abs(instr(v_email,'.')-instr(v_email,'@'))=1 then
v_error:='FM';
END IF;
END IF;
select decode(v_error,'OK','Emailverified','SE','Single Email Allowed','DFM','format not matched
email@removed',
'SN','Starting Number found','FS','First Special Character found','FM','Wrong format email@removed')
intov_ret from dual;
message(v_ret);
END;
17. Username and password for future use. Optional to fill it.
18. ENTER button saves the info in the database.
DECLARE
BEGIN
insert into HR.CLIENT_DETAILS
values(:BLOCK7.client_id,:BLOCK7.first_name,:BLOCK7.last_name,:BLOCK7.doc,:BLOCK7.address,:BLOCK
7.city,:BLOCK7.state,:BLOCK7.zip,:BLOCK7.county,:BLOCK7.email,:BLOCK7.phone,:BLOCK7.submitter_id,:
BLOCK7.sub_first_name,:BLOCK7.sub_last_name,:BLOCK7.username,:BLOCK7.password,:BLOCK7.comm
ents);
COMMIT;
EXCEPTION
when DUP_VAL_ON_INDEX then
message('CLIENT ID NOT RECOGNIZED');
END;
19. Soil information frame works same as the form in soil information entry form for existing users with
several checks and automated data entry.
20. After entering the user information click on client id in SOIL INFORMATION frame end fill the form
with ENTER button press on every individual row entry.
21. Crop details and test details display area for reference purpose.
22. When we click on the SOIL SAMPLE INFO FRAME We will get the client ID filled automatically.
23. For that purpose we have a Trigger on client ID text fields
24. :block60.text_item62 := :BLOCK7.CLIENT_ID; -- this copies the value from CLIENT_INFO FRAME -
CLIENT_ID
25. This is a custom form so the navigation was done manually. In the property pallet of all the fields
we change the NEXT NAVIGATION FIELD to the next item we want to go.
26. While running the tool just pre tab as everything is done.
27. CLIENT_SAMPLE_ID has a POST_TEXT_ITEM trigger on it to generate the next consecutive LAB ID
and TOOL SAMPLE ID.
DECLARE
x number;
y number;
BEGIN
select max(coalesce(tool_sample_id,0))+1 into x from lab_id_tracker;
:TEXT_ITEM93 :=x;
select max(coalesce(lab_id,0))+1 into y from lab_id_tracker;
:TEXT_ITEM103 :=y;
END;
28. LAB_ID is generated automatically for the first time as it takes value from LAB_ID_TRACKER table
with the help of code written in the POST_TEXT_ITEM trigger in CLIENT_SAMPLE_ID.
declare
-- x number;
y number;
begin
select max(coalesce(lab_id,0))+1 into y from lab_id_tracker;
:TEXT_ITEM103 :=y;
end;
29. The next LAB_IDs are generated by adding 1 to the previous LAB_ID. This is done in this way to
make it easy to enter values of all the soil info without maintaining the requirement of entering
consecutive LAB_ID.
30. Crop code and test code have a check on them to accept only accepted value listed in right hand
side of page. It does not allow any invalid value.
31. Both CROP_CODE and TEST_CODE fields have a POST_TEXT_ITEM trigger on them.
32. For CROP_CODE
DECLARE
a varchar2(130);
b number;
BEGIN
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
select count(crop_name) into b from FARM_CROP_DETAILS where crop_code =:text_item154;
if b=0 then
message('CROP CODE NOT RECOGNIZED');
raiseform_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
else
selectcrop_name into a from FARM_CROP_DETAILS where crop_code =:text_item154;
message(a);
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
END IF;
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
--set_item_property('block60.TEXT_ITEM154', next_navigation_item,'block60.TEXT_ITEM164');
EXCEPTION
whenno_data_found then message ('no data');
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
END;
33. For TEST_CODE
DECLARE
a varchar2(130);
b number;
BEGIN
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
select count(TEST_code) into b from FARM_SOIL_TEST_SERIES_CODE where TEST_code
=:text_item164;
if b=0 then
message('TEST CODE NOT RECOGNIZED');
raiseform_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
else
select TESTS into a from FARM_SOIL_TEST_SERIES_CODE where TEST_code =:text_item164;
message(a);
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
END IF;
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
--set_item_property('block60.TEXT_ITEM154', next_navigation_item,'block60.TEXT_ITEM164');
EXCEPTION
whenno_data_found then message ('no data of test');
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
END;
34. These value are dynamically matched with the values in the FARM_CROP_DETAILSand
FARM_SOIL_TEST_SERIES_CODE table .
35. These values can be edited from MENU > EDIT VALUES tab.
36. All the rows except row 1 are disabled.
37. After entering 1 row press ENTER to save the values in database and enable the next row for entry
of a new information for same client.
DECLARE
BEGIN
insert into HR.FARM_SOIL_FERT_SAMPLE_INFO
values(:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM93,:BLOCK60.TEXT_ITEM1
03,:BLOCK60.TEXT_ITEM113,:BLOCK60.TEXT_ITEM124,:BLOCK60.RADIO_GROUP134,:BLOCK60.TEXT_ITE
M154,:BLOCK60.TEXT_ITEM164,:BLOCK60.TEXT_ITEM343);
COMMIT;
insert into HR.lab_id_tracker
values(:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM
113,:BLOCK60.TEXT_ITEM93);
COMMIT;
SET_ITEM_PROPERTY ( 'BLOCK60.ITEM73',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.ITEM73',background_color,'r88g100b75');
GO_ITEM('BLOCK60.ITEM73');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM84',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM84',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM94',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM94',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM104',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM104',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM114',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM114',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM125',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM125',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.radio_group183',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.radio_group183',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM155',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM155',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM165',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.text_ITEM165',background_color,'r88g100b75');
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM344',ENABLED ,PROPERTY_TRUE);
SET_ITEM_PROPERTY ( 'BLOCK60.push_button175',ENABLED ,PROPERTY_TRUE);
SET_ITEM_PROPERTY ( 'BLOCK60.push_button211',ENABLED ,PROPERTY_TRUE);
GO_ITEM('BLOCK60.ITEM73');
--message('color');
END;
38. The DELETE button delete any information entered.
DECLARE
BEGIN
DELETE FROM HR.FARM_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID = :BLOCK60.TEXT_ITEM104;
DELETE FROM HR.lab_id_tracker WHERE LAB_ID = :BLOCK60.TEXT_ITEM104;
commit;
GO_ITEM('BLOCK60.ITEM73');
END;
39. After the last row is filled press ENTER/CLEAR button to clear the whole frame and enter new value.
It just clears the frame and all the previous rows entered previously are saved in the database.
declare
begin
insert into HR.FARM_SOIL_FERT_SAMPLE_INFO
values(:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM101,:BLOCK60.TEXT_ITEM
111,:BLOCK60.TEXT_ITEM121,:BLOCK60.TEXT_ITEM132,:BLOCK60.RADIO_GROUP204,:BLOCK60.TEXT_IT
EM162,:BLOCK60.TEXT_ITEM172,:BLOCK60.TEXT_ITEM351);
commit;
insert into HR.lab_id_tracker
values(:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM
121,:BLOCK60.TEXT_ITEM101);
commit;
go_item ('BLOCK60');
clear_block;
GO_ITEM('BLOCK60.ITEM62');
END;
40. BACK TO SEARCH button takes back to the client search page for entering new information.
41. new_form('C:projclient_search.fmx',no_rollback,no_query_only,share_library_data);
42. CLEAR FORM clears the form.
declare
begin
GO_block('BLOCK7');
CLEAR_BLOCK(no_validate);
GO_block('BLOCK60');
CLEAR_BLOCK(no_validate);
message('d');
end;
SOIL FERTILITY TEST GENERATION AND REPORT GENERATION
NAME= FERT_TEST_RESULT_ENTRY.fmx
This is a form to enter the test results values received from lab and generate the recommendations based on
the values.
1. This form consists of MENU BAR, HEADER and 3 frames.
2. MENU BAR AND THE HEADER are same as all the other forms.
3. TEST INFORMATION- this frame works on the LAB ID for each soil sample tested. Enter the LAB ID
associated with soil sample and press TAB. All information about the tests performed are auto filled in
the rest of the fields for checking purpose.
4. For this we have a POST_TEXT_ITEM Trigger on LAB ID text field.
DECLARE
test varchar2(70);
BEGIN
selectclient_id into :client_id from FARM_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
select CLIENT_SAMPLE_ID into :CLIENT_SAMPLE_ID from FARM_SOIL_FERT_SAMPLE_INFO
where lab_id =:lab_id;
selecttool_SAMPLE_ID into :tool_SAMPLE_ID from FARM_SOIL_FERT_SAMPLE_INFO where lab_id
=:lab_id;
selectfirst_name into :first_name from client_details where client_id= :client_id;
selectlast_name into :last_name from client_details where client_id= :client_id;
selectto_date(sysdate,'dd-mon-yy') into :dor from dual;
select TEST_SERIES_CODE into :test_method from FARM_SOIL_FERT_SAMPLE_INFO where
lab_id =:lab_id;
selecttillage_depth into :tillage_depth from FARM_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
selectcrop_code into :crop_code from FARM_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
select tests into test from FARM_SOIL_TEST_SERIES_CODE where test_code = :test_method;
message (test);
EXCEPTION
when NO_DATA_FOUND then
message ('The value entered does not have any records present. Please recheck the Lab ID. ');
END;
5.
6. TEST RESULTS – this frame is for entering the values of the test results we receive from the lab.
7. Then press COMPUTE button to generate all the recommendation. And fill the next frame.
8. For this we have a WHEN_BUTTON_PRESSED trigger with the following code.
DECLARE
P1 NUMBER:=0;
C NUMBER:=0;
PR1 VARCHAR2(3);
P_REC2 NUMBER:=0;
V_TEST_TYPE VARCHAR2(10);
V_TEST_CODE NUMBER:=0;
K1 NUMBER:=0;
KR1 VARCHAR2 (3);
KF_REC2 NUMBER:=0;
KS_REC2 NUMBER:=0;
ZN1 NUMBER(6,2):=0;
V_ZN_BROAD NUMBER :=0;
V_ZN_BAND NUMBER :=0;
BPH1 NUMBER(6,2):=0;
V_TILLAGE_DEPTH NUMBER:=0;
PH1 NUMBER(7):=0;
PH2 NUMBER(7):=0;
PH3 NUMBER(7):=0;
BEGIN
C:=:CROP_CODE;
P1:= :P;
IF P1 IS NULL THEN NULL;
ELSE
--P1:= NVL(:P,0);
--CALCULATING THE PHOSPHORUS RECOMMENDATION
SELECT PR INTO PR1 FROM FARM_P_RANGE WHERE CROP_CODE = C AND P_MIN<= P1 AND P_MAX >=
P1;
IF PR1 = 'H' OR PR1 = 'VH' THEN
:P_REC := 0;
ELSE
SELECT P_REC INTO P_REC2 FROM FARM_RECOMMENDATION_BRAY_M3 WHERE CROP_CODE=C
AND VALUE = PR1;
:P_REC := P_REC2;
--MESSAGE (P_REC2);
END IF;
END IF;
-- CALCULATING THE POTASSIUM RECOMMENDATION
K1:= :K;
IF K1 IS NULL THEN NULL;
ELSE
--K1:=NVL(:K,0);
SELECT TEST_TYPE INTO V_TEST_TYPE FROM FARM_SOIL_TEST_SERIES_CODE WHERE
TEST_CODE=:TEST_METHOD;
SELECT KR INTO KR1 FROM FARM_K_RANGE WHERE TEST_TYPE = V_TEST_TYPE AND K_MIN<= K1 AND
K_MAX>=K1;
IF KR1 = 'H' OR KR1 = 'VH' THEN
:K_REC_FINE:=0;
:K_REC_SANDY:=0;
ELSE
SELECT KF_REC INTO KF_REC2 FROM FARM_RECOMMENDATION_BRAY_M3 WHERE
CROP_CODE=C AND VALUE = KR1;
SELECT KS_REC INTO KS_REC2 FROM FARM_RECOMMENDATION_BRAY_M3 WHERE
CROP_CODE=C AND VALUE = KR1;
:K_REC_FINE:=KF_REC2;
:K_REC_SANDY:=KS_REC2;
END IF;
END IF;
--CALCULATING FOR ZINC RECOMMENDATION
ZN1:= :ZN;
IF ZN1 IS NULL THEN NULL;
ELSE
SELECT ZN_BROAD INTO V_ZN_BROAD FROM FARM_ZN_RANGE WHERE ZN_MIN <= ZN1 AND
ZN_MAX >= ZN1;
SELECT ZN_BAND INTO V_ZN_BAND FROM FARM_ZN_RANGE WHERE ZN_MIN <= ZN1 AND
ZN_MAX >= ZN1;
:ZN_BROAD := V_ZN_BROAD;
:ZN_BAND :=V_ZN_BAND;
END IF;
--CALCULATING FOR THE PH CONTENT RECOMMENDATION
-- (38619 - (5915*C3))*(B3*0.167)
BPH1:= :BPH;
V_TILLAGE_DEPTH :=:TILLAGE_DEPTH;
IF BPH1 IS NULL THEN NULL;
ELSE
PH1 := (38619 - (5915*BPH1))*(V_TILLAGE_DEPTH*0.167) ;
PH2 := (49886 - (7245 * BPH1 )) * (V_TILLAGE_DEPTH * 0.167);
PH3 := (58776 - (8244*BPH1))*(V_TILLAGE_DEPTH*0.167);
END IF;
--ROUNDING PH6.0 VALUES TO NEAREST 100 FOR +VE VALUES. -VE ARE CHANGED TO 0.
IF PH1 <0 THEN
PH1 :=0;
:PH_1:=PH1;
ELSE
SELECT ROUND(PH1,-2) INTO :PH_1 FROM DUAL;
END IF;
--ROUNDING PH6.5 VALUES TO NEAREST 100 FOR +VE VALUES. -VE ARE CHANGED TO 0.
IF PH2 <0 THEN
PH2 :=0;
:PH_2:=PH2;
ELSE
SELECT ROUND(PH2,-2) INTO :PH_2 FROM DUAL;
END IF;
--ROUNDING PH6.9 VALUES TO NEAREST 100 FOR +VE VALUES. -VE ARE CHANGED TO 0.
IF PH3 <0 THEN
PH3 :=0;
:PH_3:=PH3;
ELSE
SELECT ROUND(PH3,-2) INTO :PH_3 FROM DUAL;
END IF;
-- DISPLAYING COMMENTS BASED ON CROP CODES
SELECT COMMENTS INTO :COMMENTS FROM FARM_COMMENTS WHERE CROP_CODE = C;
EXCEPTION
WHEN OTHERS THEN
MESSAGE('UNABLE TO GENERATE RECOMMENDATIONS. PLEASE CHECK THE VALUES ENTERED.');
END;
9.
10. RECOMMENDATIONS – this frame shows all the recommendations generated by the system based on
the calculations provided along with the comments.
11. Press SAVE button to save all information in the database.(important)
12. For this we have a WHEN_BUTTON_PRESSED Trigger with COMMIT_FORM; command.
13. CLEAR FORM – clears the form for a new entry based on different LAB ID.
14. For this we have a WHEN_BUTTON_PRESSED Trigger with
GO_BLOCK('FARM_SOIL_FERT_TEST_RESULTS');
CLEAR_block;
15. REPORT – takes to the report generation form to generate the reports based on individual client ID and
the date when the results were entered.
16. For this we have a WHEN_BUTTON_PRESSED Trigger with
new_form('c:projFERT_TEST_REPORT.fmx',no_rollback,no_query_only,share_library_data);
FARM TEST RESULT REPORT GENERATION
NAME – FERT_TEST_REPORT.FMX
Report - FERT_RESULT_REPORT5.RDF
This is a form from which will generate the results report in pdf format.
1. The search fields are to be used to tell the system which LAB _ID report is to be called.
2. CLIENT_ID- to specify ID of the client.
3. This has a LOV attached with it to select the names of the client.
4. The LOV was prepared using the LOV wizard and CLIENT ID text field was attached to it.
5. START_ID & END_ID are to give consecutive LAB_IDs for the same client.
6. If the client are different for all the LAB ID given it will show an ERROR.
7. The LAB ID should be consecutive or same if only 1 LAB ID to be used.
8. When START_LAB_ID is entered the END LAB ID copies the ID so as to make it easier for the user to
enter next LAB ID in continuation.
9. For this we use POST-TEXT-ITEM on START LAB ID
BEGIN
:BLOCK2.TEXT_ITEM6 :=:BLOCK2.TEXT_ITEM5;
END;
10. To make a form to call report we first make a REPORT OBJECT in the OBJECT NAVIGATOR.
11. This form has a REPORT OBJECT named REP which is used in the code given below.
12. When SHOW REPORT button is pressed a new tab is opened in the browser where the report is
generated and shown in PDF format. We can SAVE and PRINT the report from there.
13. For this we use WHEN_BUTTON_PRESSED trigger on SHOW REPORT button with following code to call
the report.
DECLARE
--VARIABLES FOR REPORT GENERATION
REPID REPORT_OBJECT;
V_REP VARCHAR2(200);
REP_STATUS VARCHAR2(20);
PLID PARAMLIST;
STR_REPORT_SERVER_JOB VARCHAR2(300);
STR_JOB_ID VARCHAR2(300);
STR_URL VARCHAR2(300);
ID NUMBER;--VARIABLES FOR CLIENT CHECK.
ID2 NUMBER;
L_ID NUMBER;
L_ID2 NUMBER;
LEN NUMBER:=0;
I NUMBER:=0;
CTR NUMBER:=0;
BEGIN
--CODE FOR CHECKING IF ALL THE CLIENTS ARE SAME FOR ALL THE LAB ID GIVEN.
L_ID :=:TEXT_ITEM5;--START_ID
L_ID2 :=:TEXT_ITEM6;--END_ID
LEN := L_ID2-L_ID;
SELECT CLIENT_ID INTO ID FROM FARM_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID;
FOR I IN 0 .. LEN LOOP
SELECT CLIENT_ID INTO ID2 FROM FARM_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+I;
IF ID2<>ID THEN
CTR:= CTR+1;
END IF;
ID2:=0;
END LOOP;
IF CTR>0 THEN
MESSAGE('PLEASE CHECK THE LAB ID AS ALL THE CLIENTS ARE NOT SAME.');
ELSE
-- REPORT GENERATION
PLID := GET_PARAMETER_LIST('TMP');
IF NOT ID_NULL(PLID) THEN
DESTROY_PARAMETER_LIST( PLID );
END IF;
PLID := CREATE_PARAMETER_LIST('TMP');
-- ALTERNATE WAY TO GIVE PARAMETERS.
--ADD_PARAMETER(PLID,'ID',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM4);
--ADD_PARAMETER(PLID,'STARTDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM5);
--ADD_PARAMETER(PLID,'ENDDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM6);
ADD_PARAMETER(PLID, 'PARAMFORM', TEXT_PARAMETER, 'NO');
REPID := FIND_REPORT_OBJECT('REP');
SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_DESTYPE,CACHE);
SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_OTHER,'PARAMFORM=NO');
SET_REPORT_OBJECT_PROPERTY(REPID, REPORT_FILENAME, 'C:PROJFERT_RESULT_REPORT5.RDF');
SET_REPORT_OBJECT_PROPERTY(REPID, REPORT_EXECUTION_MODE, BATCH);
SET_REPORT_OBJECT_PROPERTY(REPID, REPORT_SERVER, 'REP_SOILTESTSERV');
SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_OTHER,'PARAMFORM=NO
STARTID='||:BLOCK2.TEXT_ITEM5||' ENDID='||:BLOCK2.TEXT_ITEM6);
STR_REPORT_SERVER_JOB := RUN_REPORT_OBJECT(REPID);
-- MESSAGE(STR_REPORT_SERVER_JOB);
REP_STATUS := REPORT_OBJECT_STATUS(STR_REPORT_SERVER_JOB);
MESSAGE(REP_STATUS);
WHILE REP_STATUS IN ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
REP_STATUS := REPORT_OBJECT_STATUS(STR_REPORT_SERVER_JOB);
END LOOP;
IF REP_STATUS = 'FINISHED' THEN
--MESSAGE(STR_REPORT_SERVER_JOB);
STR_JOB_ID := SUBSTR(STR_REPORT_SERVER_JOB, LENGTH('REP_SOILTESTSERV') + 2,
LENGTH(STR_REPORT_SERVER_JOB));
STR_URL := '/REPORTS/RWSERVLET/GETJOBID' || STR_JOB_ID || '?SERVER=REP_SOILTESTSERV';
WEB.SHOW_DOCUMENT(STR_URL, '_BLANK');
DESTROY_PARAMETER_LIST(PLID);
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN MESSAGE ('PLEASE CHECK THE LAB ID ENTERED.');
END;
14. NEW REPORT button clears the form and we can generate a new report. It has a
WHEN_BUTTON_PRESSED button with command as CLEAR_BLOCK;
15.
REPORT
1. The report FERT_RESULT_REPORT5.RDF is made with the help of REPORT BUILDER. To edit the
reports open REPORT BUIDER icon on desktop. This is a manual report.
2. Open the concerned report and go to REPORT WIZARD and do the required changes.
3. Any changes in the report can be done in DATA MODEL editor or the PAPER LAYOUT tab.
4. DATA MODEL shows the columns and fields being used in the report.
5. In this report we have 5 sections.
6. A. IOWA STATE UNIVERSITY ADDRESS AND AGRONOMY DEPARTMENT INFORMATION.
7. B. CLIENT INFORMATION AND DATE OF REPORT GENERATION.
8. These 2 parts are non-repeating so these are not in the recurring form.
9. The client information and the date values are fetched from the FORMULA column CF_1 – CF_8
10. The parent module starts after these 2 parts.
11. C.LAB TEST RESULTS AND FERTILIZER AND LIME SUGGESTIONS are separate repeating form which
receives the value from the FARM_TEST_RESULTS table for the LAB_ID given.
12. These fields fetch values from the Q_1 query in the data model.
13. D. SUGGESTIONS.
14. This section displays the suggestion based on the crop codes. It is a repeating form but it will show
only distinct values for suggestion. If the same crop code is repeated several times it shows only 1
copy of the suggestions and saves page.
15. For this we have a Q_2 in the data model which shows only distinct values.
16. E. ADDITIONAL COMMENTS.
17. This field shows any additional comments If present in the database. If additional comments are
not present then this field will be blank.
18. This depends on the Q_1 in the data model.
19. All the definition of queries and formula are given below.
20. Q_1 – used by LAB TEST RESULTS, RECOMMENDATIONS
SELECT ALL FARM_SOIL_FERT_TEST_RESULTS.CLIENT_SAMPLE_ID,
FARM_SOIL_FERT_TEST_RESULTS.TOOL_SAMPLE_ID, FARM_SOIL_FERT_TEST_RESULTS.LAB_ID,
FARM_SOIL_FERT_TEST_RESULTS.DOR, FARM_SOIL_FERT_TEST_RESULTS.CLIENT_ID,
FARM_SOIL_FERT_TEST_RESULTS.FIRST_NAME, FARM_SOIL_FERT_TEST_RESULTS.LAST_NAME,
FARM_SOIL_FERT_TEST_RESULTS.TEST_METHOD, FARM_SOIL_FERT_TEST_RESULTS.TILLAGE_DEPTH,
FARM_SOIL_FERT_TEST_RESULTS.CROP_CODE, FARM_SOIL_FERT_TEST_RESULTS.OM,
FARM_SOIL_FERT_TEST_RESULTS.P, FARM_SOIL_FERT_TEST_RESULTS.K,
FARM_SOIL_FERT_TEST_RESULTS.ZN,
FARM_SOIL_FERT_TEST_RESULTS.PH, FARM_SOIL_FERT_TEST_RESULTS.BPH,
FARM_SOIL_FERT_TEST_RESULTS.P_REC, FARM_SOIL_FERT_TEST_RESULTS.K_REC_FINE,
FARM_SOIL_FERT_TEST_RESULTS.K_REC_SANDY, FARM_SOIL_FERT_TEST_RESULTS.ZN_BROAD,
FARM_SOIL_FERT_TEST_RESULTS.ZN_BAND, FARM_SOIL_FERT_TEST_RESULTS.PH_1,
FARM_SOIL_FERT_TEST_RESULTS.PH_2, FARM_SOIL_FERT_TEST_RESULTS.PH_3,
FARM_SOIL_FERT_TEST_RESULTS.COMMENTS,
FARM_SOIL_FERT_TEST_RESULTS.COMMENTS2
FROM FARM_SOIL_FERT_TEST_RESULTS where FARM_SOIL_FERT_TEST_RESULTS .LAB_ID >= :STARTID
and FARM_SOIL_FERT_TEST_RESULTS .LAB_ID <= :ENDID;
This code has 2 parameter STARTID and ENDID. It takes this as input and fetch all the rows in database
regarding these 2 values. These values are to be in consecutive numbers.
21. Q_2- USED BY THE COMMENTS BLOCK.
SELECT distinct (comments) FROM FARM_SOIL_FERT_TEST_RESULTS where
FARM_SOIL_FERT_TEST_RESULTS .LAB_ID >= :STARTID and FARM_SOIL_FERT_TEST_RESULTS .LAB_ID <=
:ENDID;
This code has 2 parameter STARTID and ENDID. It takes this as input and fetch all the rows in database
regarding these 2 values. These values are to be in consecutive numbers. It only fetches the distinct values.
22. CF_1- displays FIRST NAME
function CF_1Formula return Char is
fname varchar2(25);
id number;
begin
selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid;
select FIRST_NAME into fname from client_details where client_id = ID;
return (fname);
exception
when others then
return 0;
end;
23. CF_2 – displays LAST NAME
function CF_2Formula return Char is
id number;
lname varchar2(25);
begin
selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid;
selectlasT_NAME into lname from client_details where client_id = ID;
return (lname);
exception
when others then
return 0;
end;
24. CF_3 – displays ADDRESS
function CF_3Formula return Char is
addr varchar2(70);
id number;
begin
selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid;
select address into addr from client_details where client_id = ID;
return (addr);
exception
when others then
return 0;
end;
25. CF_4 – displays CITY
function CF_4Formula return Char is
vcity varchar2 (15);
id number;
begin
selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid;
select city into vcity from client_details where client_id = ID;
return (vcity);
exception
when others then
return 0;
end;
26. CF_5 – displays STATE
function CF_5Formula return Char is
id number;
vstate varchar2 (15);
begin
selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid;
select state into vstate from client_details where client_id = ID;
return (vstate);
exception
when others then
return 0;
end;
27. CF_6 –displays COUNTY
function CF_6Formula return Char is
id number;
vcounty varchar2 (15);
begin
selectclient_id into id from HR.FARM_SOIL_FERT_TEST_RESULTS where lab_id =
:startid;
select county into vcounty from client_details where client_id = ID;
return (vcounty);
exception
when others then
return 0;
end;
28. CF_7 – displays ZIP
function CF_7Formula return Number is
id number;
vzip number (15);
begin
selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid;
select zip into vzip from client_details where client_id = ID;
return (vzip);
exception
when others then
return 0;
end;
29. CF_8 – displays PHONE NUMBER
function CF_8Formula return Number is
id number;
pno varchar2 (15);
begin
selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid;
select phone into pno from client_details where client_id = ID;
return (pno);
exception
when others then
return 0;
end;
EDIT VALUES FROM FRONT END
1. This form is the homepage for all the forms having forms for editing the values like crop codes, test
codes or the calculation value tables.
2. For any new crops or test value to be added or edited we can go to the respective pages and change
the value.
3. We don’t have to change the calculation code for any recommendation explicitly, we can change the
calculation table value such as P range or K range etc and the calculations are changes in calculations
are done.
4. Only the pH recommendation is hard coded else all the recommendation value are fetched and
matched from the RANGE and RECOMMENDATION table to generate the results.
5. HOME button takes to the tool homepage.
6.
7. FORM NAME- EDIT_PAGE_LINKS.fmx
8. There are 8 links to go to from this page. Each link is connected to the table where the editing is to be
done. This 8 links are-
9. CROP DETAILS EDIT
10. TEST DETAILS EDIT
11. SUGGESTION EDIT
12. RECOMMENDATION VALUE EDIT
13. ZINC RANGE EDIT
14. P RANGE EDIT
15. K RANGE EDIT
16. CLIENT DETAILS EDIT
17. All these links are explained below.
18. HOME page takes to the home page of the LIMS FARMER side.
i. CROP DETAILS EDIT PAGE
19.
Name - FARM_CROP_CODE_EDIT.fmx
20. This form helps in editing the values of the table from frontend. This page is made using the
FARM_CROP_DETAILS table.
21. This form have a new MENU bar with new functionalities.
22. We can search for a term, see the whole table, edit values, save the changes, add new rows, delete
rows etc.
23. ENTER QUERY- search the table for particular value.
24. EXECUTE QUERY – shows the full table value or search result based on enter query.
25. The list of shortcuts are shown in next slide.
26. We can browse through the records using NEXT Key or go into enter QUERY MODE and give the
concerned value and press EXECUTE QUERY to directly go to that value and edit it.
27. After this press SAVE to save all the changes made.
28. The EDIT HOME page takes to the home page of EDIT LINKS.
29. This is the list of all the shortcut from the menu to use this page.
30.
a. TEST SERIES EDIT
1. Name - FARM_TEST_SERIES_CODE_EDIT.fmx
2. This page is made using the FARM_SOIL_TEST_SERIES_CODE table.
3. All the functionalities are same as the previous form.
4. Suggestions edit
5. This page is made using the FARM_COMMENTS table.
6. Name - FARM_SUGG_EDIT.fmx
a. RECOMMENDATION VALUES EDIT
7. Name - FARM_RECO_EDIT.fmx
8. This form is made with FARM_RECOMMENDATION_BRAY_M3 table.
9.
i. ZINC RANGE EDIT
10. Name - FARM_ZN_RANGE_EDIT.fmx
11. This is made with the help of FARM_ZN_RANGE.
a. PHOSPHORUS RANGE EDIT FORM
12. This form is made from the FARM_P_RANGE table.
13. Name - FARM_P_EDIT.fmx
14.
a. POTASSIUM RANGE EDIT FORM
15. Name - FARM_K_EDIT.fmx
16. This form is made from FARM_K_RANGE table
17.
18.CLIENT DETAILS EDIT FORM (CAN BE USED TO SEARCH FOR CLIENT DETAILS ALSO)
Name - FARM_CLIENT_DETAILS_EDIT.fmx
19. This form is made from the CLIENT_DETAILS table.
20.
QUERY PAGES
1. These forms are used to search for the soil sample information and the test results entered for
each client between particular dates.
2. This forms will help to see all the values entered for soil sample but not having results entered.
3. It also helps in answering the queries of clients if they call to check the results.
4. We have to enter the Client details and date for which we want to see the values for.
5. The client details can be entered as LAST NAME or FIRST NAME or CLIENT ID.
6. All these fields have LOVs attached to help search the user easily.
7. The START DATE and END DATE are mandatory and have to be entered manually.
8. This form can show only 25 results at a time so the date has to be entered to fit the values
accordingly.(if the values returned are more than 25 then go to MENU>REPORTS>respective
report)
9. This is only query page and values should not be altered here.
10. SEARCH button executes the search based on the entered values.
11. NEW SEARCH button clears the form to enter new search.
12. There are 2 query page
13. SOIL SAMPLE QUERY page
14. SOIL TEST RESULTS QUERY page
SOIL SAMPLE QUERY PAGE
1.
Name - SOIL_INFO_QUERY.fmx
1. This form consists of 3 parts.
2. The MENU , LOGO and DATE are same as previous forms.
3. SEARCH FIELDS canvas.
4. These are the search fields where FIRST NAME, LAST NAME and CLIENT ID have a LOV (LOV30)
attached with from where we can select the concerned client. We can choose any one from these 3
field to get the value.
5. START DATE and END DATE are the next fields which are mandatory to fill. This gives a time frame to
search for the values of the SOIL INFO.
6. SEARCH button search the details.
DECLARE
ID NUMBER;
STDATE DATE;
ENDDATE DATE;
CNT NUMBER;
BEGIN
ID:= :BLOCK11.CLIENT_ID;
STDATE:=:BLOCK11.START_DATE;
ENDDATE:=:BLOCK11.END_DATE;
SELECT COUNT(LAB_ID) INTO CNT FROM FARM_SOIL_FERT_SAMPLE_INFO WHERE CLIENT_ID = ID AND
DOS >= STDATE AND DOS<= ENDDATE;
-- MESSAGE ('THERE ARE '||CNT||' ENTRIES DURING THE GIVEN PERIOD.');
if :BLOCK11.CLIENT_ID IS NULL OR :BLOCK11.LAST_NAME IS NULL OR :BLOCK11.FIRST_NAME IS NULL
THEN
MESSAGE ('PLEASE ENTER CLIENT INFORMATION. ');
ELSE
IF :BLOCK11.START_DATE is null OR :BLOCK11.START_DATE is null THEN
MESSAGE ('PLEASE ENTER THE TIME PERIOD TO GET RELEVANT INFORMATION. ');
ELSE
IF CNT =0 THEN
MESSAGE ('THERE IS NO ENTRY FOR THE GIVEN INFORMATION. PLEASE CHECK IF SOIL INFO
ENTRY IS PRESENT IN THE SYSTEM.');
ELSIF CNT> 25 THEN
MESSAGE('TOO MANY ENTRIES RETRIEVED.PLEASE REDUCE THE TIME DURATIONOR PLEASE
RUN THE APPROPRIATE REPORT FROM REPORTS TAB.');
ELSE
SET_BLOCK_PROPERTY('FARM_SOIL_FERT_SAMPLE_INFO',DEFAULT_WHERE, 'DOS BETWEEN
NVL('||''''||STDATE||''''||',DOS) AND NVL('||''''||ENDDATE||''''||',DOS)' ||'AND CLIENT_ID='||ID);
GO_BLOCK('FARM_SOIL_FERT_SAMPLE_INFO');
EXECUTE_QUERY;
END IF;
END IF;
END IF;
END;
7. NEW SEARCH clears the form for new search.
GO_BLOCK('BLOCK11');
CLEAR_BLOCK;
GO_BLOCK('FARM_SOIL_FERT_SAMPLE_INFO');
CLEAR_BLOCK;
8. If the result set are more than 25 it give a message 'TOO MANY ENTRIES RETRIEVED.PLEASE REDUCE THE
TIME DURATIONOR PLEASE RUN THE APPROPRIATE REPORT FROM REPORTS TAB’.
SOIL TEST RESULTS QUERY PAGE
Name - RESULT_QUERY.fmx
1. This form consists of 3 parts.
2. The MENU , LOGO and DATE are same as previous forms.
3. SEARCH FIELDS canvas.
4. These are the search fields where FIRST NAME, LAST NAME and CLIENT ID have a LOV (LOV30)
attached with from where we can select the concerned client. We can choose any one from these 3
field to get the value.
5. START DATE and END DATE are the next fields which are mandatory to fill. This gives a time frame to
search for the values of the SOIL INFO.
6. SEARCH button search the details.
DECLARE
ID NUMBER;
STDATE DATE;
ENDDATE DATE;
CNT NUMBER;
BEGIN
ID:= :BLOCK10.CLIENT_ID;
STDATE:=:BLOCK10.START_DATE;
ENDDATE:=:BLOCK10.END_DATE;
SELECT COUNT(LAB_ID) INTO CNT FROM FARM_SOIL_FERT_TEST_RESULTS WHERE CLIENT_ID = ID AND
DOR >= STDATE AND DOR<= ENDDATE;
-- MESSAGE ('THERE ARE '||CNT||' ENTRIES DURING THE GIVEN PERIOD.');
if :BLOCK10.CLIENT_ID IS NULL OR :BLOCK10.LAST_NAME IS NULL OR :BLOCK10.FIRST_NAME IS NULL
THEN
MESSAGE ('PLEASE ENTER CLIENT INFORMATION. ');
ELSE
IF :BLOCK10.START_DATE is null OR :BLOCK10.START_DATE is null THEN
MESSAGE ('PLEASE ENTER THE TIME PERIOD TO GET RELEVANT INFORMATION. ');
ELSE
IF CNT =0 THEN
MESSAGE ('THERE IS NO ENTRY FOR THE GIVEN INFORMATION. PLEASE CHECK IF SOIL INFO
ENTRY IS PRESENT IN THE SYSTEM.');
ELSIF CNT> 25 THEN
MESSAGE('TOO MANY ENTRIES RETRIEVED.PLEASE REDUCE THE TIME DURATIONOR PLEASE
RUN THE APPROPRIATE REPORT FROM REPORTS TAB.');
ELSE
SET_BLOCK_PROPERTY('FARM_SOIL_FERT_TEST_RESULTS',DEFAULT_WHERE, 'DOR BETWEEN
NVL('||''''||STDATE||''''||',DOR) AND NVL('||''''||ENDDATE||''''||',DOR)' ||'AND CLIENT_ID='||ID);
GO_BLOCK('FARM_SOIL_FERT_TEST_RESULTS');
EXECUTE_QUERY;
END IF;
END IF;
END IF;
END;
7. NEW SEARCH clears the form for new search.
GO_BLOCK('BLOCK10');
CLEAR_BLOCK;
GO_BLOCK('FARM_SOIL_FERT_TEST_RESULTS');
CLEAR_BLOCK;
8. If the result set are more than 25 it give a message 'TOO MANY ENTRIES RETRIEVED.PLEASE REDUCE THE
TIME DURATIONOR PLEASE RUN THE APPROPRIATE REPORT FROM REPORTS TAB’.
OTHER REPORTS
There are 3 type of other reports:-
1. RESULT SEARCH REPORT – To view all the results search if the set is bigger than 25 client wise.
2. SOIL INFO FULL REPORT – To view all the soil information if set is bigger than 25 client wise.
3. RESULT PENDING REPORT – To view all the pending result report for which we have soil information
but results are pending. This form calls 2 type of reports one for all client in 1 report another one for
client wise report based on a given time frame.
These reports form are accessible from MENU >REPORTS>FARM PRODUCT REPORT
RESULT SEARCH REPORT
1. Name - RESULT_SEARCH_REPORT.fmx
2.
3. This form has 3 mandatory search fields CLIENT_ID, START DATE, END DATE.
4. CLIENT ID has a LOV attached to it to select a client for whom we are pulling out the data.
5. START DATE and END DATE are to specify the dates for which we are looking for the data.
6. SHOW REPORT button call the report by passing the 3 parameter to the report
report_query_full_details.RDF.
DECLARE
repid REPORT_OBJECT;
v_repVARCHAR2(200);
rep_statusVARCHAR2(20);
plidParamList;
Str_Report_Server_JobVARCHAR2(300);
Str_Job_IDVARCHAR2(300);
Str_URLVARCHAR2(300);
BEGIN
plid := Get_parameter_List('tmp');
IF NOT Id_Null(plid) THEN
Destroy_parameter_List(plid );
END IF;
plid := Create_parameter_List('tmp');
--ADD_PARAMETER(plid,'ID',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM4);
--ADD_PARAMETER(plid,'STARTDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM5);
--ADD_PARAMETER(plid,'ENDDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM6);
Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO');
repid := FIND_REPORT_OBJECT('REP');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME, 'C:projreport_query_full_details.RDF');
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_EXECUTION_MODE, BATCH);
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_SERVER, 'rep_soiltestserv');
--v_rep := RUN_REPORT_OBJECT(repid,plid);
--set_report_object_property(repid,report_other,'ID'||:BLOCK2.TEXT_ITEM4||' paramform=no') ;
--set_report_object_property(repid,report_other,'STARTDATE'||:BLOCK2.TEXT_ITEM5||'
paramform=no') ;
--set_report_object_property(repid,report_other,'ENDDATE'||:BLOCK2.TEXT_ITEM6||' paramform=no')
;
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no ID='||:BLOCK2.TEXT_ITEM4||'
STARTDATE='||:BLOCK2.TEXT_ITEM5||' ENDDATE='||:BLOCK2.TEXT_ITEM6);
-- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no
STARTDATE='||:BLOCK2.TEXT_ITEM5);
-- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no
ENDDATE='||:BLOCK2.TEXT_ITEM6);
Str_Report_Server_Job := RUN_REPORT_OBJECT(repid);
-- message(Str_Report_Server_Job);
rep_status := REPORT_OBJECT_STATUS(Str_Report_Server_Job);
message(rep_status);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(Str_Report_Server_Job);
END LOOP;
IF rep_status = 'FINISHED' THEN
--message(Str_Report_Server_Job);
Str_Job_ID := SUBSTR(Str_Report_Server_Job, LENGTH('rep_soiltestserv') + 2,
LENGTH(Str_Report_Server_Job));
Str_URL := '/reports/rwservlet/getjobid' || Str_Job_ID || '?server=rep_soiltestserv';
WEB.SHOW_DOCUMENT(Str_URL, '_blank');
DESTROY_PARAMETER_LIST(PLID);
end if;
END;
7. NEW REPORT clears the form and prepares the form for a new report.
8. CLEAR_BLOCK;
REPORT_QUERY_FULL_DETAILS.RDF
1. All the reports are made with the help of REPORT BUILDER. To edit the reports open REPORT BUIDER
icon on desktop. This is a manual report.
2. Open the concerned report and go to REPORT WIZARD and do the required changes.
3. Any changes in the report can be done in DATA MODEL editor or the PAPER LAYOUT tab.
4. DATA MODEL shows the columns and fields being used in the report.
This report consists of 3 parts:
1. IOWA STATE information. This is a simple text area.
2. CLIENT INFORMATION and COUNT OF RESULT.
CLIENT INFORMATION depends on CF_2 and CF_3.
COUNT comes from CF_4. These are not recursive fields.
3. SOIL INFO FULL. This is recursive field which shows all the soil information that we have which follows
the parameters. This depends on the Q_1.
4. CF_2, CF_3, CF_4 are formula column.
5. CF_2
This shows the FIRST NAME.
function CF_2Formula return varchar2 is
fname varchar2(25);
begin
select FIRST_NAME into fname from client_details where client_id = :ID;
return (fname);
exception
when others then
return 0;
end;
6. CF_3
This shows the LAST NAME.
function CF_3Formula return varchar2 is
lname varchar2(25);
begin
selectlasT_NAME into lname from client_details where client_id = :ID;
return (lname);
exception
when others then
return 0;
end;
7. CF_4
This shows the count of the result set we get.
function CF_4Formula return Number is
ct number(10);
begin
select count(lab_id) into ct from FARM_SOIL_FERT_TEST_RESULTS where client_id = :ID and
FARM_SOIL_FERT_TEST_RESULTS .dor>= :STARTDATE and FARM_SOIL_FERT_TEST_RESULTS .dor<=
:ENDDATE;
return (ct);
exception
when others then
return 0;
end;
8. Q_1is used by FULL TEST RESULTS AND INTERPRETATION FOR CLIENTrepeating frame.
This query fetches all the records which qualify all the condition.
SELECT ALL FARM_SOIL_FERT_TEST_RESULTS.CLIENT_SAMPLE_ID,
FARM_SOIL_FERT_TEST_RESULTS.TOOL_SAMPLE_ID, FARM_SOIL_FERT_TEST_RESULTS.LAB_ID,
FARM_SOIL_FERT_TEST_RESULTS.DOR, FARM_SOIL_FERT_TEST_RESULTS.CLIENT_ID,
FARM_SOIL_FERT_TEST_RESULTS.FIRST_NAME, FARM_SOIL_FERT_TEST_RESULTS.LAST_NAME,
FARM_SOIL_FERT_TEST_RESULTS.TEST_METHOD, FARM_SOIL_FERT_TEST_RESULTS.TILLAGE_DEPTH,
FARM_SOIL_FERT_TEST_RESULTS.CROP_CODE, FARM_SOIL_FERT_TEST_RESULTS.OM,
FARM_SOIL_FERT_TEST_RESULTS.P, FARM_SOIL_FERT_TEST_RESULTS.K,
FARM_SOIL_FERT_TEST_RESULTS.ZN,
FARM_SOIL_FERT_TEST_RESULTS.PH, FARM_SOIL_FERT_TEST_RESULTS.BPH,
FARM_SOIL_FERT_TEST_RESULTS.P_REC, FARM_SOIL_FERT_TEST_RESULTS.K_REC_FINE,
FARM_SOIL_FERT_TEST_RESULTS.K_REC_SANDY, FARM_SOIL_FERT_TEST_RESULTS.ZN_BROAD,
FARM_SOIL_FERT_TEST_RESULTS.ZN_BAND, FARM_SOIL_FERT_TEST_RESULTS.PH_1,
FARM_SOIL_FERT_TEST_RESULTS.PH_2, FARM_SOIL_FERT_TEST_RESULTS.PH_3
FROM FARM_SOIL_FERT_TEST_RESULTS where FARM_SOIL_FERT_TEST_RESULTS.CLIENT_ID= :ID and
FARM_SOIL_FERT_TEST_RESULTS .dor>= :STARTDATE and FARM_SOIL_FERT_TEST_RESULTS .dor<=
:ENDDATE;
SOIL INFO FULL REPORT
Name - FARM_SOIL_INFO_FULL_REPORT.fmx
This form has 3 mandatory search fields CLIENT_ID, START DATE, END DATE.
1. CLIENT ID has a LOV attached to it to select a client for whom we are pulling out the data.
2. START DATE and END DATE are to specify the dates for which we are looking for the data.
3. SHOW REPORT button call the report by passing the 3 parameter to the report
FARM_SOIL_INFO_FULL_REPORT.RDF.
DECLARE
repid REPORT_OBJECT;
v_repVARCHAR2(200);
rep_statusVARCHAR2(20);
plidParamList;
Str_Report_Server_JobVARCHAR2(300);
Str_Job_IDVARCHAR2(300);
Str_URLVARCHAR2(300);
BEGIN
plid := Get_parameter_List('tmp');
IF NOT Id_Null(plid) THEN
Destroy_parameter_List(plid );
END IF;
plid := Create_parameter_List('tmp');
--ADD_PARAMETER(plid,'ID',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM4);
--ADD_PARAMETER(plid,'STARTDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM5);
--ADD_PARAMETER(plid,'ENDDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM6);
Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO');
repid := FIND_REPORT_OBJECT('REP');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME,
'C:projFARM_SOIL_INFO_FULL_REPORT.RDF');
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_EXECUTION_MODE, BATCH);
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_SERVER, 'rep_soiltestserv');
--v_rep := RUN_REPORT_OBJECT(repid,plid);
--set_report_object_property(repid,report_other,'ID'||:BLOCK2.TEXT_ITEM4||' paramform=no') ;
--set_report_object_property(repid,report_other,'STARTDATE'||:BLOCK2.TEXT_ITEM5||'
paramform=no') ;
--set_report_object_property(repid,report_other,'ENDDATE'||:BLOCK2.TEXT_ITEM6||'
paramform=no') ;
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no
ID='||:BLOCK2.TEXT_ITEM4||' STARTDATE='||:BLOCK2.TEXT_ITEM5||'
ENDDATE='||:BLOCK2.TEXT_ITEM6);
-- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no
STARTDATE='||:BLOCK2.TEXT_ITEM5);
-- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no
ENDDATE='||:BLOCK2.TEXT_ITEM6);
Str_Report_Server_Job := RUN_REPORT_OBJECT(repid);
-- message(Str_Report_Server_Job);
rep_status := REPORT_OBJECT_STATUS(Str_Report_Server_Job);
message(rep_status);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(Str_Report_Server_Job);
END LOOP;
IF rep_status = 'FINISHED' THEN
--message(Str_Report_Server_Job);
Str_Job_ID := SUBSTR(Str_Report_Server_Job, LENGTH('rep_soiltestserv') + 2,
LENGTH(Str_Report_Server_Job));
Str_URL := '/reports/rwservlet/getjobid' || Str_Job_ID || '?server=rep_soiltestserv';
WEB.SHOW_DOCUMENT(Str_URL, '_blank');
DESTROY_PARAMETER_LIST(PLID);
end if;
END;
4. NEW REPORT clears the form and prepares the form for a new report.
CLEAR_BLOCK;
FARM_SOIL_INFO_FULL_REPORT.RDF
1. All the reports are made with the help of REPORT BUILDER. To edit the reports open REPORT BUIDER
icon on desktop. This is a manual report.
2. Open the concerned report and go to REPORT WIZARD and do the required changes.
3. Any changes in the report can be done in DATA MODEL editor or the PAPER LAYOUT tab.
4. DATA MODEL shows the columns and fields being used in the report.
This report consists of 3 parts:
9. IOWA STATE information. This is a simple text area.
10. CLIENT INFORMATION and COUNT OF RESULT.
CLIENT INFORMATION depends on CF_2 and CF_3.
COUNT comes from CF_4. These are not recursive fields.
11. SOIL INFO FULL. This is recursive field which shows all the soil information that we have which follows
the parameters. This depends on the Q_1.
12. CF_2, CF_3, CF_4 are formula column.
13. CF_2
This shows the FIRST NAME.
function CF_2Formula return varchar2 is
fname varchar2(25);
begin
select FIRST_NAME into fname from client_details where client_id = :ID;
return (fname);
exception
when others then
return 0;
end;
14. CF_3
This shows the LAST NAME.
function CF_3Formula return varchar2 is
lname varchar2(25);
begin
selectlasT_NAME into lname from client_details where client_id = :ID;
return (lname);
exception
when others then
return 0;
end;
15. CF_4
This shows the count of the result set we get.
function CF_4Formula return Number is
ct number(10);
begin
select count(lab_id) into ct from FARM_SOIL_FERT_SAMPLE_INFO where client_id = :ID and
FARM_SOIL_FERT_SAMPLE_INFO .dos >= :STARTDATE and FARM_SOIL_FERT_SAMPLE_INFO .dos <=
:ENDDATE;
return (ct);
exception
when others then
return 0;
end;
16. Q_1is used by FULL SOIL INFORMATION OF CLIENT repeating frame.
This query fetches all the records which qualify all the condition.
SELECT ALL FARM_SOIL_FERT_SAMPLE_INFO.CLIENT_ID,
FARM_SOIL_FERT_SAMPLE_INFO.CLIENT_SAMPLE_ID,
FARM_SOIL_FERT_SAMPLE_INFO.TOOL_SAMPLE_ID, FARM_SOIL_FERT_SAMPLE_INFO.LAB_ID,
FARM_SOIL_FERT_SAMPLE_INFO.DOS, FARM_SOIL_FERT_SAMPLE_INFO.TILLAGE_DEPTH,
FARM_SOIL_FERT_SAMPLE_INFO.LIME,
FARM_SOIL_FERT_SAMPLE_INFO.CROP_CODE,
FARM_SOIL_FERT_SAMPLE_INFO.TEST_SERIES_CODE,
FARM_SOIL_FERT_SAMPLE_INFO.COMMENTS
FROM FARM_SOIL_FERT_SAMPLE_INFO where FARM_SOIL_FERT_SAMPLE_INFO.CLIENT_ID= :ID and
FARM_SOIL_FERT_SAMPLE_INFO .dos >= :STARTDATE and FARM_SOIL_FERT_SAMPLE_INFO .dos <=
:ENDDATE;
PENDING REPORTS FORM
This is a form where we can check the reports for all the LAB ID for which we have a SOIL INFORMATION but
the RESULTS are still pending.
NAME- FERT_PENDING_RESULT_REPORT.fmx
This form consists of 2 frames-
1. ALL PENDING REPORT- Calls the report for all the CLIENTS for which we have pending results. i,e all the
SOIL INFORMATION for which we don’t have the results ready yet.
2. CLIENT WISE PENDING RESULT REPORT- calls the report for all the LAB ID for which results are pending
CLIENTWISE.
Both the frames have 2 parameters in common START DATE and END DATE but the second frame has an
extra one to search client wise.
The client ID text field has a LOV attached to it for selecting the CLIENT ID.
REPORT button calls the report and NEW REPORT clears the form.
Report Name - pending_result_report.RDF
REPORT name - client_wise_pending_result_report.RDF
REPORT BUTTON CODE for ALL PENDING REPORT
DECLARE
repid REPORT_OBJECT;
v_repVARCHAR2(200);
rep_statusVARCHAR2(20);
plidParamList;
Str_Report_Server_JobVARCHAR2(300);
Str_Job_IDVARCHAR2(300);
Str_URLVARCHAR2(300);
BEGIN
plid := Get_parameter_List('tmp');
IF NOT Id_Null(plid) THEN
Destroy_parameter_List(plid );
END IF;
plid := Create_parameter_List('tmp');
Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO');
repid := FIND_REPORT_OBJECT('REP');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME, 'C:projpending_result_report.RDF');
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_EXECUTION_MODE, BATCH);
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_SERVER, 'rep_soiltestserv');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no
STDATE='||:BLOCK5.TEXT_ITEM6||' ENDDT='||:BLOCK5.TEXT_ITEM7);
-- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no
STARTDATE='||:BLOCK2.TEXT_ITEM5);
-- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no
ENDDATE='||:BLOCK2.TEXT_ITEM6);
Str_Report_Server_Job := RUN_REPORT_OBJECT(repid);
-- message(Str_Report_Server_Job);
rep_status := REPORT_OBJECT_STATUS(Str_Report_Server_Job);
message(rep_status);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(Str_Report_Server_Job);
END LOOP;
IF rep_status = 'FINISHED' THEN
--mEssage(Str_Report_Server_Job);
Str_Job_ID := SUBSTR(Str_Report_Server_Job, LENGTH('rep_soiltestserv') + 2,
LENGTH(Str_Report_Server_Job));
Str_URL := '/reports/rwservlet/getjobid' || Str_Job_ID || '?server=rep_soiltestserv';
WEB.SHOW_DOCUMENT(Str_URL, '_blank');
DESTROY_PARAMETER_LIST(PLID);
end if;
END;
REPORT BUTTON code on CLIENT WISE REPORT frame.
DECLARE
repid REPORT_OBJECT;
v_repVARCHAR2(200);
rep_statusVARCHAR2(20);
plidParamList;
Str_Report_Server_JobVARCHAR2(300);
Str_Job_IDVARCHAR2(300);
Str_URLVARCHAR2(300);
BEGIN
plid := Get_parameter_List('tmp');
IF NOT Id_Null(plid) THEN
Destroy_parameter_List(plid );
END IF;
plid := Create_parameter_List('tmp');
Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO');
repid := FIND_REPORT_OBJECT('REP2');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME,
'C:projclient_wise_pending_result_report.RDF');
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_EXECUTION_MODE, BATCH);
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_SERVER, 'rep_soiltestserv');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no ID='||:BLOCK12.TEXT_ITEM14||'
STRTDATE='||:BLOCK12.TEXT_ITEM15||' ENDDTE='||:BLOCK12.TEXT_ITEM16);
-- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no
STARTDATE='||:BLOCK2.TEXT_ITEM5);
-- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no
ENDDATE='||:BLOCK2.TEXT_ITEM6);
Str_Report_Server_Job := RUN_REPORT_OBJECT(repid);
-- message(Str_Report_Server_Job);
rep_status := REPORT_OBJECT_STATUS(Str_Report_Server_Job);
message(rep_status);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(Str_Report_Server_Job);
END LOOP;
IF rep_status = 'FINISHED' THEN
--message(Str_Report_Server_Job);
LIMS_DOCUMENTATION
LIMS_DOCUMENTATION
LIMS_DOCUMENTATION
LIMS_DOCUMENTATION
LIMS_DOCUMENTATION
LIMS_DOCUMENTATION

More Related Content

What's hot

Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsRoo Wall
 
FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GN/A
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cuzzal basak
 
Oracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseOracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseuzzal basak
 
Indexes, Filters, and Other Animals
Indexes, Filters, and Other AnimalsIndexes, Filters, and Other Animals
Indexes, Filters, and Other AnimalsScyllaDB
 
How to create a non managed standby database
How to create a non managed  standby databaseHow to create a non managed  standby database
How to create a non managed standby databaseJorge Batista
 
vCenter Hyperic Administration Guide 5.8
vCenter Hyperic Administration Guide 5.8vCenter Hyperic Administration Guide 5.8
vCenter Hyperic Administration Guide 5.8Kumaran Balachandran
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11guzzal basak
 
Data Base Upgrade
Data Base UpgradeData Base Upgrade
Data Base Upgradeguest362312
 
GeekAustin DevOps
GeekAustin DevOpsGeekAustin DevOps
GeekAustin DevOpsMatt Ray
 
1z0 034 exam-upgrade oracle9i10g oca to oracle database 11g ocp
1z0 034 exam-upgrade oracle9i10g oca to oracle database 11g ocp1z0 034 exam-upgrade oracle9i10g oca to oracle database 11g ocp
1z0 034 exam-upgrade oracle9i10g oca to oracle database 11g ocpIsabella789
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from Anar Godjaev
 
Understanding Query Execution
Understanding Query ExecutionUnderstanding Query Execution
Understanding Query Executionwebhostingguy
 

What's hot (15)

Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windows
 
FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11G
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12c
 
Oracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseOracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby database
 
Exportversions
ExportversionsExportversions
Exportversions
 
Indexes, Filters, and Other Animals
Indexes, Filters, and Other AnimalsIndexes, Filters, and Other Animals
Indexes, Filters, and Other Animals
 
How to create a non managed standby database
How to create a non managed  standby databaseHow to create a non managed  standby database
How to create a non managed standby database
 
vCenter Hyperic Administration Guide 5.8
vCenter Hyperic Administration Guide 5.8vCenter Hyperic Administration Guide 5.8
vCenter Hyperic Administration Guide 5.8
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden Gate
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11g
 
Data Base Upgrade
Data Base UpgradeData Base Upgrade
Data Base Upgrade
 
GeekAustin DevOps
GeekAustin DevOpsGeekAustin DevOps
GeekAustin DevOps
 
1z0 034 exam-upgrade oracle9i10g oca to oracle database 11g ocp
1z0 034 exam-upgrade oracle9i10g oca to oracle database 11g ocp1z0 034 exam-upgrade oracle9i10g oca to oracle database 11g ocp
1z0 034 exam-upgrade oracle9i10g oca to oracle database 11g ocp
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from
 
Understanding Query Execution
Understanding Query ExecutionUnderstanding Query Execution
Understanding Query Execution
 

Viewers also liked

Evaluation Question 3: Open Questionnaire Results
Evaluation Question 3: Open Questionnaire ResultsEvaluation Question 3: Open Questionnaire Results
Evaluation Question 3: Open Questionnaire ResultsCorySmith25
 
Evaluation Question 4
Evaluation Question 4Evaluation Question 4
Evaluation Question 4CorySmith25
 
Fuentes del campo magnético
Fuentes del campo magnéticoFuentes del campo magnético
Fuentes del campo magnéticoeduardo.go
 
How to keep your password in a list
How to keep your password in a listHow to keep your password in a list
How to keep your password in a listArefin Khan
 
Experience and Productivity in Wage Formation in Finnish Industries
Experience and Productivity in Wage Formation in Finnish IndustriesExperience and Productivity in Wage Formation in Finnish Industries
Experience and Productivity in Wage Formation in Finnish IndustriesPalkansaajien tutkimuslaitos
 
Corriente eléctrica (1)
Corriente eléctrica (1)Corriente eléctrica (1)
Corriente eléctrica (1)clausgon
 
Tabla periódica y propiedades periódicas
Tabla periódica y propiedades periódicasTabla periódica y propiedades periódicas
Tabla periódica y propiedades periódicassofiagonzv
 

Viewers also liked (13)

Orologio.jpg
Orologio.jpgOrologio.jpg
Orologio.jpg
 
Evaluation Question 3: Open Questionnaire Results
Evaluation Question 3: Open Questionnaire ResultsEvaluation Question 3: Open Questionnaire Results
Evaluation Question 3: Open Questionnaire Results
 
Egotia- The Process
Egotia- The ProcessEgotia- The Process
Egotia- The Process
 
Evaluation Question 4
Evaluation Question 4Evaluation Question 4
Evaluation Question 4
 
A thounsand yeas
A thounsand yeasA thounsand yeas
A thounsand yeas
 
Fuentes del campo magnético
Fuentes del campo magnéticoFuentes del campo magnético
Fuentes del campo magnético
 
Blab
BlabBlab
Blab
 
How to keep your password in a list
How to keep your password in a listHow to keep your password in a list
How to keep your password in a list
 
Lorito
LoritoLorito
Lorito
 
Experience and Productivity in Wage Formation in Finnish Industries
Experience and Productivity in Wage Formation in Finnish IndustriesExperience and Productivity in Wage Formation in Finnish Industries
Experience and Productivity in Wage Formation in Finnish Industries
 
Pp3 hr
Pp3 hrPp3 hr
Pp3 hr
 
Corriente eléctrica (1)
Corriente eléctrica (1)Corriente eléctrica (1)
Corriente eléctrica (1)
 
Tabla periódica y propiedades periódicas
Tabla periódica y propiedades periódicasTabla periódica y propiedades periódicas
Tabla periódica y propiedades periódicas
 

Similar to LIMS_DOCUMENTATION

Swift configurator installation-manual
Swift configurator installation-manualSwift configurator installation-manual
Swift configurator installation-manualPramod Sharma
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionFrederic Descamps
 
Confoo 2021 -- MySQL New Features
Confoo 2021 -- MySQL New FeaturesConfoo 2021 -- MySQL New Features
Confoo 2021 -- MySQL New FeaturesDave Stokes
 
Managing Oracle Streams Using Enterprise Manager Grid Control
Managing Oracle Streams Using Enterprise Manager Grid ControlManaging Oracle Streams Using Enterprise Manager Grid Control
Managing Oracle Streams Using Enterprise Manager Grid Controlscottb411
 
How to upgrade to MongoDB 4.0 - Percona Europe 2018
How to upgrade to MongoDB 4.0 - Percona Europe 2018How to upgrade to MongoDB 4.0 - Percona Europe 2018
How to upgrade to MongoDB 4.0 - Percona Europe 2018Antonios Giannopoulos
 
PgConf US 2015 - ALTER DATABASE ADD more SANITY
PgConf US 2015  - ALTER DATABASE ADD more SANITYPgConf US 2015  - ALTER DATABASE ADD more SANITY
PgConf US 2015 - ALTER DATABASE ADD more SANITYOleksii Kliukin
 
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogicRakuten Group, Inc.
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performanceEngine Yard
 
Pandora FMS: DB2 Enterprise Plugin
Pandora FMS: DB2 Enterprise PluginPandora FMS: DB2 Enterprise Plugin
Pandora FMS: DB2 Enterprise PluginPandora FMS
 
Setup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationSetup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationKanwar Batra
 
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusEmily Jiang
 
RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)
RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)
RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)Kristofferson A
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileWASdev Community
 
0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorialKlausePaulino
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleAnton Arhipov
 
Windows logging cheat sheet
Windows logging cheat sheetWindows logging cheat sheet
Windows logging cheat sheetMichael Gough
 
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Morgan Tocker
 
Automated infrastructure is on the menu
Automated infrastructure is on the menuAutomated infrastructure is on the menu
Automated infrastructure is on the menujtimberman
 
Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2
 Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2   Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2
Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2 Adil Khan
 

Similar to LIMS_DOCUMENTATION (20)

Swift configurator installation-manual
Swift configurator installation-manualSwift configurator installation-manual
Swift configurator installation-manual
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
 
Confoo 2021 -- MySQL New Features
Confoo 2021 -- MySQL New FeaturesConfoo 2021 -- MySQL New Features
Confoo 2021 -- MySQL New Features
 
Managing Oracle Streams Using Enterprise Manager Grid Control
Managing Oracle Streams Using Enterprise Manager Grid ControlManaging Oracle Streams Using Enterprise Manager Grid Control
Managing Oracle Streams Using Enterprise Manager Grid Control
 
How to upgrade to MongoDB 4.0 - Percona Europe 2018
How to upgrade to MongoDB 4.0 - Percona Europe 2018How to upgrade to MongoDB 4.0 - Percona Europe 2018
How to upgrade to MongoDB 4.0 - Percona Europe 2018
 
PgConf US 2015 - ALTER DATABASE ADD more SANITY
PgConf US 2015  - ALTER DATABASE ADD more SANITYPgConf US 2015  - ALTER DATABASE ADD more SANITY
PgConf US 2015 - ALTER DATABASE ADD more SANITY
 
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performance
 
Pandora FMS: DB2 Enterprise Plugin
Pandora FMS: DB2 Enterprise PluginPandora FMS: DB2 Enterprise Plugin
Pandora FMS: DB2 Enterprise Plugin
 
Setup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationSetup oracle golden gate 11g replication
Setup oracle golden gate 11g replication
 
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
 
Docker In Bank Unrated
Docker In Bank UnratedDocker In Bank Unrated
Docker In Bank Unrated
 
RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)
RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)
RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
 
0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassle
 
Windows logging cheat sheet
Windows logging cheat sheetWindows logging cheat sheet
Windows logging cheat sheet
 
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
 
Automated infrastructure is on the menu
Automated infrastructure is on the menuAutomated infrastructure is on the menu
Automated infrastructure is on the menu
 
Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2
 Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2   Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2
Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2
 

LIMS_DOCUMENTATION

  • 1. DOCUMENTATION OF LIMS FOR FARM PRODUCTS. PREPARED BY – RAHUL SINGH 2015
  • 2. LIMS DOCUMENTATION FARM PRODUCTS INSTALLING ORACLE DATABASE AND DEVELOPER SUITE AND CONNECTING THEM 1. The table description for farm product phase is in the C:projfilestable script and definition.txt in the server. 2. How to install database.(refer youtube for installing.) 3. Install the oracle database 10g, sql developer. 4. Install the oracle developer suite. 5. Oracle SID– soiltest 6. We have to create some system variables for the oracle to run. 7. Go to Control PanelAll Control Panel ItemsSystem>advanced system settings>environment variables 8. Check for a variable named LOCAL with value ORCL. If not present create it. 9. Check the path variable and add C:DevSuiteHome_2jdkjrebinclassic;C:DevSuiteHome_2jdkjrebin;C:DevSuiteHome_2j dkjrebinclient;C:DevSuiteHome_2jlib;C:DevSuiteHome_2bin;C:DevSuiteHome_2jre1.4 .2binclient;C:DevSuiteHome_2jre1.4.2bin;C:ProgramDataOracleJavajavapath;C:appr ksinghoraclebaseproduct11.2.0dbhome_1bin;%SystemRoot%system32;%SystemRoot%;% SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;C:Pro gram FilesJavajdk1bin;C:DevSuiteHome_2reportsjlibrwbuilder.jar;C:DevSuiteHome_2reports jlibrwrun.jar;C:DevSuiteHome_2jlibzrclient.jar;C:DevSuiteHome_2j2eehomeoc4j.jar;C: DevSuiteHome_2j2eehomelibojsp.jar 10.There should be no spaces in the name of any folder. If there is please rename the folders and path and use _. 11.Create a new variable REPORTS_PATH and give the value as C:DevSuiteHome_2reportsjlibrwbuilder.jar;C:DevSuiteHome_2reportsjlibrwrun.jar;C:D
  • 3. evSuiteHome_2jlibzrclient.jar;C:DevSuiteHome_2j2eehomeoc4j.jar;C:DevSuiteHome_2j 2eehomelibojsp.jar;C:proj 12.The underlined path is the folder where the reports are being stored. In this project it is c:proj. make sure all the reports are in the given folder. This helps the forms to directly fetch the reports from the folder. 13.Check for a variable called TNS_ADMIN . If not there create and put value C:apprksinghoraclebaseproduct11.2.0dbhome_1NETWORKADMIN;C:DevSuiteHome_2 NETWORKADMIN. 14.The folder depends on the individual system but the path should be like mentioned above. 15.Open run type cmd 16.Type tnsping ORCL 17.Open run and type rwserver server=rep_soiltestservto create the reports server. This server has to be started everytimemanually . We will make an environment variable for this path in later steps. 18.Open run and type regedit. 19.Compare the system variable with the given screen shots in next few slides.
  • 4. 20. 21. 22.Install the oracle developer suite. 23.copy the files sqlnet.ora, tnsnames.ora from C:apprksinghoraclebaseproduct11.2.0dbhome_1NETWORKADMIN and paste in C:DevSuiteHome_2NETWORKADMIN (this connects the database with the forms and reports)
  • 5. 24.Run the jinit file in C:DevSuiteHome_2jinit 25.Copy the C:DevSuiteHome_2jdkjrebinserverjvm.dll file and paste in C:Program Files (x86)OracleJInitiator 1.3.1.22binhotspotjvm.dll and replace it. 26.Install Mozilla 2.0. 27.Open and run and connect the oracle forms builder. 28.Use the credentials as used in oracle database . 29.Go to edit>preferences>runtime>default> and search for the installation file for Mozilla2.0 version (C:Program Files (x86)Mozilla Firefox) 30.Install plugins. 31.Open run type cmd 32.Type sqlplus sys/tiger@ORCL 33.Username ---system (admin) 34.Password --- tiger1 35.Run ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE; 36.This step is important as it helps in directly connecting with the servers and login when reports are called. CONNECTING THE REPORTS BUILDER WITH FORMS AND DATABASE 37. The connection with database is already made.(copying of tnsnames and sqlnet to the network directory) 38. The backup for these files are in C:projfiles folder. 39. Open reports builder and connect with the same credentials. 40. The connection forms are made in some last steps where we altered the case sensitive login. If that is not done please run cmd 41. Sqlplus sys/tiger1@ORCL 42. Username- system password – tiger1 43. ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE; 44. If this is not done then the connection fails when we run any reports. 45. To increase the servlet size for forms 46. Open C:DevSuiteHome_2formsserverformsweb.cfg 47. Edit-- # Forms applet parameter width=90% # Forms applet parameter height=100%
  • 6. 48. Some changes in the configuration files of reports are necessary. 49. After making the report server by running rwserver server=rep_soiltestservin the run. 50. We get the config file for the server in C:DevSuiteHome_2reportsconf folder. 51. Open the config file for the respective server. 52. Change 1. <!--property name="maxCacheFileNumber" value="max number of cache files"/--> <property name="maxCacheFileNumber" value="50"/> 2. <!--property name="sourceDir" value="your reports source directory"/--> <property name="sourceDir" value="C:proj"/> 3. <connection maxConnect="20" idleTimeOut="50"> <queue maxQueueSize="1000"/> 53. Open C:DevSuiteHome_2reportslogsrep_soiltestservrwserver.txt 54. check 1. <property name="cacheSize" value="50"/> 2. <property name="maxCacheFileNumber" value="50"/> <connection maxConnect="20" idleTimeOut="50"> Steps to run the tool 1. Open the server.(all the development and deployment files are in the server.) 2. Start OC4J instance for forms and reports. 3. Open the SQL developer and start the database --- soiltest 4. Open the oracle forms tool. 5. Login details for oracle database, SQL developer, forms and reports builder are :- 6. username ----- HR 7. Password ----- tiger1 8. Database ----- ORCL 9. The other user are sys, system, HR, SCOTT with the same password and database. 10. Server name is soiltestserv.agron.iastate.edu 11. Open cmd from run. 12. Type rwserver server=rep_soiltestserv START and press enter.(this is the report server which needs to be started in order to run the reports) 13. We can traverse to different pages from the menu which appears in the top section of the tool.
  • 7. TABLE DESCRIPTION AND DEFINITION FARM PRODUCT CLIENT DETAILS ------------------------------- CLIENT_DETAILS ---------------- CREATE TABLE "HR"."CLIENT_DETAILS" ( "CLIENT_ID" NUMBER(6,0) NOT NULL ENABLE, "FIRST_NAME" VARCHAR2(20 BYTE), "LAST_NAME" VARCHAR2(20 BYTE), "DOC" DATE, "ADDRESS" VARCHAR2(30 BYTE), "CITY" VARCHAR2(20 BYTE), "STATE" VARCHAR2(20 BYTE), "ZIP" NUMBER(6,0), "COUNTY" VARCHAR2(15 BYTE), "EMAIL" VARCHAR2(40 BYTE), "PHONE" NUMBER(10,0), "SUBMITTER_ID" NUMBER(6,0), "SUB_FIRST_NAME" VARCHAR2(20 BYTE), "SUB_LAST_NAME" VARCHAR2(20 BYTE), "USERNAME" VARCHAR2(20 BYTE), "PASSWORD" VARCHAR2(20 BYTE), "COMMENTS" VARCHAR2(30 BYTE), CONSTRAINT "CLIENT_DETAILS_PK" PRIMARY KEY ("CLIENT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ENABLE
  • 8. ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; Note – 1. If client is a contractor or he has a number of other client for which he is submitting the soil samples then we use the submitter ID and submitter name. 2. username and password is not used as of now, it will be used when we design the client side of the tool. ================================================================================================== ================================== FARM PRODUCTS SUGGESTION DATA -------------------------------------- FARM_COMMENTS -------------------------------------- CREATE TABLE "HR"."FARM_COMMENTS" ( "CROP_CODE" NUMBER, "COMMENTS" VARCHAR2(1000 BYTE) ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; ----------------------------------------- CROP_CODE COMMENTS ----------------------------------
  • 9. 3 FOR CROP CODE 3: Corn or Sorghum Grain--The recommended amounts of P2O5 and K2O for the optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this optimum soil test category are based on 180 bu corn grain per acre. Nutrient removal amounts can be adjusted higher or lower for other yield levels. In the high soil test category, banded NP or NPK starter fertilizer may be advantageous under conditions of limited soil drainage, cool soil, crop residues on the soil surface, or late planting dates with full-season hybrids. 4 FOR CROP CODE 4: Soybeans--The recommended amounts of P2O5 and K2O for the optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this optimum soil test category are based on 55 bu soybean grain per acre. Nutrient removal amounts can be adjusted higher or lower for other yield levels. 5 FOR CROP CODE 5: Corn/soybean grain sequence--The recommended amounts of P2O5 and K2O for the optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this optimum soil test category are based on 180 bu corn grain per acre and 55 bu soybean per acre. Nutrient removal amounts can be adjusted higher or lower for other yield levels.In the high soil test category, consider application of a partial removal rate. Also, banded NP or NPK starter fertilizer may be advantageous under conditions of limited soil drainage, cool soil, crop residues on the soil surface or late planting dates with full-season hybrids. 6 FOR CROP CODE 6: Oat Grain--The recommended amounts of P2O5 and K2O for the optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this optimum soil test category are based on 80 bu oat grain per acre. Nutrient removal amounts can be adjusted higher or lower for other yield levels. 7 FOR CROP CODE 7: Wheat--The recommended amounts of P2O5 and K2O for the optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this optimum soil test category are based on 60 bu wheat grain per acre and straw. Nutrient removal amounts can be adjusted higher or lower for other yield levels. 8 FOR CROP CODE 8: Sunflowers--The recommended amounts of P2O5 and K2O for the optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this optimum soil test category are based on 2000 lb sunflower seed per acre. Nutrient removal amounts can be adjusted higher or lower for other yield levels. 9 FOR CROP CODE 9: Corn or sorghum silage--The recommended amounts of P2O5 and K2O for the optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this optimum soil test category are based on 22 tons corn silage per acre. Nutrient removal amounts can be adjusted higher or lower for other yield levels. In the high soil test category, banded NP or NPK starter fertilizer may be advantageous under conditions of limited soil drainage, cool soil, crop residues on the soil surface, or late planting dates with full-season hybrids. 10 FOR CROP CODE 10: Alfalfa and alfalfa grass hay and pastures--For soils that test in the high soil test P category, 30 lb P2O5 per acre is recommended at seeding time. The recommended amounts of P2O5 and K2O for the optimum soil test category are based on approximate nutrient removal for the harvested yield. The amounts shown in the table for this optimum soil test category are based on 5 ton per acre harvested hay. Nutrient removal amounts can be adjusted higher or lower for other yield levels. For pastures, reduce the amount in all soil test categories for phosphorus to two-thirds and for potassium to one-half of the amount indicated for hay because more nutrients are returned to the soil when grazing. 13 FOR CROP CODE 13: bluegrass--**no comments**
  • 10. 11 FOR CROP CODES 11 : Hay and pastures--The recommended amounts of P2O5 and K2O for the optimum soil test category are based on 3 ton per acre of harvested hay. Nutrient removal amounts can be adjusted higher or lower for other yield levels. For pastures, reduce the amount in all soil test categories for phosphorus to two-thirds and for potassium to one-half the amount indicated for hay because more nutrients are returned to the soil when grazing. 12 FOR CROP CODES 12: Hay and pastures--The recommended amounts of P2O5 and K2O for the optimum soil test category are based on 3 ton per acre of harvested hay. Nutrient removal amounts can be adjusted higher or lower for other yield levels. For pastures, reduce the amount in all soil test categories for phosphorus to two-thirds and for potassium to one-half the amount indicated for hay because more nutrients are returned to the soil when grazing. ================================================================================================== ================================= FARM CROP CODE AND DETAILS ----------------------------------------- FARM_CROP_DETAILS ----------------------------------------- CREATE TABLE "HR"."FARM_CROP_DETAILS" ( "CROP_CODE" NUMBER(3,0) NOT NULL ENABLE, "CROP_NAME" VARCHAR2(130 BYTE), CONSTRAINT "FARM_CROP_DETAILS_PK" PRIMARY KEY ("CROP_CODE") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ENABLE ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; ----------------------------------------------------------
  • 11. CROP_CODE CROP_NAME ------------------------------------ 3 Corn or sorghum grain 4 Soybeans 5 Corn/soybean grain sequence(two year rotation, applied before either corn or soybean) 6 Oat grain 7 Wheat 8 Sunflowers 9 Corn or sorghum silage 10 Alfalfa and alfalfa grass hay and pastures 11 Clover- and –trefoil-grass hay and pastures 12 Tall and cool season grasses, warm season grasses and sorghum-sudan hay and pastures 13 Bluegrass Note – All the crop codes used here are the new crop codes. ================================================================================================== ================================= FARM PRODUCT k RANGE FOR CALCULATING RECOMMENDATIONS -------------------------------------------------------------- FARM_K_RANGE -------------------------------------- CREATE TABLE "HR"."FARM_K_RANGE" ( "K_MIN" NUMBER(4,0), "K_MAX" VARCHAR2(6 BYTE), "TEST_TYPE" VARCHAR2(8 BYTE), "KR" VARCHAR2(3 BYTE) ) SEGMENT CREATION IMMEDIATE
  • 12. PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; ---------------------------------------------------- K_MIN K_MAX TEST_TYPE KR -------------------------------------- 0 50 moist VL 51 85 moist L 86 120 moist O 121 155 moist H 156 100000 moist VH 0 120 dry VL 121 160 dry L 161 200 dry O 201 240 dry H 241 100000 dry VH IT IS USED TO DETEMINE THE VALUE OF KR BASED ON THE VALUE OF K WE GET FROM THE LAB TESTS. WE HAVE DEFINED THE RANGES AND THE TYPE OF TESTS WE ARE DOING ON THE SAMPLE TO FIND CORRESPONDING KR. THIS KR HELPS IN DEFINING THE FINAL K RECOMMENDATION FOR SANDY AND FINE SOIL. select KR from farm_K_ranges where test_type='moist' and K_min<= x and K_max>= x select KR from farm_K_ranges where test_type='dry' and K_min<= x and K_max>= x ================================================================================================== =========================================== FARM PRODUCT P RANGE FOR CALCULATING RECOMMENDATIONS
  • 13. ------------------------------------------------------- FARM_P_RANGE --------------------------- CREATE TABLE "HR"."FARM_P_RANGE" ( "CROP_CODE" NUMBER(3,0), "P_MIN" NUMBER(3,0), "P_MAX" NUMBER(6,0), "PR" VARCHAR2(23 BYTE) ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; -------------------------------------------------------------- CROP_CODE P_MIN P_MAX PR --------------------------------------------------------------- 3 9 15 L 3 16 20 O 3 21 30 H 3 31 100000 VH 4 0 8 VL 4 9 15 L 4 16 20 O 4 21 30 H 4 31 100000 VH 5 0 8 VL 5 9 15 L 5 16 20 O 5 21 30 H
  • 14. 5 31 100000 VH 6 0 8 VL 6 9 15 L 6 16 20 O 7 0 15 VL 7 16 20 L 7 21 25 O 7 26 30 H 7 31 100000 VH 8 0 8 VL 8 9 15 L 8 16 20 O 8 21 30 H 8 31 100000 VH 9 0 8 VL 9 9 15 L 9 16 20 O 9 21 30 H 9 31 100000 VH 10 0 15 VL 10 16 20 L 10 21 25 O 10 26 30 H 10 31 100000 VH 11 0 8 VL 11 9 15 L 11 16 20 O 11 21 30 H 11 31 100000 VH 12 0 8 VL 12 9 15 L
  • 15. 12 16 20 O 12 21 30 H 12 31 100000 VH 13 0 8 VL 13 9 15 L 13 16 20 O 13 21 30 H 13 31 100000 VH 6 31 100000 VH 3 0 8 VL 6 21 30 H IT IS USED TO DETEMINE THE VALUE OF PR BASED ON THE VALUE OF P WE GET FROM THE LAB TESTS. WE HAVE DEFINED THE RANGES AND THE TYPE OF TESTS WE ARE DOING ON THE SAMPLE TO FIND CORRESPONDING PR. THIS PR HELPS IN DEFINING THE FINAL P RECOMMENDATION FOR THE SOIL. select PR from farm_p_ranges where crop_code = 1 and p_min<= x and P_max>= x; ================================================================================================== ============================ FARM PRODUCT P AND K RECOMMENDATION VALUE TABLE ------------------------------------------------------------------ FARM_RECOMMENDATION_BRAY_M3 ------------------------------------------ CREATE TABLE "HR"."FARM_RECOMMENDATION_BRAY_M3" ( "VALUE" VARCHAR2(3 BYTE), "CROP_CODE" NUMBER(3,0), "P_REC" NUMBER(3,0),
  • 16. "KF_REC" NUMBER(3,0), "KS_REC" NUMBER(3,0) ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; VALUE CROP_CODE P_REC KF_REC KS_REC ----------------------------------------------------- VL 3 100 130 110 L 3 75 90 70 O 3 58 40 40 VL 4 80 120 100 L 4 60 90 85 O 4 40 66 66 VL 5 160 220 195 L 5 115 156 136 O 5 98 106 106 VL 6 60 70 70 L 6 50 40 40 O 6 25 15 15 VL 7 60 70 70 L 7 50 40 40 O 7 30 15 15 L 8 50 50 50 O 8 15 15 15 VL 9 120 250 235 L 9 100 220 215 O 9 80 200 200
  • 17. VL 10 110 280 280 L 10 80 240 240 O 10 65 215 215 VL 11 80 180 180 L 11 60 140 140 O 11 35 95 95 VL 12 90 170 170 L 12 60 130 130 O 12 35 100 100 VL 13 40 50 50 L 13 30 35 35 O 13 10 0 0 THIS TABLE HELPS IN DETERMINING THE P AND K RECOMMENDATIONS BASED ON THE PR AND KR VALUE WE GET FROM THE P AND K RANGE TABLES. BASED ON THE VALUE AND CROP CODE WE MATCH THE P_REC ,KF_REC AND KS_REC. selectp_rec from farm_recommendation_bray_M3 where crop_code = 10 and value = ''VL"; selectKF_rec,KS_rec from farm_recommendation_bray_M3 where crop_code = 11 and value = ''L"; ================================================================================================== ================================================ FARM SOIL INFORMATION ENTRY TABLE. ------------------------------------------ FARM_SOIL_FERT_SAMPLE_INFO ------------------------------ CREATE TABLE "HR"."FARM_SOIL_FERT_SAMPLE_INFO" ( "CLIENT_ID" NUMBER(7,0),
  • 18. "CLIENT_SAMPLE_ID" VARCHAR2(6 BYTE), "TOOL_SAMPLE_ID" NUMBER(7,0), "LAB_ID" NUMBER(7,0) NOT NULL ENABLE, "DOS" DATE, "TILLAGE_DEPTH" NUMBER(2,0), "LIME" VARCHAR2(4 BYTE), "CROP_CODE" NUMBER(2,0), "TEST_SERIES_CODE" VARCHAR2(3 BYTE), CONSTRAINT "FARM_SOIL_FERT_SAMPLE_INFO_PK" PRIMARY KEY ("LAB_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ENABLE ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; THIS TABLE CONTAINS ALL THE FIELDS FOR WHICH THE FARMERS WILL PROVIDE THE VALUE. TOOL SAMPLE ID IS AN EXTRA COLUMN WHICH KEEPS TRACK OF ALL THE SAMPLE ID BEING SAVED IN THE LIMS. TOOL_SAMPLE_ID AND LAB_ID ARE AUTOMATICALLY FILLED BY THE LIMS SOFTWARE. ================================================================================================== ====================================================== FARM SOIL TEST RESULT TABLE ---------------------------------------------------- FARM_SOIL_FERT_TEST_RESULTS
  • 19. ----------------------------------------------------- CREATE TABLE "HR"."FARM_SOIL_FERT_TEST_RESULTS" ( "CLIENT_SAMPLE_ID" NUMBER(4,0), "TOOL_SAMPLE_ID" NUMBER(6,0), "LAB_ID" NUMBER(7,0) NOT NULL ENABLE, "DOR" DATE, "CLIENT_ID" NUMBER(6,0), "FIRST_NAME" VARCHAR2(20 BYTE), "LAST_NAME" VARCHAR2(20 BYTE), "TEST_METHOD" VARCHAR2(4 BYTE), "TILLAGE_DEPTH" NUMBER(3,0), "CROP_CODE" NUMBER(3,0), "OM" NUMBER(5,2), "P" NUMBER(4,0), "K" NUMBER(4,0), "ZN" NUMBER(6,2), "PH" NUMBER(5,2), "BPH" NUMBER(5,2), "P_REC" NUMBER(4,0), "K_REC_FINE" NUMBER(4,0), "K_REC_SANDY" NUMBER(4,0), "ZN_BROAD" NUMBER(3,0), "ZN_BAND" NUMBER(3,0), "PH_1" NUMBER(7,2), "PH_2" NUMBER(7,2), "PH_3" NUMBER(7,2), "COMMENTS" VARCHAR2(1000 BYTE), "COMMENTS2" VARCHAR2(1000 BYTE), CONSTRAINT "FARM_SOIL_FERT_TEST_RESULT_PK" PRIMARY KEY ("LAB_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  • 20. STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ENABLE ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; THIS TABLE CONTAINS ALL THE COLUMNS WHICH ARE FILLED WHEN RESULTS OF ALL THE TESTS ARE RECEIVED FROM THE LAB. WHEN RUNNING THE SOFTWARE WE JUST HAVE TO FILL THE OM, P, K, ZN, PH, BPH VALUE AND REST ARE AUTOMATICALLY FILLED BY THE SOFTWARE. COMMENTS2 COLUMN IS FOR FILLING ANY EXTRA COMMENTS WE WILL HAVE ON EACH LAB_ID. ================================================================================================== =============================================== THE FARM SOIL TEST METHOD LAB IS FOLLOWING -------------------------------------------------- FARM_SOIL_TEST_METHOD -------------------------------------------- CREATE TABLE "HR"."FARM_SOIL_TEST_METHOD" ( "TEST_CODE" NUMBER(2,0) NOT NULL ENABLE, "TEST_NAME" VARCHAR2(25 BYTE), CONSTRAINT "FARM_SOIL_TEST_METHOD_PK" PRIMARY KEY ("TEST_CODE") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ENABLE
  • 21. ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; TEST_CODE TEST_NAME --------------------------------- 1 bray and M3 2 olsen 3 M3ICP IT CONTAINS NAMES OF ALL THE KIND OF TEST TECHNIQUES WE USE. ================================================================================================== ============================================= FARM SOIL TEST SERIES NAMES AND CODES ----------------------------------------------- FARM_SOIL_TEST_SERIES_CODE ---------------------------------------------- CREATE TABLE "HR"."FARM_SOIL_TEST_SERIES_CODE" ( "TEST_CODE" VARCHAR2(3 BYTE) NOT NULL ENABLE, "TESTS" VARCHAR2(70 BYTE), "COST" NUMBER(4,0), "TEST_TYPE" VARCHAR2(20 BYTE), CONSTRAINT "FARM_SOIL_TEST_SERIES_CODE_PK" PRIMARY KEY ("TEST_CODE") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  • 22. STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ENABLE ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; TEST_CODE TESTS COST TEST_TYPE ------------------------------------------------------------------------------------ M1 Moist K and P and dry pH and lime 12 moist M2 Moist K and P and dry pH, lime and OM 15 moist M3 Moist K and P and dry pH, lime and Zn 16 moist M4 Moist K and P and dry pH, lime, OM and Zn 18 moist 1 Dry K and P and dry pH and lime 9 dry 2 Dry K and P and dry pH, lime and OM 12 dry 3 Dry K and P and dry pH, lime and Zn 13 dry 4 Dry K and P and dry pH, lime, OM and Zn 15 dry 5 pH and lime only 8 dry THIS TABLE CONTAINS ALL THE TEST SERIES CODE AND NAMES ALONG WITH THE COST AND TYPE OF TEST. TEST TYPE IS VERY IMPOPRTANT TO MAINTAIN AS IT DETERMINES THE K RECOMMENDATION. IT SHOULD BE "moist" or "dry". ================================================================================================== ================================================= FARM PRODUCT ZINC RANGES FOR RECOMMENDATIONS -------------------------------------------------------
  • 23. FARM_ZN_RANGE ----------------------------------------------------- CREATE TABLE "HR"."FARM_ZN_RANGE" ( "ZN_MIN" NUMBER(6,2), "ZN_MAX" NUMBER(6,2), "ZN_BROAD" NUMBER(3,0), "ZN_BAND" NUMBER(3,0), "ZN_VALUE" VARCHAR2(2 BYTE) ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; ZN_MIN ZN_MAX ZN_BROAD ZN_BAND ZN_VALUE ------------------------------------------------------ 0 0.4 10 2 L 0.5 0.8 5 1 M 0.9 1000 0 0 A THIS TABLE CONTAINS THE RANGES OF ZINC VALUE FOR DETERMINING THE RECOMMENDATION VALUE FOR ZINC. WE CALCULATE THE ZINC VALUE FROM LAB TEST AND DETERMINE ZN_BROAD AND ZN_BAND FROM THAT VALUE WHICH ARE THE FINAL RECOMMENDATION. selectzn_broad, zn_band from farm_zn_range where zn_min<= x and zn_max>= x; ================================================================================================== =================================================
  • 24. LAB ID AND TOOL SAMPLE ID TRACKER -------------------------------------------------------- LAB_ID_TRACKER ------------------------------------ CREATE TABLE "HR"."LAB_ID_TRACKER" ( "LAB_ID" NUMBER(7,0) NOT NULL ENABLE, "CLIENT_ID" NUMBER(7,0), "CLIENT_SAMPLE_ID" VARCHAR2(5 BYTE), "DOS" DATE, "TOOL_SAMPLE_ID" NUMBER(7,0), CONSTRAINT "LAB_ID_TRACKER_PK" PRIMARY KEY ("LAB_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ENABLE ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; THIS IS A AUTO FILLED TABLE WHICH HELPS GENERATION OF SEQUENTIAL LAB ID AND TOOL SAMPLE ID FOR GENERATING REPORTS AND GIVING ALL TESTS UNIQUE ID. Note - The data on the client details, soil info and the result table can be entered from back end as well but the proper header should be maintain. The proper format and the program to calculate and load are in a ------document.
  • 25. LIMS tool explanation. 1. This is the homepage of the tool. 2. NAME- HOMEPAGE.fmb 3. This page contains a custom menu , a header section and the main page. 4. The header section is the part with the logo and auto generated date. 5. For menu explanation see the next section.
  • 26. • Menu – this is a custom menu with the links to all the pages and some functionality such as closing the windows , saving the values, executing the queries, clearing the forms and deleting the value from the given text field. • It is basically broken into categories based on the type of clients we work for. • Logo – this is automatic loading logo of Iowa state university with the Soil and Plant Analysis Lab logo. • Date – this is a display item which shows the current date. It is automated and can’t be changed in running mode. • In the WHEN_NEW_FORM_INSTANCE TRIGGER OF THE FORM WE HAVE TO GIVE THE CODE TO VIEW THIS PART. • declare --x date; begin read_image_file('C:projlogo.jpg','any','image4'); SELECT to_date(sysdate,'dd-mon-yy') into :date FROM dual; end; • Enter – this is button when pressed go to client search page to search for existing client. We check if client is present in the system or not. If present then we directly enter the soil information we get from the paper form submitted by the clients. new_form('C:projclient_search.fmx',no_rollback,no_query_only,share_library_data);
  • 27. MENU DESIGN NAME – MENU.MMX 1. This menu contains all the links to different pages in the tool for different work. Like for farm products, horticulture products, research work, reports etc. 2. Right click on any tab here and click on the PL/SQL editor and there is a code for moving to that page . 3. Eg .new_form('c:projsoilinfo1.fmx',no_rollback,no_query_only,share_library_data); 4. This menu has to be explicitly attached to all the forms to see this menu on any page we open or else we will see the Default menu bar. 5. To attach this to any form open PROPERTY PALLETE of the form and look for the MENU MODULE tab as shown In the figure below and attach the menu file here. 6. The location of the menu bar is c:projmenu1.mmx
  • 28. 3. CLIENT SEARCH PAGE 1. NAME- CLIENT_SEARCH.FMX 2. This page also contains 3 section – Menu bar, header, body. 3. Menu bar and the header section are same for all the forms. 4. This page is for searching the details for existing clients and entering the soil samples information if client data is already present.
  • 29. 5. 6. This page is used for checking if we have the client present in our system. When we get soil info in form of a paper format we have to check for the presence of the client. If the user is present in the system we press ENTER button to enter the page where we enter and save the soil information. DECLARE p_idparamlist; p_name varchar(20) := 'client_id'; BEGIN --check if parameter already exists p_id := get_parameter_list(p_name); ifid_null(p_id) then p_id := create_parameter_list(p_name); else --destroy and recreate
  • 30. destroy_parameter_list(p_id); p_id := create_parameter_list(p_name); end if; --adding parameter to parameter list add_parameter(p_id,'ID', text_parameter, to_char(:block2.text_item11)); new_form ('c:projSOILINFO1.fmx',no_rollback,no_query_only,share_library_data,p_id); if not form_success then message('ERROR: Unable to open the form. '); raiseform_trigger_failure; end if; EXCEPTION when others then message('ERROR: Unable to create parameter list. '); raiseform_trigger_failure; end; This code sends the client ID as a parameter to the next soil info page so that we don’t have to enter the value of the ID, and other details like NAME, etc. again. 7. If the user is not present in our system we can use the menu to enter the Client information and the corresponding soil information in the designated page. 8. Link for new user is MENU > FARM PRODUCTS > SOIL INFO ENTRY (N). 9. We can check for various client at a time and then enter the values of soil information for all the clients one-by-one.
  • 31. 10. Home – this is a button which takes to the homepage when pressed. We can also use the menu for the same purpose.new_form('C:projhomepage.fmx',no_rollback,no_query_only,share_library_data); 11. Search fields- these are the fields through which we can search the user. We can use any of the fields to locate information for any user. 12. We have to enter any value and press TAB and all fields are automatically filled. If user is not present tool gives appropriate message. 13. LOV – first name , last name, ID has a LOV attached with it where we can easily search for any user. 14. As we know there are many client who subsequently have their own clients (submitter) we maintain separate instance for all client and submitter instance. Like we see McCorkle Kent is repeated twice in the client details but the submitter is different. This helps in generating separate reports for separate clients. 15. When these fields are clicked the LOV open automatically and we can choose any user. 16. When we select any user from LOV or search from other text fields all the other fields are filled automatically. 17. To make the LOV we go through LOV wizard and then attach it with the required text fields. 18. These LOV are present on CLIENT_ID,CLIENT_FIRST_NAME,CLIENT_LAST_NAME. 19. Phone_number- this field has a POST_TEXT-ITEM TRIGGER on it to search from the database if we search with phone number. BEGIN selectclient_id into :text_item11 from client_details where phone = :text_item9; selectfirst_name into :text_item7 from client_details where phone = :text_item9; selectlast_name into :text_item8 from client_details where phone = :text_item9; select phone into :text_item9 from client_details where phone = :text_item9; select email into :text_item10 from client_details where phone = :text_item9; EXCEPTION
  • 32. whentoo_many_rows then message('Multiple value detected. Try different filters.'); whenno_data_found then message('No matching records could be found in the database. try different filters.'); END; 20. This code will fill all the details in all the respective fields if data is present. 21. EMAIL_ID – this is also a search field if we search with EMAIL_ID. It works the same as the phone number text item. BEGIN selectclient_id into :text_item11 from client_details where email = :text_item10; selectfirst_name into :text_item7 from client_details where email = :text_item10; selectlast_name into :text_item8 from client_details where email = :text_item10; select phone into :text_item9 from client_details where email = :text_item10; select email into :text_item10 from client_details where email = :text_item10; EXCEPTION whentoo_many_rows then message('Multiple value detected. Try different filters.'); whenno_data_found then message('No matching records could be found in the database. try different filters.'); END; 22. When a user is found we have to press ENTER button to enter the next page for soil info entry. 23. New search – this button clears the form and we can do a new search. go_block('block2');
  • 33. clear_block; SOILINFO ENTRY PAGE(FOR EXISTING USERS) NAME – SOILINFO1.FMX 1. This form is to enter the soil information given by the clients. 2. We get to this page from the CLIENT_SEARCH page. This page automatically fills the client information by taking the parameter from last page and having a trigger WHEN_NEW_FORM_INSTANCE. declare id1 varchar(10); BEGIN read_image_file('C:projlogo.jpg','any','image4'); SELECT to_date(sysdate,'dd-mon-yy') into :date FROM dual;
  • 34. --showing id intoclient_id text item :block7.client_id:= :parameter.ID; id1 :=:parameter.ID; --showing all the values in the respective text items. selectfirst_name into :block7.first_name from CLIENT_DETAILS where client_id = id1; selectlast_name into :block7.last_name from CLIENT_DETAILS where client_id = id1; select doc into :block7.doc from CLIENT_DETAILS where client_id = id1; select address into :block7.address from CLIENT_DETAILS where client_id = id1; select city into :block7.city from CLIENT_DETAILS where client_id = id1; select state into :block7.state from CLIENT_DETAILS where client_id = id1; select zip into :block7.zip from CLIENT_DETAILS where client_id = id1; select county into :block7.county from CLIENT_DETAILS where client_id = id1; select phone into :block7.phone from CLIENT_DETAILS where client_id = id1; select email into :block7.email from CLIENT_DETAILS where client_id = id1; selectsubmitter_id into :block7.submitter_id from CLIENT_DETAILS where client_id = id1; selectsub_first_name into :block7.sub_first_name from CLIENT_DETAILS where client_id = id1; selectsub_last_name into :block7.sub_last_name from CLIENT_DETAILS where client_id = id1; select username into :block7.username from CLIENT_DETAILS where client_id = id1; select password into :block7.password from CLIENT_DETAILS where client_id = id1; select comments into :block7.comments from CLIENT_DETAILS where client_id = id1; go_block('block60'); go_item('block60.text_item62'); END; 3. Client info frame – This frame is filled automatically and cannot be changed here. It takes the parameter from client search page and displays all the information about the client. 4. If we wish to change any value in the CLIENT INFO then we can make the change here and press ENTER key to save it. DECLARE
  • 35. BEGIN update CLIENT_DETAILS set client_id= :BLOCK7.client_id ,first_name = :BLOCK7.first_name , last_name = :BLOCK7.last_name, doc = :BLOCK7.doc, address= :BLOCK7.address, city=:BLOCK7.city,state=:BLOCK7.state,zip=:BLOCK7.zip,county=:BLOCK7.county,email=:BLOCK7.email,p hone=:BLOCK7.phone,submitter_id=:BLOCK7.submitter_id,sub_first_name=:BLOCK7.sub_first_name,su b_last_name=:BLOCK7.sub_last_name,username=:BLOCK7.username,password=:BLOCK7.password,com ments=:BLOCK7.comments where client_id = :BLOCK7.client_id; EXCEPTION when DUP_VAL_ON_INDEX then message('CLIENT ID NOT RECOGNIZED'); END; 5. For entry for a new client we have to go back to client_searchpage to search the user and press ENTER in that page to come to this page. It helps in removing any discrepancies while entering values. 6. Soil sample info frame – this frame is for entering the value of soil sample. 7. The client ID is automatically filled. 8. Click on client sample ID and enter the value given by the client. 9. When we click on the SOIL SAMPLE INFO FRAME We will get the client ID filled automatically. 10. For that purpose we have a Trigger on client ID text fields 11. :block60.text_item62 := :BLOCK7.CLIENT_ID; -- this copies the value from CLIENT_INFO FRAME - CLIENT_ID 12. This is a custom form so the navigation was done manually. In the property pallet of all the fields we change the NEXT NAVIGATION FIELD to the next item we want to go. 13. While running the tool just press tab as everything is done. 14. LAB_ID is generated automatically for the first time as it takes value from LAB_ID_TRACKER table with the help of code written in the POST_TEXT_ITEM trigger in CLIENT_SAMPLE_ID. declare -- x number; y number; begin select max(coalesce(lab_id,0))+1 into y from lab_id_tracker; :TEXT_ITEM103 :=y; end;
  • 36. 15. The next LAB_IDs are generated by adding 1 to the previous LAB_ID. This is done in this way to make it easy to enter values of all the soil info without maintaining the requirement of entering consecutive LAB_ID. 16. Crop code and test code have a check on them to accept only accepted value listed in right hand side of page. It does not allow any invalid value. 17. Both CROP_CODE and TEST_CODE fields have a POST_TEXT_ITEM trigger on them. 18. For CROP_CODE DECLARE a varchar2(130); b number; BEGIN set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); select count(crop_name) into b from FARM_CROP_DETAILS where crop_code =:text_item154; if b=0 then message('CROP CODE NOT RECOGNIZED'); raiseform_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); else selectcrop_name into a from FARM_CROP_DETAILS where crop_code =:text_item154; message(a); set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); END IF; set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); --set_item_property('block60.TEXT_ITEM154', next_navigation_item,'block60.TEXT_ITEM164'); EXCEPTION whenno_data_found then message ('no data'); set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); END;
  • 37. 19. For TEST_CODE DECLARE a varchar2(130); b number; BEGIN set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); select count(TEST_code) into b from FARM_SOIL_TEST_SERIES_CODE where TEST_code =:text_item164; if b=0 then message('TEST CODE NOT RECOGNIZED'); raiseform_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); else select TESTS into a from FARM_SOIL_TEST_SERIES_CODE where TEST_code =:text_item164; message(a); set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); END IF; set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); --set_item_property('block60.TEXT_ITEM154', next_navigation_item,'block60.TEXT_ITEM164'); EXCEPTION whenno_data_found then message ('no data of test'); set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); END;
  • 38. 20. These value are dynamically matched with the values in the FARM_CROP_DETAILSand FARM_SOIL_TEST_SERIES_CODE table . 21. These values can be edited from MENU >FARM_PRODUCTS> EDIT VALUES tab. 22. All the rows except row 1 are disabled. 23. After entering 1 row press ENTER to save the values in database and enable the next row for entry of a new information for same client. DECLARE BEGIN insert into HR.FARM_SOIL_FERT_SAMPLE_INFO values(:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM93,:BLOCK60.TEXT_ITEM1 03,:BLOCK60.TEXT_ITEM113,:BLOCK60.TEXT_ITEM124,:BLOCK60.RADIO_GROUP134,:BLOCK60.TEXT_ITE M154,:BLOCK60.TEXT_ITEM164,:BLOCK60.TEXT_ITEM343); COMMIT; insert into HR.lab_id_tracker values(:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM 113,:BLOCK60.TEXT_ITEM93); COMMIT; SET_ITEM_PROPERTY ( 'BLOCK60.ITEM73',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.ITEM73',background_color,'r88g100b75'); GO_ITEM('BLOCK60.ITEM73'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM84',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM84',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM94',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM94',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM104',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM104',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM114',ENABLED ,PROPERTY_TRUE);
  • 39. --Set_item_property('BLOCK60.text_ITEM114',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM125',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM125',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.radio_group183',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.radio_group183',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM155',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM155',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM165',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM165',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM344',ENABLED ,PROPERTY_TRUE); SET_ITEM_PROPERTY ( 'BLOCK60.push_button175',ENABLED ,PROPERTY_TRUE); SET_ITEM_PROPERTY ( 'BLOCK60.push_button211',ENABLED ,PROPERTY_TRUE); GO_ITEM('BLOCK60.ITEM73'); --message('color'); END; 24. The DELETE button delete any information entered. DECLARE BEGIN DELETE FROM HR.FARM_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID = :BLOCK60.TEXT_ITEM104; DELETE FROM HR.lab_id_tracker WHERE LAB_ID = :BLOCK60.TEXT_ITEM104; commit; GO_ITEM('BLOCK60.ITEM73'); END; 25. After the last row is filled press ENTER/CLEAR button to clear the whole frame and enter new value. It just clears the frame and all the previous rows entered previously are saved in the database.
  • 40. declare begin insert into HR.FARM_SOIL_FERT_SAMPLE_INFO values(:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM101,:BLOCK60.TEXT_ITEM 111,:BLOCK60.TEXT_ITEM121,:BLOCK60.TEXT_ITEM132,:BLOCK60.RADIO_GROUP204,:BLOCK60.TEXT_IT EM162,:BLOCK60.TEXT_ITEM172,:BLOCK60.TEXT_ITEM351); commit; insert into HR.lab_id_tracker values(:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM 121,:BLOCK60.TEXT_ITEM101); commit; go_item ('BLOCK60'); clear_block; GO_ITEM('BLOCK60.ITEM62'); END; 26. BACK TO SEARCH button takes back to the client search page for entering new information. 27. new_form('C:projclient_search.fmx',no_rollback,no_query_only,share_library_data); 28. CLEAR FORM clears the form. declare begin GO_block('BLOCK7'); CLEAR_BLOCK(no_validate); GO_block('BLOCK60'); CLEAR_BLOCK(no_validate); message('d'); end;
  • 41. SOIL INFO ENTRY PAGE(FOR NEW USERS) NAME - NEW_USER_SOILINFO.fmx 1. THIS form is used to enter the user information and the soil information for any new client when the client is not already present in the system. 2. it is almost the same as the above explained form with 2-3 modification. 3. To come to this page we have to navigate through the MENU BAR >FARM PRODUCTS>SOIL INFO ENTRY(N) . 4. The CLIENT INFORMATION FRAME has a CLIENT ID field which is auto generated and no parameter passing is being done as in the last case. 5. Here the WHEN_NEW_FORM_INSTANCE Trigger is quite different. DECLARE id1 varchar(10); BEGIN read_image_file('C:projlogo.jpg','any','image4'); SELECT to_date(sysdate,'dd-mon-yy') into :date FROM dual; select max(client_id)+1 into id1 from hr.client_details; message('The new grower ID is '|| id1); :BLOCK7.client_id := id1; END;
  • 42. This code checks the maximum CLIENT_ID from CLIENT_DETAILS TABLE and adds 1 to generate new ID. 6. The client information frame is for entering the value of client details. 7. The text boxes have individual checks on them like: 8. Id – number only (auto) 9. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to FM999999999 10. Doc – sysdate(auto) can be changed (date of profile creation) SELECT to_date(sysdate,'dd-mon-yy') into :DOC FROM dual; 11. Zip – 5 digit number only 12. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to 99999 13. Phone – 10 digit number only 14. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to 9999999999 15. Email – in the format of ‘xyz@ab.com’ only 16. For this we have a POST_TEXT_ITEM trigger on EMAIL Text field.
  • 43. DECLARE v_emailvarchar2(100); v_length number(10); v_errorvarchar2(10):='OK'; v_rates number(5):=0; v_dots number(5):=0; v_spfoundboolean; v_retvarchar2(100); BEGIN v_email := :email; v_length:=length(v_email); fori in 1..v_length loop ifsubstr(v_email,i,1)='@' then ---counting @ v_rates:=v_rates+1; end if; ifsubstr(v_email,i,1)='.' then ---counting dots v_dots:=v_dots+1; end if; end loop; --message (v_length); --if v_length = 0 then --gotoexitif; ifascii(substr(v_email,1,1)) between 48 and 57 then v_error:='SN'; elsifascii(substr(v_email,1,1)) not between 97 and 122 then v_error:='FS';
  • 44. elsif v_rates =0 or v_dots = 0 then message ('Incomplete email address'); elsif notv_rates=1 or v_dots> 2 then v_error:='SE'; elsifv_dots =2 then ifinstr(v_email,'.',1,2) <instr(v_email,'@') then v_error:='DFM'; elsif abs(instr(v_email,'.',1,2)-instr(v_email,'@'))=1 then v_error:='DFM'; elsif abs(instr(v_email,'.')-instr(v_email,'@'))=1 then v_error:='DFM'; elsifinstr(v_email,'@') not between instr(v_email,'.') and instr(v_email,'.',1,2) then v_error:='DFM'; end if; elsifv_dots=1 then ifinstr(v_email,'@') >instr(v_email,'.') then v_error:='FM'; elsif abs(instr(v_email,'.')-instr(v_email,'@'))=1 then v_error:='FM'; END IF; END IF; select decode(v_error,'OK','Emailverified','SE','Single Email Allowed','DFM','format not matched email@removed',
  • 45. 'SN','Starting Number found','FS','First Special Character found','FM','Wrong format email@removed') intov_ret from dual; message(v_ret); END; 17. Username and password for future use. Optional to fill it. 18. ENTER button saves the info in the database. DECLARE BEGIN insert into HR.CLIENT_DETAILS values(:BLOCK7.client_id,:BLOCK7.first_name,:BLOCK7.last_name,:BLOCK7.doc,:BLOCK7.address,:BLOCK 7.city,:BLOCK7.state,:BLOCK7.zip,:BLOCK7.county,:BLOCK7.email,:BLOCK7.phone,:BLOCK7.submitter_id,: BLOCK7.sub_first_name,:BLOCK7.sub_last_name,:BLOCK7.username,:BLOCK7.password,:BLOCK7.comm ents); COMMIT; EXCEPTION when DUP_VAL_ON_INDEX then message('CLIENT ID NOT RECOGNIZED'); END; 19. Soil information frame works same as the form in soil information entry form for existing users with several checks and automated data entry. 20. After entering the user information click on client id in SOIL INFORMATION frame end fill the form with ENTER button press on every individual row entry. 21. Crop details and test details display area for reference purpose. 22. When we click on the SOIL SAMPLE INFO FRAME We will get the client ID filled automatically. 23. For that purpose we have a Trigger on client ID text fields 24. :block60.text_item62 := :BLOCK7.CLIENT_ID; -- this copies the value from CLIENT_INFO FRAME - CLIENT_ID 25. This is a custom form so the navigation was done manually. In the property pallet of all the fields we change the NEXT NAVIGATION FIELD to the next item we want to go. 26. While running the tool just pre tab as everything is done. 27. CLIENT_SAMPLE_ID has a POST_TEXT_ITEM trigger on it to generate the next consecutive LAB ID and TOOL SAMPLE ID.
  • 46. DECLARE x number; y number; BEGIN select max(coalesce(tool_sample_id,0))+1 into x from lab_id_tracker; :TEXT_ITEM93 :=x; select max(coalesce(lab_id,0))+1 into y from lab_id_tracker; :TEXT_ITEM103 :=y; END; 28. LAB_ID is generated automatically for the first time as it takes value from LAB_ID_TRACKER table with the help of code written in the POST_TEXT_ITEM trigger in CLIENT_SAMPLE_ID. declare -- x number; y number; begin select max(coalesce(lab_id,0))+1 into y from lab_id_tracker; :TEXT_ITEM103 :=y; end; 29. The next LAB_IDs are generated by adding 1 to the previous LAB_ID. This is done in this way to make it easy to enter values of all the soil info without maintaining the requirement of entering consecutive LAB_ID. 30. Crop code and test code have a check on them to accept only accepted value listed in right hand side of page. It does not allow any invalid value. 31. Both CROP_CODE and TEST_CODE fields have a POST_TEXT_ITEM trigger on them. 32. For CROP_CODE DECLARE a varchar2(130); b number; BEGIN set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
  • 47. select count(crop_name) into b from FARM_CROP_DETAILS where crop_code =:text_item154; if b=0 then message('CROP CODE NOT RECOGNIZED'); raiseform_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); else selectcrop_name into a from FARM_CROP_DETAILS where crop_code =:text_item154; message(a); set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); END IF; set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); --set_item_property('block60.TEXT_ITEM154', next_navigation_item,'block60.TEXT_ITEM164'); EXCEPTION whenno_data_found then message ('no data'); set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); END; 33. For TEST_CODE DECLARE a varchar2(130); b number; BEGIN set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); select count(TEST_code) into b from FARM_SOIL_TEST_SERIES_CODE where TEST_code =:text_item164;
  • 48. if b=0 then message('TEST CODE NOT RECOGNIZED'); raiseform_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); else select TESTS into a from FARM_SOIL_TEST_SERIES_CODE where TEST_code =:text_item164; message(a); set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); END IF; set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); --set_item_property('block60.TEXT_ITEM154', next_navigation_item,'block60.TEXT_ITEM164'); EXCEPTION whenno_data_found then message ('no data of test'); set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); END; 34. These value are dynamically matched with the values in the FARM_CROP_DETAILSand FARM_SOIL_TEST_SERIES_CODE table . 35. These values can be edited from MENU > EDIT VALUES tab. 36. All the rows except row 1 are disabled. 37. After entering 1 row press ENTER to save the values in database and enable the next row for entry of a new information for same client. DECLARE BEGIN
  • 49. insert into HR.FARM_SOIL_FERT_SAMPLE_INFO values(:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM93,:BLOCK60.TEXT_ITEM1 03,:BLOCK60.TEXT_ITEM113,:BLOCK60.TEXT_ITEM124,:BLOCK60.RADIO_GROUP134,:BLOCK60.TEXT_ITE M154,:BLOCK60.TEXT_ITEM164,:BLOCK60.TEXT_ITEM343); COMMIT; insert into HR.lab_id_tracker values(:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM 113,:BLOCK60.TEXT_ITEM93); COMMIT; SET_ITEM_PROPERTY ( 'BLOCK60.ITEM73',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.ITEM73',background_color,'r88g100b75'); GO_ITEM('BLOCK60.ITEM73'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM84',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM84',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM94',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM94',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM104',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM104',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM114',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM114',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM125',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM125',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.radio_group183',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.radio_group183',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM155',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.text_ITEM155',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM165',ENABLED ,PROPERTY_TRUE);
  • 50. --Set_item_property('BLOCK60.text_ITEM165',background_color,'r88g100b75'); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM344',ENABLED ,PROPERTY_TRUE); SET_ITEM_PROPERTY ( 'BLOCK60.push_button175',ENABLED ,PROPERTY_TRUE); SET_ITEM_PROPERTY ( 'BLOCK60.push_button211',ENABLED ,PROPERTY_TRUE); GO_ITEM('BLOCK60.ITEM73'); --message('color'); END; 38. The DELETE button delete any information entered. DECLARE BEGIN DELETE FROM HR.FARM_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID = :BLOCK60.TEXT_ITEM104; DELETE FROM HR.lab_id_tracker WHERE LAB_ID = :BLOCK60.TEXT_ITEM104; commit; GO_ITEM('BLOCK60.ITEM73'); END; 39. After the last row is filled press ENTER/CLEAR button to clear the whole frame and enter new value. It just clears the frame and all the previous rows entered previously are saved in the database. declare begin insert into HR.FARM_SOIL_FERT_SAMPLE_INFO values(:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM101,:BLOCK60.TEXT_ITEM 111,:BLOCK60.TEXT_ITEM121,:BLOCK60.TEXT_ITEM132,:BLOCK60.RADIO_GROUP204,:BLOCK60.TEXT_IT EM162,:BLOCK60.TEXT_ITEM172,:BLOCK60.TEXT_ITEM351); commit;
  • 51. insert into HR.lab_id_tracker values(:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM 121,:BLOCK60.TEXT_ITEM101); commit; go_item ('BLOCK60'); clear_block; GO_ITEM('BLOCK60.ITEM62'); END; 40. BACK TO SEARCH button takes back to the client search page for entering new information. 41. new_form('C:projclient_search.fmx',no_rollback,no_query_only,share_library_data); 42. CLEAR FORM clears the form. declare begin GO_block('BLOCK7'); CLEAR_BLOCK(no_validate); GO_block('BLOCK60'); CLEAR_BLOCK(no_validate); message('d'); end;
  • 52. SOIL FERTILITY TEST GENERATION AND REPORT GENERATION NAME= FERT_TEST_RESULT_ENTRY.fmx This is a form to enter the test results values received from lab and generate the recommendations based on the values. 1. This form consists of MENU BAR, HEADER and 3 frames. 2. MENU BAR AND THE HEADER are same as all the other forms. 3. TEST INFORMATION- this frame works on the LAB ID for each soil sample tested. Enter the LAB ID associated with soil sample and press TAB. All information about the tests performed are auto filled in the rest of the fields for checking purpose. 4. For this we have a POST_TEXT_ITEM Trigger on LAB ID text field. DECLARE
  • 53. test varchar2(70); BEGIN selectclient_id into :client_id from FARM_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; select CLIENT_SAMPLE_ID into :CLIENT_SAMPLE_ID from FARM_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; selecttool_SAMPLE_ID into :tool_SAMPLE_ID from FARM_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; selectfirst_name into :first_name from client_details where client_id= :client_id; selectlast_name into :last_name from client_details where client_id= :client_id; selectto_date(sysdate,'dd-mon-yy') into :dor from dual; select TEST_SERIES_CODE into :test_method from FARM_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; selecttillage_depth into :tillage_depth from FARM_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; selectcrop_code into :crop_code from FARM_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; select tests into test from FARM_SOIL_TEST_SERIES_CODE where test_code = :test_method; message (test); EXCEPTION when NO_DATA_FOUND then message ('The value entered does not have any records present. Please recheck the Lab ID. '); END;
  • 54. 5. 6. TEST RESULTS – this frame is for entering the values of the test results we receive from the lab. 7. Then press COMPUTE button to generate all the recommendation. And fill the next frame. 8. For this we have a WHEN_BUTTON_PRESSED trigger with the following code. DECLARE P1 NUMBER:=0; C NUMBER:=0; PR1 VARCHAR2(3); P_REC2 NUMBER:=0; V_TEST_TYPE VARCHAR2(10); V_TEST_CODE NUMBER:=0; K1 NUMBER:=0; KR1 VARCHAR2 (3);
  • 55. KF_REC2 NUMBER:=0; KS_REC2 NUMBER:=0; ZN1 NUMBER(6,2):=0; V_ZN_BROAD NUMBER :=0; V_ZN_BAND NUMBER :=0; BPH1 NUMBER(6,2):=0; V_TILLAGE_DEPTH NUMBER:=0; PH1 NUMBER(7):=0; PH2 NUMBER(7):=0; PH3 NUMBER(7):=0; BEGIN C:=:CROP_CODE; P1:= :P; IF P1 IS NULL THEN NULL; ELSE --P1:= NVL(:P,0); --CALCULATING THE PHOSPHORUS RECOMMENDATION SELECT PR INTO PR1 FROM FARM_P_RANGE WHERE CROP_CODE = C AND P_MIN<= P1 AND P_MAX >= P1; IF PR1 = 'H' OR PR1 = 'VH' THEN :P_REC := 0; ELSE SELECT P_REC INTO P_REC2 FROM FARM_RECOMMENDATION_BRAY_M3 WHERE CROP_CODE=C AND VALUE = PR1; :P_REC := P_REC2; --MESSAGE (P_REC2); END IF; END IF;
  • 56. -- CALCULATING THE POTASSIUM RECOMMENDATION K1:= :K; IF K1 IS NULL THEN NULL; ELSE --K1:=NVL(:K,0); SELECT TEST_TYPE INTO V_TEST_TYPE FROM FARM_SOIL_TEST_SERIES_CODE WHERE TEST_CODE=:TEST_METHOD; SELECT KR INTO KR1 FROM FARM_K_RANGE WHERE TEST_TYPE = V_TEST_TYPE AND K_MIN<= K1 AND K_MAX>=K1; IF KR1 = 'H' OR KR1 = 'VH' THEN :K_REC_FINE:=0; :K_REC_SANDY:=0; ELSE SELECT KF_REC INTO KF_REC2 FROM FARM_RECOMMENDATION_BRAY_M3 WHERE CROP_CODE=C AND VALUE = KR1; SELECT KS_REC INTO KS_REC2 FROM FARM_RECOMMENDATION_BRAY_M3 WHERE CROP_CODE=C AND VALUE = KR1; :K_REC_FINE:=KF_REC2; :K_REC_SANDY:=KS_REC2; END IF; END IF; --CALCULATING FOR ZINC RECOMMENDATION ZN1:= :ZN; IF ZN1 IS NULL THEN NULL; ELSE
  • 57. SELECT ZN_BROAD INTO V_ZN_BROAD FROM FARM_ZN_RANGE WHERE ZN_MIN <= ZN1 AND ZN_MAX >= ZN1; SELECT ZN_BAND INTO V_ZN_BAND FROM FARM_ZN_RANGE WHERE ZN_MIN <= ZN1 AND ZN_MAX >= ZN1; :ZN_BROAD := V_ZN_BROAD; :ZN_BAND :=V_ZN_BAND; END IF; --CALCULATING FOR THE PH CONTENT RECOMMENDATION -- (38619 - (5915*C3))*(B3*0.167) BPH1:= :BPH; V_TILLAGE_DEPTH :=:TILLAGE_DEPTH; IF BPH1 IS NULL THEN NULL; ELSE PH1 := (38619 - (5915*BPH1))*(V_TILLAGE_DEPTH*0.167) ; PH2 := (49886 - (7245 * BPH1 )) * (V_TILLAGE_DEPTH * 0.167); PH3 := (58776 - (8244*BPH1))*(V_TILLAGE_DEPTH*0.167); END IF; --ROUNDING PH6.0 VALUES TO NEAREST 100 FOR +VE VALUES. -VE ARE CHANGED TO 0. IF PH1 <0 THEN PH1 :=0; :PH_1:=PH1; ELSE SELECT ROUND(PH1,-2) INTO :PH_1 FROM DUAL; END IF;
  • 58. --ROUNDING PH6.5 VALUES TO NEAREST 100 FOR +VE VALUES. -VE ARE CHANGED TO 0. IF PH2 <0 THEN PH2 :=0; :PH_2:=PH2; ELSE SELECT ROUND(PH2,-2) INTO :PH_2 FROM DUAL; END IF; --ROUNDING PH6.9 VALUES TO NEAREST 100 FOR +VE VALUES. -VE ARE CHANGED TO 0. IF PH3 <0 THEN PH3 :=0; :PH_3:=PH3; ELSE SELECT ROUND(PH3,-2) INTO :PH_3 FROM DUAL; END IF; -- DISPLAYING COMMENTS BASED ON CROP CODES SELECT COMMENTS INTO :COMMENTS FROM FARM_COMMENTS WHERE CROP_CODE = C; EXCEPTION WHEN OTHERS THEN MESSAGE('UNABLE TO GENERATE RECOMMENDATIONS. PLEASE CHECK THE VALUES ENTERED.'); END;
  • 59. 9. 10. RECOMMENDATIONS – this frame shows all the recommendations generated by the system based on the calculations provided along with the comments. 11. Press SAVE button to save all information in the database.(important) 12. For this we have a WHEN_BUTTON_PRESSED Trigger with COMMIT_FORM; command. 13. CLEAR FORM – clears the form for a new entry based on different LAB ID. 14. For this we have a WHEN_BUTTON_PRESSED Trigger with GO_BLOCK('FARM_SOIL_FERT_TEST_RESULTS'); CLEAR_block; 15. REPORT – takes to the report generation form to generate the reports based on individual client ID and the date when the results were entered. 16. For this we have a WHEN_BUTTON_PRESSED Trigger with new_form('c:projFERT_TEST_REPORT.fmx',no_rollback,no_query_only,share_library_data);
  • 60. FARM TEST RESULT REPORT GENERATION NAME – FERT_TEST_REPORT.FMX Report - FERT_RESULT_REPORT5.RDF This is a form from which will generate the results report in pdf format. 1. The search fields are to be used to tell the system which LAB _ID report is to be called. 2. CLIENT_ID- to specify ID of the client. 3. This has a LOV attached with it to select the names of the client. 4. The LOV was prepared using the LOV wizard and CLIENT ID text field was attached to it. 5. START_ID & END_ID are to give consecutive LAB_IDs for the same client. 6. If the client are different for all the LAB ID given it will show an ERROR. 7. The LAB ID should be consecutive or same if only 1 LAB ID to be used. 8. When START_LAB_ID is entered the END LAB ID copies the ID so as to make it easier for the user to enter next LAB ID in continuation. 9. For this we use POST-TEXT-ITEM on START LAB ID BEGIN :BLOCK2.TEXT_ITEM6 :=:BLOCK2.TEXT_ITEM5; END;
  • 61. 10. To make a form to call report we first make a REPORT OBJECT in the OBJECT NAVIGATOR. 11. This form has a REPORT OBJECT named REP which is used in the code given below. 12. When SHOW REPORT button is pressed a new tab is opened in the browser where the report is generated and shown in PDF format. We can SAVE and PRINT the report from there. 13. For this we use WHEN_BUTTON_PRESSED trigger on SHOW REPORT button with following code to call the report. DECLARE --VARIABLES FOR REPORT GENERATION REPID REPORT_OBJECT; V_REP VARCHAR2(200); REP_STATUS VARCHAR2(20); PLID PARAMLIST; STR_REPORT_SERVER_JOB VARCHAR2(300); STR_JOB_ID VARCHAR2(300); STR_URL VARCHAR2(300); ID NUMBER;--VARIABLES FOR CLIENT CHECK. ID2 NUMBER; L_ID NUMBER; L_ID2 NUMBER; LEN NUMBER:=0; I NUMBER:=0; CTR NUMBER:=0; BEGIN --CODE FOR CHECKING IF ALL THE CLIENTS ARE SAME FOR ALL THE LAB ID GIVEN. L_ID :=:TEXT_ITEM5;--START_ID L_ID2 :=:TEXT_ITEM6;--END_ID LEN := L_ID2-L_ID;
  • 62. SELECT CLIENT_ID INTO ID FROM FARM_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID; FOR I IN 0 .. LEN LOOP SELECT CLIENT_ID INTO ID2 FROM FARM_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+I; IF ID2<>ID THEN CTR:= CTR+1; END IF; ID2:=0; END LOOP; IF CTR>0 THEN MESSAGE('PLEASE CHECK THE LAB ID AS ALL THE CLIENTS ARE NOT SAME.'); ELSE -- REPORT GENERATION PLID := GET_PARAMETER_LIST('TMP'); IF NOT ID_NULL(PLID) THEN DESTROY_PARAMETER_LIST( PLID ); END IF; PLID := CREATE_PARAMETER_LIST('TMP'); -- ALTERNATE WAY TO GIVE PARAMETERS. --ADD_PARAMETER(PLID,'ID',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM4); --ADD_PARAMETER(PLID,'STARTDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM5); --ADD_PARAMETER(PLID,'ENDDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM6); ADD_PARAMETER(PLID, 'PARAMFORM', TEXT_PARAMETER, 'NO');
  • 63. REPID := FIND_REPORT_OBJECT('REP'); SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_COMM_MODE,SYNCHRONOUS); SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_DESTYPE,CACHE); SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_DESFORMAT,'PDF'); SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_OTHER,'PARAMFORM=NO'); SET_REPORT_OBJECT_PROPERTY(REPID, REPORT_FILENAME, 'C:PROJFERT_RESULT_REPORT5.RDF'); SET_REPORT_OBJECT_PROPERTY(REPID, REPORT_EXECUTION_MODE, BATCH); SET_REPORT_OBJECT_PROPERTY(REPID, REPORT_SERVER, 'REP_SOILTESTSERV'); SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_OTHER,'PARAMFORM=NO STARTID='||:BLOCK2.TEXT_ITEM5||' ENDID='||:BLOCK2.TEXT_ITEM6); STR_REPORT_SERVER_JOB := RUN_REPORT_OBJECT(REPID); -- MESSAGE(STR_REPORT_SERVER_JOB); REP_STATUS := REPORT_OBJECT_STATUS(STR_REPORT_SERVER_JOB); MESSAGE(REP_STATUS); WHILE REP_STATUS IN ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP REP_STATUS := REPORT_OBJECT_STATUS(STR_REPORT_SERVER_JOB); END LOOP; IF REP_STATUS = 'FINISHED' THEN --MESSAGE(STR_REPORT_SERVER_JOB);
  • 64. STR_JOB_ID := SUBSTR(STR_REPORT_SERVER_JOB, LENGTH('REP_SOILTESTSERV') + 2, LENGTH(STR_REPORT_SERVER_JOB)); STR_URL := '/REPORTS/RWSERVLET/GETJOBID' || STR_JOB_ID || '?SERVER=REP_SOILTESTSERV'; WEB.SHOW_DOCUMENT(STR_URL, '_BLANK'); DESTROY_PARAMETER_LIST(PLID); END IF; END IF; EXCEPTION WHEN OTHERS THEN MESSAGE ('PLEASE CHECK THE LAB ID ENTERED.'); END; 14. NEW REPORT button clears the form and we can generate a new report. It has a WHEN_BUTTON_PRESSED button with command as CLEAR_BLOCK;
  • 65. 15.
  • 66. REPORT 1. The report FERT_RESULT_REPORT5.RDF is made with the help of REPORT BUILDER. To edit the reports open REPORT BUIDER icon on desktop. This is a manual report. 2. Open the concerned report and go to REPORT WIZARD and do the required changes. 3. Any changes in the report can be done in DATA MODEL editor or the PAPER LAYOUT tab. 4. DATA MODEL shows the columns and fields being used in the report. 5. In this report we have 5 sections. 6. A. IOWA STATE UNIVERSITY ADDRESS AND AGRONOMY DEPARTMENT INFORMATION. 7. B. CLIENT INFORMATION AND DATE OF REPORT GENERATION. 8. These 2 parts are non-repeating so these are not in the recurring form. 9. The client information and the date values are fetched from the FORMULA column CF_1 – CF_8 10. The parent module starts after these 2 parts. 11. C.LAB TEST RESULTS AND FERTILIZER AND LIME SUGGESTIONS are separate repeating form which receives the value from the FARM_TEST_RESULTS table for the LAB_ID given. 12. These fields fetch values from the Q_1 query in the data model. 13. D. SUGGESTIONS. 14. This section displays the suggestion based on the crop codes. It is a repeating form but it will show only distinct values for suggestion. If the same crop code is repeated several times it shows only 1 copy of the suggestions and saves page. 15. For this we have a Q_2 in the data model which shows only distinct values. 16. E. ADDITIONAL COMMENTS. 17. This field shows any additional comments If present in the database. If additional comments are not present then this field will be blank. 18. This depends on the Q_1 in the data model. 19. All the definition of queries and formula are given below. 20. Q_1 – used by LAB TEST RESULTS, RECOMMENDATIONS SELECT ALL FARM_SOIL_FERT_TEST_RESULTS.CLIENT_SAMPLE_ID, FARM_SOIL_FERT_TEST_RESULTS.TOOL_SAMPLE_ID, FARM_SOIL_FERT_TEST_RESULTS.LAB_ID, FARM_SOIL_FERT_TEST_RESULTS.DOR, FARM_SOIL_FERT_TEST_RESULTS.CLIENT_ID, FARM_SOIL_FERT_TEST_RESULTS.FIRST_NAME, FARM_SOIL_FERT_TEST_RESULTS.LAST_NAME, FARM_SOIL_FERT_TEST_RESULTS.TEST_METHOD, FARM_SOIL_FERT_TEST_RESULTS.TILLAGE_DEPTH, FARM_SOIL_FERT_TEST_RESULTS.CROP_CODE, FARM_SOIL_FERT_TEST_RESULTS.OM, FARM_SOIL_FERT_TEST_RESULTS.P, FARM_SOIL_FERT_TEST_RESULTS.K, FARM_SOIL_FERT_TEST_RESULTS.ZN, FARM_SOIL_FERT_TEST_RESULTS.PH, FARM_SOIL_FERT_TEST_RESULTS.BPH, FARM_SOIL_FERT_TEST_RESULTS.P_REC, FARM_SOIL_FERT_TEST_RESULTS.K_REC_FINE,
  • 67. FARM_SOIL_FERT_TEST_RESULTS.K_REC_SANDY, FARM_SOIL_FERT_TEST_RESULTS.ZN_BROAD, FARM_SOIL_FERT_TEST_RESULTS.ZN_BAND, FARM_SOIL_FERT_TEST_RESULTS.PH_1, FARM_SOIL_FERT_TEST_RESULTS.PH_2, FARM_SOIL_FERT_TEST_RESULTS.PH_3, FARM_SOIL_FERT_TEST_RESULTS.COMMENTS, FARM_SOIL_FERT_TEST_RESULTS.COMMENTS2 FROM FARM_SOIL_FERT_TEST_RESULTS where FARM_SOIL_FERT_TEST_RESULTS .LAB_ID >= :STARTID and FARM_SOIL_FERT_TEST_RESULTS .LAB_ID <= :ENDID; This code has 2 parameter STARTID and ENDID. It takes this as input and fetch all the rows in database regarding these 2 values. These values are to be in consecutive numbers. 21. Q_2- USED BY THE COMMENTS BLOCK. SELECT distinct (comments) FROM FARM_SOIL_FERT_TEST_RESULTS where FARM_SOIL_FERT_TEST_RESULTS .LAB_ID >= :STARTID and FARM_SOIL_FERT_TEST_RESULTS .LAB_ID <= :ENDID; This code has 2 parameter STARTID and ENDID. It takes this as input and fetch all the rows in database regarding these 2 values. These values are to be in consecutive numbers. It only fetches the distinct values. 22. CF_1- displays FIRST NAME function CF_1Formula return Char is fname varchar2(25); id number; begin selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid; select FIRST_NAME into fname from client_details where client_id = ID; return (fname); exception when others then return 0; end; 23. CF_2 – displays LAST NAME function CF_2Formula return Char is id number; lname varchar2(25); begin selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid;
  • 68. selectlasT_NAME into lname from client_details where client_id = ID; return (lname); exception when others then return 0; end; 24. CF_3 – displays ADDRESS function CF_3Formula return Char is addr varchar2(70); id number; begin selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid; select address into addr from client_details where client_id = ID; return (addr); exception when others then return 0; end; 25. CF_4 – displays CITY function CF_4Formula return Char is vcity varchar2 (15); id number; begin selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid; select city into vcity from client_details where client_id = ID; return (vcity); exception when others then return 0; end; 26. CF_5 – displays STATE function CF_5Formula return Char is id number; vstate varchar2 (15); begin selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid; select state into vstate from client_details where client_id = ID;
  • 69. return (vstate); exception when others then return 0; end; 27. CF_6 –displays COUNTY function CF_6Formula return Char is id number; vcounty varchar2 (15); begin selectclient_id into id from HR.FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid; select county into vcounty from client_details where client_id = ID; return (vcounty); exception when others then return 0; end; 28. CF_7 – displays ZIP function CF_7Formula return Number is id number; vzip number (15); begin selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid; select zip into vzip from client_details where client_id = ID; return (vzip); exception when others then return 0; end; 29. CF_8 – displays PHONE NUMBER function CF_8Formula return Number is id number; pno varchar2 (15); begin selectclient_id into id from FARM_SOIL_FERT_TEST_RESULTS where lab_id = :startid;
  • 70. select phone into pno from client_details where client_id = ID; return (pno); exception when others then return 0; end;
  • 71.
  • 72. EDIT VALUES FROM FRONT END 1. This form is the homepage for all the forms having forms for editing the values like crop codes, test codes or the calculation value tables. 2. For any new crops or test value to be added or edited we can go to the respective pages and change the value. 3. We don’t have to change the calculation code for any recommendation explicitly, we can change the calculation table value such as P range or K range etc and the calculations are changes in calculations are done. 4. Only the pH recommendation is hard coded else all the recommendation value are fetched and matched from the RANGE and RECOMMENDATION table to generate the results. 5. HOME button takes to the tool homepage. 6. 7. FORM NAME- EDIT_PAGE_LINKS.fmx 8. There are 8 links to go to from this page. Each link is connected to the table where the editing is to be done. This 8 links are- 9. CROP DETAILS EDIT 10. TEST DETAILS EDIT 11. SUGGESTION EDIT
  • 73. 12. RECOMMENDATION VALUE EDIT 13. ZINC RANGE EDIT 14. P RANGE EDIT 15. K RANGE EDIT 16. CLIENT DETAILS EDIT 17. All these links are explained below. 18. HOME page takes to the home page of the LIMS FARMER side. i. CROP DETAILS EDIT PAGE 19. Name - FARM_CROP_CODE_EDIT.fmx 20. This form helps in editing the values of the table from frontend. This page is made using the FARM_CROP_DETAILS table. 21. This form have a new MENU bar with new functionalities. 22. We can search for a term, see the whole table, edit values, save the changes, add new rows, delete rows etc. 23. ENTER QUERY- search the table for particular value. 24. EXECUTE QUERY – shows the full table value or search result based on enter query. 25. The list of shortcuts are shown in next slide. 26. We can browse through the records using NEXT Key or go into enter QUERY MODE and give the concerned value and press EXECUTE QUERY to directly go to that value and edit it.
  • 74. 27. After this press SAVE to save all the changes made. 28. The EDIT HOME page takes to the home page of EDIT LINKS. 29. This is the list of all the shortcut from the menu to use this page. 30.
  • 75. a. TEST SERIES EDIT 1. Name - FARM_TEST_SERIES_CODE_EDIT.fmx 2. This page is made using the FARM_SOIL_TEST_SERIES_CODE table. 3. All the functionalities are same as the previous form. 4. Suggestions edit 5. This page is made using the FARM_COMMENTS table. 6. Name - FARM_SUGG_EDIT.fmx
  • 76. a. RECOMMENDATION VALUES EDIT 7. Name - FARM_RECO_EDIT.fmx 8. This form is made with FARM_RECOMMENDATION_BRAY_M3 table. 9.
  • 77. i. ZINC RANGE EDIT 10. Name - FARM_ZN_RANGE_EDIT.fmx 11. This is made with the help of FARM_ZN_RANGE. a. PHOSPHORUS RANGE EDIT FORM 12. This form is made from the FARM_P_RANGE table. 13. Name - FARM_P_EDIT.fmx
  • 78. 14. a. POTASSIUM RANGE EDIT FORM 15. Name - FARM_K_EDIT.fmx 16. This form is made from FARM_K_RANGE table 17.
  • 79. 18.CLIENT DETAILS EDIT FORM (CAN BE USED TO SEARCH FOR CLIENT DETAILS ALSO) Name - FARM_CLIENT_DETAILS_EDIT.fmx 19. This form is made from the CLIENT_DETAILS table. 20. QUERY PAGES 1. These forms are used to search for the soil sample information and the test results entered for each client between particular dates. 2. This forms will help to see all the values entered for soil sample but not having results entered. 3. It also helps in answering the queries of clients if they call to check the results. 4. We have to enter the Client details and date for which we want to see the values for. 5. The client details can be entered as LAST NAME or FIRST NAME or CLIENT ID. 6. All these fields have LOVs attached to help search the user easily. 7. The START DATE and END DATE are mandatory and have to be entered manually. 8. This form can show only 25 results at a time so the date has to be entered to fit the values accordingly.(if the values returned are more than 25 then go to MENU>REPORTS>respective report) 9. This is only query page and values should not be altered here. 10. SEARCH button executes the search based on the entered values. 11. NEW SEARCH button clears the form to enter new search. 12. There are 2 query page
  • 80. 13. SOIL SAMPLE QUERY page 14. SOIL TEST RESULTS QUERY page SOIL SAMPLE QUERY PAGE 1. Name - SOIL_INFO_QUERY.fmx 1. This form consists of 3 parts. 2. The MENU , LOGO and DATE are same as previous forms. 3. SEARCH FIELDS canvas. 4. These are the search fields where FIRST NAME, LAST NAME and CLIENT ID have a LOV (LOV30) attached with from where we can select the concerned client. We can choose any one from these 3 field to get the value. 5. START DATE and END DATE are the next fields which are mandatory to fill. This gives a time frame to search for the values of the SOIL INFO. 6. SEARCH button search the details. DECLARE ID NUMBER; STDATE DATE;
  • 81. ENDDATE DATE; CNT NUMBER; BEGIN ID:= :BLOCK11.CLIENT_ID; STDATE:=:BLOCK11.START_DATE; ENDDATE:=:BLOCK11.END_DATE; SELECT COUNT(LAB_ID) INTO CNT FROM FARM_SOIL_FERT_SAMPLE_INFO WHERE CLIENT_ID = ID AND DOS >= STDATE AND DOS<= ENDDATE; -- MESSAGE ('THERE ARE '||CNT||' ENTRIES DURING THE GIVEN PERIOD.'); if :BLOCK11.CLIENT_ID IS NULL OR :BLOCK11.LAST_NAME IS NULL OR :BLOCK11.FIRST_NAME IS NULL THEN MESSAGE ('PLEASE ENTER CLIENT INFORMATION. '); ELSE IF :BLOCK11.START_DATE is null OR :BLOCK11.START_DATE is null THEN MESSAGE ('PLEASE ENTER THE TIME PERIOD TO GET RELEVANT INFORMATION. '); ELSE IF CNT =0 THEN MESSAGE ('THERE IS NO ENTRY FOR THE GIVEN INFORMATION. PLEASE CHECK IF SOIL INFO ENTRY IS PRESENT IN THE SYSTEM.'); ELSIF CNT> 25 THEN MESSAGE('TOO MANY ENTRIES RETRIEVED.PLEASE REDUCE THE TIME DURATIONOR PLEASE RUN THE APPROPRIATE REPORT FROM REPORTS TAB.');
  • 82. ELSE SET_BLOCK_PROPERTY('FARM_SOIL_FERT_SAMPLE_INFO',DEFAULT_WHERE, 'DOS BETWEEN NVL('||''''||STDATE||''''||',DOS) AND NVL('||''''||ENDDATE||''''||',DOS)' ||'AND CLIENT_ID='||ID); GO_BLOCK('FARM_SOIL_FERT_SAMPLE_INFO'); EXECUTE_QUERY; END IF; END IF; END IF; END; 7. NEW SEARCH clears the form for new search. GO_BLOCK('BLOCK11'); CLEAR_BLOCK; GO_BLOCK('FARM_SOIL_FERT_SAMPLE_INFO'); CLEAR_BLOCK; 8. If the result set are more than 25 it give a message 'TOO MANY ENTRIES RETRIEVED.PLEASE REDUCE THE TIME DURATIONOR PLEASE RUN THE APPROPRIATE REPORT FROM REPORTS TAB’. SOIL TEST RESULTS QUERY PAGE Name - RESULT_QUERY.fmx 1. This form consists of 3 parts. 2. The MENU , LOGO and DATE are same as previous forms. 3. SEARCH FIELDS canvas. 4. These are the search fields where FIRST NAME, LAST NAME and CLIENT ID have a LOV (LOV30) attached with from where we can select the concerned client. We can choose any one from these 3 field to get the value.
  • 83. 5. START DATE and END DATE are the next fields which are mandatory to fill. This gives a time frame to search for the values of the SOIL INFO. 6. SEARCH button search the details. DECLARE ID NUMBER; STDATE DATE; ENDDATE DATE; CNT NUMBER; BEGIN ID:= :BLOCK10.CLIENT_ID; STDATE:=:BLOCK10.START_DATE; ENDDATE:=:BLOCK10.END_DATE; SELECT COUNT(LAB_ID) INTO CNT FROM FARM_SOIL_FERT_TEST_RESULTS WHERE CLIENT_ID = ID AND DOR >= STDATE AND DOR<= ENDDATE; -- MESSAGE ('THERE ARE '||CNT||' ENTRIES DURING THE GIVEN PERIOD.'); if :BLOCK10.CLIENT_ID IS NULL OR :BLOCK10.LAST_NAME IS NULL OR :BLOCK10.FIRST_NAME IS NULL THEN MESSAGE ('PLEASE ENTER CLIENT INFORMATION. '); ELSE IF :BLOCK10.START_DATE is null OR :BLOCK10.START_DATE is null THEN MESSAGE ('PLEASE ENTER THE TIME PERIOD TO GET RELEVANT INFORMATION. '); ELSE IF CNT =0 THEN MESSAGE ('THERE IS NO ENTRY FOR THE GIVEN INFORMATION. PLEASE CHECK IF SOIL INFO ENTRY IS PRESENT IN THE SYSTEM.');
  • 84. ELSIF CNT> 25 THEN MESSAGE('TOO MANY ENTRIES RETRIEVED.PLEASE REDUCE THE TIME DURATIONOR PLEASE RUN THE APPROPRIATE REPORT FROM REPORTS TAB.'); ELSE SET_BLOCK_PROPERTY('FARM_SOIL_FERT_TEST_RESULTS',DEFAULT_WHERE, 'DOR BETWEEN NVL('||''''||STDATE||''''||',DOR) AND NVL('||''''||ENDDATE||''''||',DOR)' ||'AND CLIENT_ID='||ID); GO_BLOCK('FARM_SOIL_FERT_TEST_RESULTS'); EXECUTE_QUERY; END IF; END IF; END IF; END; 7. NEW SEARCH clears the form for new search. GO_BLOCK('BLOCK10'); CLEAR_BLOCK; GO_BLOCK('FARM_SOIL_FERT_TEST_RESULTS'); CLEAR_BLOCK; 8. If the result set are more than 25 it give a message 'TOO MANY ENTRIES RETRIEVED.PLEASE REDUCE THE TIME DURATIONOR PLEASE RUN THE APPROPRIATE REPORT FROM REPORTS TAB’.
  • 85. OTHER REPORTS There are 3 type of other reports:- 1. RESULT SEARCH REPORT – To view all the results search if the set is bigger than 25 client wise. 2. SOIL INFO FULL REPORT – To view all the soil information if set is bigger than 25 client wise. 3. RESULT PENDING REPORT – To view all the pending result report for which we have soil information but results are pending. This form calls 2 type of reports one for all client in 1 report another one for client wise report based on a given time frame. These reports form are accessible from MENU >REPORTS>FARM PRODUCT REPORT RESULT SEARCH REPORT 1. Name - RESULT_SEARCH_REPORT.fmx 2. 3. This form has 3 mandatory search fields CLIENT_ID, START DATE, END DATE. 4. CLIENT ID has a LOV attached to it to select a client for whom we are pulling out the data.
  • 86. 5. START DATE and END DATE are to specify the dates for which we are looking for the data. 6. SHOW REPORT button call the report by passing the 3 parameter to the report report_query_full_details.RDF. DECLARE repid REPORT_OBJECT; v_repVARCHAR2(200); rep_statusVARCHAR2(20); plidParamList; Str_Report_Server_JobVARCHAR2(300); Str_Job_IDVARCHAR2(300); Str_URLVARCHAR2(300); BEGIN plid := Get_parameter_List('tmp'); IF NOT Id_Null(plid) THEN Destroy_parameter_List(plid ); END IF; plid := Create_parameter_List('tmp'); --ADD_PARAMETER(plid,'ID',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM4); --ADD_PARAMETER(plid,'STARTDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM5); --ADD_PARAMETER(plid,'ENDDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM6);
  • 87. Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO'); repid := FIND_REPORT_OBJECT('REP'); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF'); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no'); SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME, 'C:projreport_query_full_details.RDF'); SET_REPORT_OBJECT_PROPERTY(repid, REPORT_EXECUTION_MODE, BATCH); SET_REPORT_OBJECT_PROPERTY(repid, REPORT_SERVER, 'rep_soiltestserv'); --v_rep := RUN_REPORT_OBJECT(repid,plid); --set_report_object_property(repid,report_other,'ID'||:BLOCK2.TEXT_ITEM4||' paramform=no') ; --set_report_object_property(repid,report_other,'STARTDATE'||:BLOCK2.TEXT_ITEM5||' paramform=no') ; --set_report_object_property(repid,report_other,'ENDDATE'||:BLOCK2.TEXT_ITEM6||' paramform=no') ; SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no ID='||:BLOCK2.TEXT_ITEM4||' STARTDATE='||:BLOCK2.TEXT_ITEM5||' ENDDATE='||:BLOCK2.TEXT_ITEM6); -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no STARTDATE='||:BLOCK2.TEXT_ITEM5); -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no ENDDATE='||:BLOCK2.TEXT_ITEM6); Str_Report_Server_Job := RUN_REPORT_OBJECT(repid);
  • 88. -- message(Str_Report_Server_Job); rep_status := REPORT_OBJECT_STATUS(Str_Report_Server_Job); message(rep_status); WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP rep_status := report_object_status(Str_Report_Server_Job); END LOOP; IF rep_status = 'FINISHED' THEN --message(Str_Report_Server_Job); Str_Job_ID := SUBSTR(Str_Report_Server_Job, LENGTH('rep_soiltestserv') + 2, LENGTH(Str_Report_Server_Job)); Str_URL := '/reports/rwservlet/getjobid' || Str_Job_ID || '?server=rep_soiltestserv'; WEB.SHOW_DOCUMENT(Str_URL, '_blank'); DESTROY_PARAMETER_LIST(PLID); end if; END; 7. NEW REPORT clears the form and prepares the form for a new report. 8. CLEAR_BLOCK;
  • 89.
  • 90. REPORT_QUERY_FULL_DETAILS.RDF 1. All the reports are made with the help of REPORT BUILDER. To edit the reports open REPORT BUIDER icon on desktop. This is a manual report. 2. Open the concerned report and go to REPORT WIZARD and do the required changes. 3. Any changes in the report can be done in DATA MODEL editor or the PAPER LAYOUT tab. 4. DATA MODEL shows the columns and fields being used in the report. This report consists of 3 parts: 1. IOWA STATE information. This is a simple text area. 2. CLIENT INFORMATION and COUNT OF RESULT. CLIENT INFORMATION depends on CF_2 and CF_3. COUNT comes from CF_4. These are not recursive fields. 3. SOIL INFO FULL. This is recursive field which shows all the soil information that we have which follows the parameters. This depends on the Q_1. 4. CF_2, CF_3, CF_4 are formula column. 5. CF_2 This shows the FIRST NAME. function CF_2Formula return varchar2 is fname varchar2(25); begin select FIRST_NAME into fname from client_details where client_id = :ID; return (fname); exception when others then return 0; end; 6. CF_3 This shows the LAST NAME. function CF_3Formula return varchar2 is lname varchar2(25); begin selectlasT_NAME into lname from client_details where client_id = :ID; return (lname); exception when others then return 0; end;
  • 91. 7. CF_4 This shows the count of the result set we get. function CF_4Formula return Number is ct number(10); begin select count(lab_id) into ct from FARM_SOIL_FERT_TEST_RESULTS where client_id = :ID and FARM_SOIL_FERT_TEST_RESULTS .dor>= :STARTDATE and FARM_SOIL_FERT_TEST_RESULTS .dor<= :ENDDATE; return (ct); exception when others then return 0; end; 8. Q_1is used by FULL TEST RESULTS AND INTERPRETATION FOR CLIENTrepeating frame. This query fetches all the records which qualify all the condition. SELECT ALL FARM_SOIL_FERT_TEST_RESULTS.CLIENT_SAMPLE_ID, FARM_SOIL_FERT_TEST_RESULTS.TOOL_SAMPLE_ID, FARM_SOIL_FERT_TEST_RESULTS.LAB_ID, FARM_SOIL_FERT_TEST_RESULTS.DOR, FARM_SOIL_FERT_TEST_RESULTS.CLIENT_ID, FARM_SOIL_FERT_TEST_RESULTS.FIRST_NAME, FARM_SOIL_FERT_TEST_RESULTS.LAST_NAME, FARM_SOIL_FERT_TEST_RESULTS.TEST_METHOD, FARM_SOIL_FERT_TEST_RESULTS.TILLAGE_DEPTH, FARM_SOIL_FERT_TEST_RESULTS.CROP_CODE, FARM_SOIL_FERT_TEST_RESULTS.OM, FARM_SOIL_FERT_TEST_RESULTS.P, FARM_SOIL_FERT_TEST_RESULTS.K, FARM_SOIL_FERT_TEST_RESULTS.ZN, FARM_SOIL_FERT_TEST_RESULTS.PH, FARM_SOIL_FERT_TEST_RESULTS.BPH, FARM_SOIL_FERT_TEST_RESULTS.P_REC, FARM_SOIL_FERT_TEST_RESULTS.K_REC_FINE, FARM_SOIL_FERT_TEST_RESULTS.K_REC_SANDY, FARM_SOIL_FERT_TEST_RESULTS.ZN_BROAD, FARM_SOIL_FERT_TEST_RESULTS.ZN_BAND, FARM_SOIL_FERT_TEST_RESULTS.PH_1, FARM_SOIL_FERT_TEST_RESULTS.PH_2, FARM_SOIL_FERT_TEST_RESULTS.PH_3 FROM FARM_SOIL_FERT_TEST_RESULTS where FARM_SOIL_FERT_TEST_RESULTS.CLIENT_ID= :ID and FARM_SOIL_FERT_TEST_RESULTS .dor>= :STARTDATE and FARM_SOIL_FERT_TEST_RESULTS .dor<= :ENDDATE;
  • 92.
  • 93.
  • 94. SOIL INFO FULL REPORT Name - FARM_SOIL_INFO_FULL_REPORT.fmx This form has 3 mandatory search fields CLIENT_ID, START DATE, END DATE. 1. CLIENT ID has a LOV attached to it to select a client for whom we are pulling out the data. 2. START DATE and END DATE are to specify the dates for which we are looking for the data. 3. SHOW REPORT button call the report by passing the 3 parameter to the report FARM_SOIL_INFO_FULL_REPORT.RDF. DECLARE repid REPORT_OBJECT; v_repVARCHAR2(200); rep_statusVARCHAR2(20); plidParamList; Str_Report_Server_JobVARCHAR2(300); Str_Job_IDVARCHAR2(300); Str_URLVARCHAR2(300);
  • 95. BEGIN plid := Get_parameter_List('tmp'); IF NOT Id_Null(plid) THEN Destroy_parameter_List(plid ); END IF; plid := Create_parameter_List('tmp'); --ADD_PARAMETER(plid,'ID',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM4); --ADD_PARAMETER(plid,'STARTDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM5); --ADD_PARAMETER(plid,'ENDDATE',TEXT_PARAMETER,:BLOCK2.TEXT_ITEM6); Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO'); repid := FIND_REPORT_OBJECT('REP'); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF'); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no'); SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME, 'C:projFARM_SOIL_INFO_FULL_REPORT.RDF'); SET_REPORT_OBJECT_PROPERTY(repid, REPORT_EXECUTION_MODE, BATCH); SET_REPORT_OBJECT_PROPERTY(repid, REPORT_SERVER, 'rep_soiltestserv'); --v_rep := RUN_REPORT_OBJECT(repid,plid); --set_report_object_property(repid,report_other,'ID'||:BLOCK2.TEXT_ITEM4||' paramform=no') ; --set_report_object_property(repid,report_other,'STARTDATE'||:BLOCK2.TEXT_ITEM5||' paramform=no') ; --set_report_object_property(repid,report_other,'ENDDATE'||:BLOCK2.TEXT_ITEM6||' paramform=no') ; SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no ID='||:BLOCK2.TEXT_ITEM4||' STARTDATE='||:BLOCK2.TEXT_ITEM5||' ENDDATE='||:BLOCK2.TEXT_ITEM6); -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no STARTDATE='||:BLOCK2.TEXT_ITEM5); -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no ENDDATE='||:BLOCK2.TEXT_ITEM6); Str_Report_Server_Job := RUN_REPORT_OBJECT(repid); -- message(Str_Report_Server_Job); rep_status := REPORT_OBJECT_STATUS(Str_Report_Server_Job);
  • 96. message(rep_status); WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP rep_status := report_object_status(Str_Report_Server_Job); END LOOP; IF rep_status = 'FINISHED' THEN --message(Str_Report_Server_Job); Str_Job_ID := SUBSTR(Str_Report_Server_Job, LENGTH('rep_soiltestserv') + 2, LENGTH(Str_Report_Server_Job)); Str_URL := '/reports/rwservlet/getjobid' || Str_Job_ID || '?server=rep_soiltestserv'; WEB.SHOW_DOCUMENT(Str_URL, '_blank'); DESTROY_PARAMETER_LIST(PLID); end if; END; 4. NEW REPORT clears the form and prepares the form for a new report. CLEAR_BLOCK;
  • 97.
  • 98. FARM_SOIL_INFO_FULL_REPORT.RDF 1. All the reports are made with the help of REPORT BUILDER. To edit the reports open REPORT BUIDER icon on desktop. This is a manual report. 2. Open the concerned report and go to REPORT WIZARD and do the required changes. 3. Any changes in the report can be done in DATA MODEL editor or the PAPER LAYOUT tab. 4. DATA MODEL shows the columns and fields being used in the report. This report consists of 3 parts: 9. IOWA STATE information. This is a simple text area. 10. CLIENT INFORMATION and COUNT OF RESULT. CLIENT INFORMATION depends on CF_2 and CF_3. COUNT comes from CF_4. These are not recursive fields. 11. SOIL INFO FULL. This is recursive field which shows all the soil information that we have which follows the parameters. This depends on the Q_1. 12. CF_2, CF_3, CF_4 are formula column. 13. CF_2 This shows the FIRST NAME. function CF_2Formula return varchar2 is fname varchar2(25); begin select FIRST_NAME into fname from client_details where client_id = :ID; return (fname); exception when others then return 0; end; 14. CF_3 This shows the LAST NAME. function CF_3Formula return varchar2 is lname varchar2(25); begin selectlasT_NAME into lname from client_details where client_id = :ID; return (lname); exception when others then return 0;
  • 99. end; 15. CF_4 This shows the count of the result set we get. function CF_4Formula return Number is ct number(10); begin select count(lab_id) into ct from FARM_SOIL_FERT_SAMPLE_INFO where client_id = :ID and FARM_SOIL_FERT_SAMPLE_INFO .dos >= :STARTDATE and FARM_SOIL_FERT_SAMPLE_INFO .dos <= :ENDDATE; return (ct); exception when others then return 0; end; 16. Q_1is used by FULL SOIL INFORMATION OF CLIENT repeating frame. This query fetches all the records which qualify all the condition. SELECT ALL FARM_SOIL_FERT_SAMPLE_INFO.CLIENT_ID, FARM_SOIL_FERT_SAMPLE_INFO.CLIENT_SAMPLE_ID, FARM_SOIL_FERT_SAMPLE_INFO.TOOL_SAMPLE_ID, FARM_SOIL_FERT_SAMPLE_INFO.LAB_ID, FARM_SOIL_FERT_SAMPLE_INFO.DOS, FARM_SOIL_FERT_SAMPLE_INFO.TILLAGE_DEPTH, FARM_SOIL_FERT_SAMPLE_INFO.LIME, FARM_SOIL_FERT_SAMPLE_INFO.CROP_CODE, FARM_SOIL_FERT_SAMPLE_INFO.TEST_SERIES_CODE, FARM_SOIL_FERT_SAMPLE_INFO.COMMENTS FROM FARM_SOIL_FERT_SAMPLE_INFO where FARM_SOIL_FERT_SAMPLE_INFO.CLIENT_ID= :ID and FARM_SOIL_FERT_SAMPLE_INFO .dos >= :STARTDATE and FARM_SOIL_FERT_SAMPLE_INFO .dos <= :ENDDATE;
  • 100.
  • 101.
  • 102. PENDING REPORTS FORM This is a form where we can check the reports for all the LAB ID for which we have a SOIL INFORMATION but the RESULTS are still pending. NAME- FERT_PENDING_RESULT_REPORT.fmx This form consists of 2 frames- 1. ALL PENDING REPORT- Calls the report for all the CLIENTS for which we have pending results. i,e all the SOIL INFORMATION for which we don’t have the results ready yet. 2. CLIENT WISE PENDING RESULT REPORT- calls the report for all the LAB ID for which results are pending CLIENTWISE. Both the frames have 2 parameters in common START DATE and END DATE but the second frame has an extra one to search client wise. The client ID text field has a LOV attached to it for selecting the CLIENT ID. REPORT button calls the report and NEW REPORT clears the form.
  • 103.
  • 104. Report Name - pending_result_report.RDF
  • 105. REPORT name - client_wise_pending_result_report.RDF
  • 106. REPORT BUTTON CODE for ALL PENDING REPORT DECLARE repid REPORT_OBJECT; v_repVARCHAR2(200); rep_statusVARCHAR2(20); plidParamList; Str_Report_Server_JobVARCHAR2(300); Str_Job_IDVARCHAR2(300); Str_URLVARCHAR2(300); BEGIN plid := Get_parameter_List('tmp'); IF NOT Id_Null(plid) THEN Destroy_parameter_List(plid ); END IF; plid := Create_parameter_List('tmp'); Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO'); repid := FIND_REPORT_OBJECT('REP'); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF'); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
  • 107. SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME, 'C:projpending_result_report.RDF'); SET_REPORT_OBJECT_PROPERTY(repid, REPORT_EXECUTION_MODE, BATCH); SET_REPORT_OBJECT_PROPERTY(repid, REPORT_SERVER, 'rep_soiltestserv'); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no STDATE='||:BLOCK5.TEXT_ITEM6||' ENDDT='||:BLOCK5.TEXT_ITEM7); -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no STARTDATE='||:BLOCK2.TEXT_ITEM5); -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no ENDDATE='||:BLOCK2.TEXT_ITEM6); Str_Report_Server_Job := RUN_REPORT_OBJECT(repid); -- message(Str_Report_Server_Job); rep_status := REPORT_OBJECT_STATUS(Str_Report_Server_Job); message(rep_status); WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP rep_status := report_object_status(Str_Report_Server_Job); END LOOP; IF rep_status = 'FINISHED' THEN --mEssage(Str_Report_Server_Job); Str_Job_ID := SUBSTR(Str_Report_Server_Job, LENGTH('rep_soiltestserv') + 2, LENGTH(Str_Report_Server_Job)); Str_URL := '/reports/rwservlet/getjobid' || Str_Job_ID || '?server=rep_soiltestserv'; WEB.SHOW_DOCUMENT(Str_URL, '_blank'); DESTROY_PARAMETER_LIST(PLID);
  • 108. end if; END; REPORT BUTTON code on CLIENT WISE REPORT frame. DECLARE repid REPORT_OBJECT; v_repVARCHAR2(200); rep_statusVARCHAR2(20); plidParamList; Str_Report_Server_JobVARCHAR2(300); Str_Job_IDVARCHAR2(300); Str_URLVARCHAR2(300); BEGIN plid := Get_parameter_List('tmp'); IF NOT Id_Null(plid) THEN Destroy_parameter_List(plid ); END IF; plid := Create_parameter_List('tmp'); Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO'); repid := FIND_REPORT_OBJECT('REP2'); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
  • 109. SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF'); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no'); SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME, 'C:projclient_wise_pending_result_report.RDF'); SET_REPORT_OBJECT_PROPERTY(repid, REPORT_EXECUTION_MODE, BATCH); SET_REPORT_OBJECT_PROPERTY(repid, REPORT_SERVER, 'rep_soiltestserv'); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no ID='||:BLOCK12.TEXT_ITEM14||' STRTDATE='||:BLOCK12.TEXT_ITEM15||' ENDDTE='||:BLOCK12.TEXT_ITEM16); -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no STARTDATE='||:BLOCK2.TEXT_ITEM5); -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no ENDDATE='||:BLOCK2.TEXT_ITEM6); Str_Report_Server_Job := RUN_REPORT_OBJECT(repid); -- message(Str_Report_Server_Job); rep_status := REPORT_OBJECT_STATUS(Str_Report_Server_Job); message(rep_status); WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP rep_status := report_object_status(Str_Report_Server_Job); END LOOP; IF rep_status = 'FINISHED' THEN --message(Str_Report_Server_Job);