SlideShare a Scribd company logo
1 of 175
Download to read offline
DOCUMENTATION OF LIMS FOR
HORTICULTURE PRODUCTS.
PREPARED BY – RAHUL SINGH
2015
HORT PRODUCTS
TABLE DESCRIPTION AND DEFINITION
Horticulture product used the same CLIENT_DETAILS tables for storing the data of the clients.
Horticulture products has a number of table to store soil sample info, fertility test results, CEC test results, the
recommendation value storage table , crop code table, test code table, tables which stores suggestions and table that
store comments.
Below are the table definitions and creation code to better understand the structures.
 HORT_COMMENTS
------------------------------------
This table contains the comments which are used inreports to give suggestions or recommendations.
CREATE TABLE "HR"."HORT_COMMENTS"
( "NAME" VARCHAR2(100 BYTE),
"COMMENTS" VARCHAR2(2000 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" ;
DATA.
NAME COMMENTS
MULTIPLE CROPS Please note: recommendations are based on the assumption that the sample was obtained
from the appropriate depth range. For new and existing lawns, samples should be taken to a depth of 3 inches below
the sod, without including the sod plug. For flowers, vegetables, and small fruits, samples should be taken from the
"plow layer" (0" to 6"). For trees and shrubs, the samples should be taken to a depth of 12". Multiple recommendations
from a single sample may not be accurate, as the sample depth for one or more of the requested crops is inaccurate.
ATHLETIC TURF NOTE: we are unable to provide more specific recommendations for athletic turf without more detailed
information from the client (soil type, sample depth). It is also helpful to know the intended usage.
NON-FERTILITY SOIL ANALYSIS (CHEMICAL CARRYOVER, ETC.) NOTE: chemical contamination analyses are not offered
at the ISU soil testing lab. You will need to submit a sample to a Commercial laboratory for any additional testing. A list
of labs certified by the state can be found at the following website:
http://www.agriculture.state.ia.us/feedandfertilizer.asp
OUT OF STATE Please note: the recommendations shown here are based on Iowa climate and soils.We provide these
recommendations as a guideline; however, we strongly recommend that you contact your extension service or a local
horticultural expert for an interpretation more suited to your region. In the meantime, the chart below may serve as a
guide for interpreting your results.
NO CROP INFO Please note: There was no crop code indicated on the information sheet submitted with your samples,
making it necessary for us to use a default crop code for garden.
Mg As noted on the information sheet, Magnesium analysis on soil samples is reserved for samples where the
requested recommendation is for vineyards (crop code #7). Part #11 of the instructions for taking horticulture samples
states we will not make any interpretations of Mg results for any other crop. However, we have included the result(s) of
the Mg analysis above.
Commercial Garden NOTE: we are unable to provide more specific recommendations for commercial gardens
without more detailed information from the client (soil type, sample depth). It is also helpful to know the intended
crop(s).NOTE: the methods for analyzing garden soil used at ISU Soil & Plant Analysis Lab are designed to extract to
extract different elements from naturally formed soils. They do not work well on potting mixes or soils that have been
heavily amended with mulch, pearlite, vermiculite, peat, and other materials.
EXCESS The soil test levels of your sample(s) are extremely high (see below), and continued fertilizer additions may be
detrimental to plant growth. Research has shown that excessive nutrient Levels may cause a deficiency and/or toxicity
of other essential nutrients. Apply no fertilizer, except nitrogen, to the garden area this year. Retest the soil in 3 to 4
years to check nutrient levels. Enclosed is a copy of Pm 820 for suggested nitrogen levels for your crops (see page six of
Pm 820).
EXISTING LAWNApply lawn fertilizer only when the grass blades are dry, and water thoroughly immediately after
application. Do not exceed a nitrogen rate of 1 lb N/1000 sq. Ft. in any single application.For example, where 20 lbs of
20-15-5 is suggested the total N applied would be 4 lbs.This amount should be divided into four equal treatments over
the growing season.Use a calibrated fertilizer spreader for best results.
NEW LAWN Before seeding the new lawn, broadcast the fertilizer (and lime, if required) and incorporate it to a
depth of 4 to 6 Inches. Additional fertilizer at a rate of 1 pound of nitrogen per 1,000 square feet should be applied to
the lawn 3 to 4 weeks after germination, when the grass is 1 to 1½ inches tall.If grass is already growing, apply lawn
fertilizer only when the grass blades are dry,and water thoroughly immediately after application. Do not exceed a
nitrogen rate of 1 lb N/1000 sq. Ft. in any single application. For example, where 20 lbs of 20-15-5 is suggested the total
N applied would be 4 lbs. This amount should be divided into four equal treatments over the growing season. Use a
calibrated fertilizer spreader for best results.
NUTRITION "Using the suggested complete garden fertilizer each year may result in excess phosphate and/or potash
soil levels over time. Therefore, it is better to use the single nutrient sources, such as superphosphate (0-46-0 or 0-20-0)
and muriate of potash (0-0-60) or sulfate of potash (0-0-50).These are available at most home lawn & garden
centers.One-half of the fertilizer (and lime, if required) can be applied in the fall of the year and plowed or disked under,
and the other half can be applied in early spring before planting starts. Or, if you prefer,the entire application can be
made in the early spring as you are preparing the area for planting. Work the fertilizer well into the top 4 or 5 inches of
soil by disking, raking, or rototilling.Add 2 to 3 pounds of actual nitrogen per 1,000 square feet when using the single
phosphate and potash sources. Also, if the plants are showing poor growth or light green foliage add extra nitrogen by
sidedressing along the row. Use one of the nitrogen sources listed below.
Nitrogen Sources Lbs/100 feet of row
Ammonium nitrate (34-0-0) 1/3 to 3/4
Ammonium sulfate (21-0-0) 3/4 to 1-1/4
Urea (46-0-0) 1/4 to ½
Apply the lower amount to closely spaced rows, such as carrots, lettuce, etc.For a convenient measuring unit, 1 pint
weighs approximately 1 pound."
ALL For fruit trees, small fruits, broadleaf and evergreen trees and shrubs, apply fertilizer evenly on the ground
before spring growth starts. For trees, apply the fertilizer uniformly under the canopy. Small fruit crops include
strawberries, raspberries, and grapes. For June-bearing strawberries, sidedress the recommended fertilizer at
renovation, immediately after harvest.For everbearing strawberries, raspberries and grapes, apply the recommended
amount in early spring, before growth starts.For new fruit plantings, incorporate the fertilizer 4 to 6 inches into the soil
prior to planting.The total nitrogen recommendation for these crops is 2 lbs/1,000 square Feet. Thus, if needed,
supplement the suggested fertilizer with additional nitrogen using either ammonium nitrate, ammonium sulfate, or
urea.
LIME The lime application, if required, can be made anytime the land is not growing a crop, but it is important that it
be worked into the soil by plowing, disking, etc. One-half the rate can be applied in the fall,and plowed or disked under,
and the other half in the early spring as you prepare the land for planting.
LIMEX A pH of 8.0 is extremely high indicating free calcium carbonate in the soil profile or excessive use of wood ashes.
Micronutrient deficiencies, particularly zinc, iron, and manganese, may be a problem.Consider using 100 pounds of
elemental sulfur per 1,000 square feet of sample area. Work the sulfur thoroughly into the top six inches of soil. For
existing fruit, shade tree and shrub plantings,consider using a foliar micronutrient spray available at most garden
centers.
LIMING TURF Lime can be applied any time during the year with preference in the fall or spring. Lime also neutralizes
soil acidity faster when applied in combination with coring, slicing, or dethatching. On established turf do not exceed 50
lbs/1000 sq. ft. in a single application. If needed, make repeat applications 3 to 6 months apart until the total lime
requirement has been applied.
LIME FOR SMALL FRUITS The lime application is intended to raise the soil pH to 7.0, or neutral. Some crops
require a soil pH that is either more basic or more acidic, and the lime recommendation should be adjusted accordingly.
These content of this table are fixed comments but it can be edited accordingly.
 HORT_CROP_DETAILS
This table contains all the crop details.
CREATE TABLE "HR"."HORT_CROP_DETAILS"
( "CROP_CODE" NUMBER(2,0) NOT NULL ENABLE,
"CROP_NAME" VARCHAR2(30 BYTE),
"SAMPLE_DEPTH" NUMBER(3,0),
CONSTRAINT "HORT_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" ;
DATA
Crop_code crop_name sample depth
1 Vegetable and/or flower garden 6
2 Existing lawn (>2 years old) 3
3 New lawn (new seeding or sod) 3
4 Small fruit planting 6
5 Tree fruit planting 12
6 Shade tree and/or shrub plant 12
7 Vineyards 12
8 Commercial gardens 6
9 Athletic turf 3
 HORT_SOIL_FERT_SAMPLE_INFO
This table contains all the sample info for fertility test as well as the CEC test.
CREATE TABLE "HR"."HORT_SOIL_FERT_SAMPLE_INFO"
( "CLIENT_ID" NUMBER(6,0),
"CLIENT_SAMPLE_ID" VARCHAR2(20 BYTE),
"LAB_ID" NUMBER(7,0) NOT NULL ENABLE,
"DOS" DATE,
"CROP_CODE" NUMBER(3,0),
"TEST_SERIES_CODE" NUMBER(2,0),
"SOIL_TYPE" VARCHAR2(50 BYTE),
"SAMPLE_DEPTH" NUMBER(3,0),
"COMMENTS" VARCHAR2(1000 BYTE),
CONSTRAINT "HORT_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" ;
 HORT_SOIL_TEST_SERIES_CODE
This table contains all the test codes for the horticulture product.
CREATE TABLE "HR"."HORT_SOIL_TEST_SERIES_CODE"
( "TEST_CODE" NUMBER(2,0) NOT NULL ENABLE,
"TESTS" VARCHAR2(45 BYTE),
"RATES" NUMBER(3,0),
CONSTRAINT "HORT_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" ;
DATA
Test code tests rates
7 CEC
1 Dry soil K and P, pH and lime 9
2 Dry soil K and P, pH, lime and OM 12
3 Dry soil K and P, pH, lime and Zn 13
4 Dry soil K and P, pH, lime, OM and Zn 15
5 pH and lime 8
6 Dry soil K and P, pH, lime, OM, Zn and Mg 16
 HORT_SOIL_FERT_TEST_RESULTS
This table contains all the soil fertility test results that we get from the lab and also contains the recommendation given
to the client based on the values.
CREATE TABLE "HR"."HORT_SOIL_FERT_TEST_RESULTS"
( "CLIENT_SAMPLE_ID" VARCHAR2(20 BYTE),
"LAB_ID" NUMBER(7,0) NOT NULL ENABLE,
"DOR" DATE,
"CLIENT_ID" NUMBER(6,0),
"FIRST_NAME" VARCHAR2(50 BYTE),
"LAST_NAME" VARCHAR2(50 BYTE),
"CROP_CODE" NUMBER(3,0),
"TILLAGE_DEPTH" NUMBER(3,0),
"K" NUMBER(7,2),
"P" NUMBER(7,2),
"PH" NUMBER(7,3),
"OM" NUMBER(6,3),
"ZN" NUMBER(7,2),
"BPH" NUMBER(7,2),
"MG" NUMBER(7,2),
"FE" NUMBER(7,2),
"S" NUMBER(7,2),
"P_REC" NUMBER(7,2),
"K_REC" NUMBER(7,2),
"LIME_REC" NUMBER(7,2),
"ZN_REC" NUMBER(7,2),
"SUGGESTIONS" VARCHAR2(150 BYTE),
"COMMENTS1" VARCHAR2(2000 BYTE),
"COMMENTS2" VARCHAR2(2000 BYTE),
"COMMENTS3" VARCHAR2(2000 BYTE),
"COMMENTS4" VARCHAR2(2000 BYTE),
"COMMENTS5" VARCHAR2(2000 BYTE),
"COMMENTS6" VARCHAR2(2000 BYTE),
"COMMENTS7" VARCHAR2(2000 BYTE),
"COMMENTS8" VARCHAR2(2000 BYTE),
"COMMENTS9" VARCHAR2(2000 BYTE),
"COMMENTS10" VARCHAR2(2000 BYTE),
"TEST_CODE" VARCHAR2(3 BYTE),
"B" NUMBER(7,2),
"EC" NUMBER(7,2),
"CA" NUMBER(7,2)
) 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" ;
 HORT_SOIL_CEC_RESULTS
This table contains all the test result values calculated in the lab and also stores the calculated value of CEC.
CREATE TABLE "HR"."HORT_SOIL_CEC_RESULTS"
( "LAB_ID" NUMBER(7,0),
"CLIENT_ID" NUMBER(7,0),
"CLIENT_SAMPLE_ID" VARCHAR2(20 BYTE),
"FIRST_NAME" VARCHAR2(50 BYTE),
"LAST_NAME" VARCHAR2(50 BYTE),
"DOR" DATE,
"CROP_CODE" VARCHAR2(3 BYTE),
"TEST_CODE" VARCHAR2(3 BYTE),
"K" NUMBER(7,3),
"CA" NUMBER(7,3),
"NA" NUMBER(7,3),
"MG" NUMBER(7,3),
"AL" NUMBER(7,3),
"H" NUMBER(7,3),
"CEC" NUMBER(7,3),
"PH" NUMBER(7,3),
"CEC2" NUMBER(7,3),
"A1" VARCHAR2(2000 BYTE),
"A2" VARCHAR2(2000 BYTE),
"TILLAGE_DEPTH" NUMBER,
"A4" VARCHAR2(2000 BYTE),
"A5" VARCHAR2(2000 BYTE),
"A6" VARCHAR2(2000 BYTE),
"A7" VARCHAR2(2000 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" ;
 HORT_P_K_RANGES
This table contains the data of all the ranges which are used to calculate the recommendations and suggestions based
on the value of Phosphorus and Pottasium.
CREATE TABLE "HR"."HORT_P_K_RANGES"
( "CROP_CODE" NUMBER(2,0) NOT NULL ENABLE,
"P_MIN" NUMBER(3,0),
"P_MAX" NUMBER(5,0),
"PR" NUMBER(6,2),
"K_MIN" NUMBER(3,0),
"K_MAX" NUMBER(5,0),
"KR" NUMBER(6,2)
) 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" ;
DATA
Crop code P_MIN P_MAX PR K_MIN K_MAX KR
1 0 7 7 0 43 8
1 8 14 6 44 84 6
1 15 19 3.5 85 124 3.5
1 20 29 2.5 125 187 2.5
1 30 49 1.5 188 249 1.5
1 50 10000 0 250 10000 0
2 0 5 2 0 40 2
2 6 10 1.5 41 175 1
2 11 20 1 176 10000 0
2 21 10000 0
3 0 5 3 0 40 2
3 6 10 2.5 41 175 1
3 11 20 2 176 10000 1
3 21 10000 0
4 0 7 3 0 43 2
4 8 14 2 44 83 1
4 15 29 1 84 124 0.5
4 30 10000 0 125 10000 0
5 0 7 3 0 43 2
5 8 14 2 44 83 1
5 15 29 1 84 124 0.5
5 30 10000 0 125 10000 0
6 0 7 3 0 43 2
6 8 14 2 44 83 1
6 15 29 1 84 124 0.5
6 30 10000 0 125 10000 0
These content of the table are fixed but the values can be edited as per requirement.
 HORT_LE_REC
This table contains the LE recommendation based on the values we get from the P-K ranges table.
CREATE TABLE "HR"."HORT_LE_REC"
( "PR" NUMBER(6,2),
"KR" NUMBER(6,2),
"LE" 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" ;
DATA
PR KR LE
0 0 6
0 1 5
0 2 4
1 0 9
1 1 3
1 2 1
1.5 0 8
1.5 1 8
1.5 2 2
2 0 7
2 1 7
2 2 1
These content of the table are fixed but the values can be edited as per requirement.
 HORT_LE_SUGGESTION
This table contains the LE suggestions based on the values we get from the LE_REC table.
CREATE TABLE "HR"."HORT_LE_SUGGESTION"
( "LE" NUMBER(3,0),
"SUGGESTION" VARCHAR2(55 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" ;
DATA
LE SUGGESTION
1 SUGGEST 20 LBS OF 12-12-12
2 SUGGEST 15 LBS OF 12-12-12
3 SUGGEST 10 LBS OF 12-12-12
4 SUGGEST 4 LBS OF 0-0-50
5 SUGGEST 2 LBS OF 0-0-50
6 SUGGEST SEE PM 1057 FOR N NEEDS
7 SUGGEST 20 LBS OF 20-10-5
8 SUGGEST 25 LBS OF 10-6-4
9 SUGGEST 12 LBS OF 23-3-7
These content of the table are fixed but the values can be edited as per requirement.
 HORT_SR_REC
This table contains the SR recommendation based on the values we get from the P-K ranges table.
CREATE TABLE "HR"."HORT_SR_REC"
( "PR" NUMBER(6,2),
"KR" NUMBER(6,2),
"SR" 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" ;
DATA
PR KR SR
0 0 6
0 1.5 5
0 2.5 4
0 3.5 3
0 6 2
0 8 1
1.5 0 28
1.5 1.5 27
1.5 2.5 23
1.5 3.5 4
1.5 6 2
1.5 8 1
2.5 0 25
2.5 1.5 24
2.5 2.5 23
2.5 3.5 22
2.5 6 21
2.5 8 20
3.5 0 19
3.5 1.5 18
3.5 2.5 17
3.5 3.5 17
3.5 6 16
3.5 8 15
6 0 14
6 1.5 13
6 2.5 10
6 3.5 9
6 6 12
6 8 8
7 0 11
7 1.5 10
7 2.5 9
7 3.5 9
7 6 8
7 8 7
These content of the table are fixed but the values can be edited as per requirement.
 HORT_SR_SUGGESTION
This table contains the SR suggestions based on the values we get from the SR_REC table.
DATA
SR SUGGESTION
0 0 6
0 1.5 5
0 2.5 4
0 3.5 3
0 6 2
0 8 1
1.5 0 28
1.5 1.5 27
1.5 2.5 23
1.5 3.5 4
1.5 6 2
1.5 8 1
2.5 0 25
2.5 1.5 24
2.5 2.5 23
2.5 3.5 22
2.5 6 21
2.5 8 20
3.5 0 19
3.5 1.5 18
3.5 2.5 17
3.5 3.5 17
3.5 6 16
3.5 8 15
6 0 14
6 1.5 13
6 2.5 10
6 3.5 9
6 6 12
6 8 8
7 0 11
7 1.5 10
7 2.5 9
7 3.5 9
7 6 8
7 8 7
These content of the table are fixed but the values can be edited as per requirement.
 HORT_SRL_REC
This table contains the SRL recommendation based on the values we get from the P-K ranges table.
CREATE TABLE "HR"."HORT_SRL_REC"
( "PR" NUMBER(6,2),
"KR" NUMBER(6,2),
"SRL" 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" ;
DATA
PR KR SRL
0 0 4
0 1 2
0 2 1
2 0 7
2 1 7
2 2 1
2.5 0 6
2.5 1 6
2.5 2 1
3 0 5
3 1 5
3 2 3
These content of the table are fixed but the values can be edited as per requirement.
 HORT_SRL_SUGGESTION
This table contains the SRL suggestions based on the values we get from the SRL_REC table.
DATA
SRL SUGGESTION
1 SUGGEST 20 LBS OF 12-12-12
2 SUGGEST 10 LBS OF 12-12-12
3 SUGGEST 25 LBS OF 12-12-12
4 SUGGEST 12 LBS OF 23-7-7
5 SUGGEST 30 LBS OF 5-10-5
6 SUGGEST 25 LBS OF 5-10-5
7 SUGGEST 20 LBS OF 20-10-5
These content of the table are fixed but the values can be edited as per requirement.
 HORT_TSF_REC
This table contains the TSF recommendation based on the values we get from the P-K ranges table.
CREATE TABLE "HR"."HORT_TSF_REC"
( "PR" NUMBER(6,2),
"KR" NUMBER(6,2),
"TSF" 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" ;
DATA
PR KR TSF
0 0 15
0 0.5 14
0 1 13
0 2 12
1 0 11
1 0.5 3
1 1 10
1 2 9
2 0 8
2 0.5 7
2 1 2
2 2 6
3 0 5
3 0.5 4
3 1 4
3 2 1
These content of the table are fixed but the values can be edited as per requirement.
 HORT_TSF_SUGGESTION
This table contains the TSF suggestions based on the values we get from the TSF_REC table.
CREATE TABLE "HR"."HORT_TSF_SUGGESTION"
( "TSF" NUMBER(3,0),
"SUGGESTION" VARCHAR2(55 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" ;
DATA
TSF SUGGESTION
1 SUGGEST 20 LBS OF 12-12-12
2 SUGGEST 10 LBS OF 12-12-12
3 SUGGEST 5 LBS OF 12-12-12
4 SUGGEST 20 LBS OF 5-10-5
5 SUGGEST 4 LBS OF 18-46-0
6 SUGGEST 15 LBS OF 12-12-12
7 SUGGEST 10 LBS OF 5-10-5
8 SUGGEST 2 LBS OF 18-46-0
9 SUGGEST 10 LBS OF 10-6-4 PLUS 3 LBS OF 0-0-60
10 SUGGEST 10 LBS OF 10-6-4 PLUS 1 LB OF 0-0-61
11 SUGGEST 8 LBS OF 10-6-4
12 SUGGEST 4 LBS OF 0-0-60
13 SUGGEST 2 LBS OF 0-0-60
14 SUGGEST 1 LB OF 0-0-60
15 SUGGEST NO FERTILIZER RECOMMENDED
These content of the table are fixed but the values can be edited as per requirement.
 HORT_ZN_REC
This table contains the ZN recommendation ranges.
CREATE TABLE "HR"."HORT_ZN_REC"
( "ZN_MIN" NUMBER(6,2),
"ZN_MAX" NUMBER(6,2),
"ZN_REC" NUMBER(6,2)
) 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" ;
DATA
ZN_MIN ZN_MAX ZN_REC
0 0.7 0.2
0.8 1000 0
Forms explanation
1. The main menu is the same as explained in the FARM PRODUCT explanations.
2. CLIENT SEARCH PAGE
1. NAME- HORT_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. 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
Link for home page
Client
search
fields
p_id paramlist;
p_name varchar(20) := 'client_id';
begin
--check if parameter already exists
p_id := get_parameter_list(p_name);
if id_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(:block6.text_item11));
new_form ('c:projHORT_SOILINFO_ENTRY.fmx',no_rollback,no_query_only,share_library_data,p_id);
if not form_success then
message('ERROR: Unable to open the form. ');
raise form_trigger_failure;
end if;
exception
when others then
message('ERROR: Unable to create parameter list. ');
raise form_trigger_failure;
end;
1. 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.
2. 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.
3. Link for new user is MENU >HORTICULTURE> SOIL INFO ENTRY (N).
4. We can check for various client at a time and then enter the values of soil information for all the clients
one-by-one.
5. 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);
6. 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.
7. We have to enter any value and press TAB and all fields are automatically filled. If user is not present
tool gives appropriate message.
8. LOV – first name, last name, ID has a LOV attached with it where we can easily search for any user.
9.
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.
6. When these fields are clicked the LOV open automatically and we can choose any user.
LOV
7. When we select any user from LOV or search from other text fields all the other fields are filled
automatically.
8. To make the LOV we go through LOV wizard and then attach it with the required text fields.
9. These LOV are present on CLIENT_ID, CLIENT_FIRST_NAME, and CLIENT_LAST_NAME.
10. Phone_number- this field has a POST_TEXT-ITEM TRIGGER on it to search from the database if we
search with phone number.
BEGIN
select client_id into :text_item11 from client_details where phone = :text_item9;
select first_name into :text_item7 from client_details where phone = :text_item9;
select last_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
when too_many_rows then
message('Multiple value detected. Try different filters.');
when no_data_found then
message('No matching records could be found in the database. try different filters.');
END;
11. This code will fill all the details in all the respective fields if data is present.
12. 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
select client_id into :text_item11 from client_details where email = :text_item10;
select first_name into :text_item7 from client_details where email = :text_item10;
select last_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
when too_many_rows then
message('Multiple value detected. Try different filters.');
when no_data_found then
message('No matching records could be found in the database. try different filters.');
END;
13. When a user is found we have to press ENTER button to enter the next page for soil info entry.
14. New search – this button clears the form and we can do a new search.
go_block('block2');
clear_block;
3. SOILINFO ENTRY PAGE(FOR EXISTING USERS)
NAME – HORT_SOILINFO_ENTRY.FMX
1. This form is to enter the soil information given by the clients.
2. We get to this page from the HORT_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 into client_id text item
:block7.client_id:= :parameter.ID;
id1 :=:parameter.ID;
--showing all the values in the respective text items.
select first_name into :block7.first_name from CLIENT_DETAILS where client_id = id1;
This frame is filled automatically and can be
edited here. It takes the parameter from client
search page and displaysall the informationabout
the client.
Soil sample info frame
Saves anychanges done
Takes back to client search pagefor newentryof
soil info
Saves corresponding
record
select last_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;
select submitter_id into :block7.submitter_id from CLIENT_DETAILS where client_id = id1;
select sub_first_name into :block7.sub_first_name from CLIENT_DETAILS where client_id = id1;
select sub_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 HORT_CLIENT_SEARCH page 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 HORT_CROP_DETAILS where crop_code =:text_item154;
if b=0 then
message('CROP CODE NOT RECOGNIZED');
raise form_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
else
select crop_name into a from HORT_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);
exception
-- when NO_DATA_FOUND then
-- message('CROP CODE NOT RECOGNIZED');
-- set_item_property('block60.TEXT_ITEM154', navigable,property_false);
--when otherS then
--message ('unexpected error');
when no_data_found then message ('CROP CODE NOT RECOGNIZED');
raise form_trigger_failure;
when otherS then
message ('unexpected error');
raise form_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
END;
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 HORT_SOIL_TEST_SERIES_CODE where TEST_code
=:text_item164;
if b=0 then
message('TEST CODE NOT RECOGNIZED');
raise form_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
else
select TESTS into a from HORT_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
-- when NO_DATA_FOUND then
-- message('CROP CODE NOT RECOGNIZED');
-- set_item_property('block60.TEXT_ITEM154', navigable,property_false);
--when otherS then
--message ('unexpected error');
when no_data_found then message ('TEST CODE NOT RECOGNIZED');
raise form_trigger_failure;
when otherS then
message ('unexpected error');
raise form_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
END;
1. These value are dynamically matched with the values in the HORT_CROP_DETAILS and
HORT_SOIL_TEST_SERIES_CODE table .
2. These values can be edited from MENU >HORTICULTURE> EDIT VALUES tab.
3. All the rows except row 1 are disabled.
4. 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.HORT_SOIL_FERT_SAMPLE_INFO
values(:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM
113,:BLOCK60.TEXT_ITEM154,:BLOCK60.TEXT_ITEM164,:BLOCK60.TEXT_ITEM8,:BLOCK60.TEXT_ITEM124
,:BLOCK60.TEXT_ITEM343);
commit;
insert into HR.lab_id_tracker
values(:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM
113);
commit;
SET_ITEM_PROPERTY ( 'BLOCK60.ITEM73',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.ITEM73',background_color,'r88g100b75');
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_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.ITEM9',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);
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM344',ENABLED ,PROPERTY_TRUE);
GO_ITEM('BLOCK60.ITEM73');
--message('color');
END;
5. The DELETE button delete any information entered.
DECLARE
BEGIN
DELETE FROM HR.HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID =
:BLOCK60.TEXT_ITEM103;
DELETE FROM HR.lab_id_tracker WHERE LAB_ID = :BLOCK60.TEXT_ITEM103;
commit;
GO_ITEM('BLOCK60.TEXT_ITEM62');
END;
6. 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.HORT_SOIL_FERT_SAMPLE_INFO
values(:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM
121,:BLOCK60.TEXT_ITEM162,:BLOCK60.TEXT_ITEM172,:BLOCK60.ITEM16,:BLOCK60.TEXT_ITEM132,:BL
OCK60.TEXT_ITEM351);
commit;
insert into HR.lab_id_tracker
values(:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM
121);
commit;
go_BLOCK ('BLOCK60');
clear_block;
GO_ITEM('BLOCK60.TEXT_ITEM62');
END;
7. BACK TO SEARCH button takes back to the client search page for entering new information.
8. new_form('C:projhort_client_search.fmx',no_rollback,no_query_only,share_library_data);
9. CLEAR FORM clears the form.
declare
begin
GO_block('BLOCK7');
CLEAR_BLOCK(no_validate);
GO_block('BLOCK60');
CLEAR_BLOCK(no_validate);
message('d');
end;
4. SOIL INFO ENTRY PAGE(FOR NEW USERS)
NAME- HORT_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 >HORTICULTURE>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.
1. The client information frame is for entering the value of client details.
2. The text boxes have individual checks on them like:
3. Id – number only (auto)
4. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to
FM999999999
5. Doc – sysdate(auto) can be changed (date of profile creation)
SELECT to_date(sysdate,'dd-mon-yy') into :DOC FROM dual;
6. Zip – 5 digit number only
7. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to 99999
8. Phone – 10 digit number only
9. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to 9999999999
10. Email – in the format of ‘xyz@ab.com’ only
11. For this we have a POST_TEXT_ITEM trigger on EMAIL Text field.
DECLARE
v_email varchar2(100);
v_length number(10);
v_error varchar2(10):='OK';
v_rates number(5):=0;
v_dots number(5):=0;
v_spfound boolean;
v_ret varchar2(100);
BEGIN
v_email := :email;
v_length:=length(v_email);
for i in 1..v_length loop
if substr(v_email,i,1)='@' then ---counting @
v_rates:=v_rates+1;
end if;
if substr(v_email,i,1)='.' then ---counting dots
v_dots:=v_dots+1;
end if;
end loop;
--message (v_length);
--if v_length = 0 then
--goto exitif;
if ascii(substr(v_email,1,1)) between 48 and 57 then
v_error:='SN';
elsif ascii(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 not v_rates=1 or v_dots > 2 then
v_error:='SE';
elsif v_dots =2 then
if instr(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';
elsif instr(v_email,'@') not between instr(v_email,'.') and instr(v_email,'.',1,2) then
v_error:='DFM';
end if;
elsif v_dots=1 then
if instr(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','Email verified','SE','Single Email Allowed','DFM','format not matched
email@removed',
'SN','Starting Number found','FS','First Special Character found','FM','Wrong format email@removed')
into v_ret from dual;
message(v_ret);
END;
12. Username and password for future use. Optional to fill it.
13. 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;
14. Soil information frame works same as the form in soil information entry form for existing users with
several checks and automated data entry.
15. 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.
16. Crop details and test details display area for reference purpose.
17. When we click on the SOIL SAMPLE INFO FRAME We will get the client ID filled automatically.
18. For that purpose we have a Trigger on client ID text fields
19. :block60.text_item62 := :BLOCK7.CLIENT_ID; -- this copies the value from CLIENT_INFO FRAME -
CLIENT_ID
20. 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.
21. While running the tool just pre tab as everything is done.
22. 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;
19. 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;
20. 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.
21. 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.
22. Both CROP_CODE and TEST_CODE fields have a POST_TEXT_ITEM trigger on them.
23. 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 HORT_CROP_DETAILS where crop_code =:text_item154;
if b=0 then
message('CROP CODE NOT RECOGNIZED');
raise form_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
else
select crop_name into a from HORT_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);
exception
-- when NO_DATA_FOUND then
-- message('CROP CODE NOT RECOGNIZED');
-- set_item_property('block60.TEXT_ITEM154', navigable,property_false);
--when otherS then
--message ('unexpected error');
when no_data_found then message ('CROP CODE NOT RECOGNIZED');
raise form_trigger_failure;
when otherS then
message ('unexpected error');
raise form_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true);
END;
24. 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 HORT_SOIL_TEST_SERIES_CODE where TEST_code
=:text_item164;
if b=0 then
message('TEST CODE NOT RECOGNIZED');
raise form_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
else
select TESTS into a from HORT_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
-- when NO_DATA_FOUND then
-- message('CROP CODE NOT RECOGNIZED');
-- set_item_property('block60.TEXT_ITEM154', navigable,property_false);
--when otherS then
--message ('unexpected error');
when no_data_found then message ('TEST CODE NOT RECOGNIZED');
raise form_trigger_failure;
when otherS then
message ('unexpected error');
raise form_trigger_failure;
set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true);
END;
10. These value are dynamically matched with the values in the HORT_CROP_DETAILS and
HORT_SOIL_TEST_SERIES_CODE table .
11. These values can be edited from MENU >HORTICULTURE> EDIT VALUES tab.
12. All the rows except row 1 are disabled.
13. 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.HORT_SOIL_FERT_SAMPLE_INFO
values(:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM
113,:BLOCK60.TEXT_ITEM154,:BLOCK60.TEXT_ITEM164,:BLOCK60.TEXT_ITEM8,:BLOCK60.TEXT_ITEM124
,:BLOCK60.TEXT_ITEM343);
commit;
insert into HR.lab_id_tracker
values(:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM
113);
commit;
SET_ITEM_PROPERTY ( 'BLOCK60.ITEM73',ENABLED ,PROPERTY_TRUE);
--Set_item_property('BLOCK60.ITEM73',background_color,'r88g100b75');
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_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.ITEM9',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);
SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM344',ENABLED ,PROPERTY_TRUE);
GO_ITEM('BLOCK60.ITEM73');
--message('color');
END;
14. The DELETE button delete any information entered.
DECLARE
BEGIN
DELETE FROM HR.HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID =
:BLOCK60.TEXT_ITEM103;
DELETE FROM HR.lab_id_tracker WHERE LAB_ID = :BLOCK60.TEXT_ITEM103;
commit;
GO_ITEM('BLOCK60.TEXT_ITEM62');
END;
15. 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.HORT_SOIL_FERT_SAMPLE_INFO
values(:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM
121,:BLOCK60.TEXT_ITEM162,:BLOCK60.TEXT_ITEM172,:BLOCK60.ITEM16,:BLOCK60.TEXT_ITEM132,:BL
OCK60.TEXT_ITEM351);
commit;
insert into HR.lab_id_tracker
values(:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM
121);
commit;
go_BLOCK ('BLOCK60');
clear_block;
GO_ITEM('BLOCK60.TEXT_ITEM62');
END;
16. BACK TO SEARCH button takes back to the client search page for entering new information.
17. new_form('C:projhort_client_search.fmx',no_rollback,no_query_only,share_library_data);
18. 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 RESULTS GENERATION
There are 2 kinds of tests in the horticulture section of the tool.
1. Fertility tests
2. CEC
Both have the same features in the tool but different tests so these are kept in different forms in the tool. Both the
forms can be accessed from the main menu under the TEST RESULTS tab.
This section of the documents explains the fertility test results entry and the report generations for the fertility tests.
NAME= HORT_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);
OM1 NUMBER;
P1 NUMBER;
K1 NUMBER;
Test information viewing frame. It is
auto generated when a LAB ID is
entered.
Test result entry frame
for entering the values
we getfrom lab
tests.
After entering the values press this
button to generate the
recommendations
Auto generated recommendation from
calculations based on the lab test values
Takes to the report
generation form to generate
reports.
Additional comments for special
scenarios
ZN1 NUMBER;
PH1 NUMBER;
BPH1 NUMBER;
MG1 NUMBER;
FE1 NUMBER;
S1 NUMBER;
T1 NUMBER;
SD1 NUMBER;
CC1 NUMBER;
B1 NUMBER;
EC1 NUMBER;
CA1 NUMBER;
begin
select client_id into :client_id from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
select CLIENT_SAMPLE_ID into :CLIENT_SAMPLE_ID from HORT_SOIL_FERT_SAMPLE_INFO
where lab_id =:lab_id;
select first_name into :first_name from client_details where client_id= :client_id;
select last_name into :last_name from client_details where client_id= :client_id;
select to_date(sysdate,'dd-mon-yy') into :dor from dual;
select COUNT(TEST_SERIES_CODE) into T1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
IF T1=0 THEN NULL;
ELSE
select TEST_SERIES_CODE into :ITEM39 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
END IF;
IF :item39 =7 THEN
MESSAGE ('THIS SAMPLE IS FOR CEC TEST.');
END IF;
select COUNT(SAMPLE_depth) into SD1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
IF SD1=0 THEN NULL;
ELSE
select SAMPLE_depth into :tillage_depth from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
END IF;
select COUNT(crop_code) into CC1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
IF CC1=0 THEN NULL;
ELSE
select crop_code into :crop_code from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
END IF;
select COUNT(OM) into OM1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF OM1=0 THEN NULL;
ELSE
select OM into :OM from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(P) into P1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF P1=0 THEN NULL;
ELSE
select P into :P from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(K) into K1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF K1=0 THEN NULL;
ELSE
select K into :K from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(ZN) into ZN1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF ZN1=0 THEN NULL;
ELSE
select ZN into :ZN from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(PH) into PH1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF PH1=0 THEN NULL;
ELSE
select PH into :PH from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(BPH) into BPH1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF BPH1=0 THEN NULL;
ELSE
select BPH into :BPH from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(MG) into MG1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF MG1=0 THEN NULL;
ELSE
select MG into :MG from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(FE) into FE1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF FE1=0 THEN NULL;
ELSE
select FE into :FE from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(S) into S1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF S1=0 THEN NULL;
ELSE
select S into :S from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(B) into B1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF B1=0 THEN NULL;
ELSE
select B into :TEXT_ITEM44 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(EC) into EC1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF EC1=0 THEN NULL;
ELSE
select EC into :TEXT_ITEM45 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(CA) into CA1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
IF CA1=0 THEN NULL;
ELSE
select CA into :TEXT_ITEM46 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
END IF;
select tests into test from HORT_SOIL_TEST_SERIES_CODE where test_code = :ITEM39;
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. TEST RESULTS – this frame is for entering the values of the test results we receive from the lab.
6. Then press COMPUTE button to generate all the recommendation. And fill the next frame.
7. For this we have a WHEN_BUTTON_PRESSED trigger with the following code.
DECLARE
p1 number:=0;
c number(3):=0;
K1 NUMBER:=0;
PR1 NUMBER;
KR1 NUMBER;
v_tillage_depth number:=0;
SR1 NUMBER;
SUGG1 VARCHAR(60);
COMM1 VARCHAR2(2000);
LE1 number;
SRL1 NUMBER;
TSF1 NUMBER;
COMM2 VARCHAR2(2000);
ZN1 NUMBER(6,2):=0;
ZNR NUMBER(6,2):=0;
BPH1 NUMBER(6,2):=0;
LIME_REC1 NUMBER(6,3):=0;
PH1 NUMBER(6,2):=0;
BEGIN
c:=:crop_code;
v_tillage_depth :=:TILLAGE_DEPTH;
P1:=nvl(:P,0);
K1:=nvl(:K,0);
PH1:=nvl(:PH,0);
-- P AND K RECOMMENDATIONS, COMMENTS , LIME COMMENTS.
-- FOR CROP CODE 1 OR NO CROP CODE.
IF C IS NULL OR C=1 THEN
select PR into PR1 from HORT_P_K_RANGES where crop_code = c and P_min<= P1 and P_MAX >= P1;
select KR into KR1 from HORT_P_K_RANGES where crop_code = c and K_min<= K1 and K_MAX >= K1;
:P_REC:=PR1;
:K_REC:= KR1;
select SR into SR1 from HORT_SR_REC where PR=PR1 and KR=KR1;
SELECT SUGGESTION INTO SUGG1 FROM HORT_SR_SUGGESTION WHERE SR = SR1;
:SUGGESTIONS:= SUGG1;
IF SR1= 6 THEN
SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'EXCESS';
:COMMENTS1:= COMM1;
ELSE
SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'NUTRITION';
:COMMENTS1:=COMM1;
END IF;
IF PH1>7.9 THEN
SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIMEX';
:COMMENTS2 := COMM2;
ELSE
SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIME';
:COMMENTS2 := COMM2;
END IF;
-- FOR CROP CODE 2.
ELSIF C=2 THEN
select PR into PR1 from HORT_P_K_RANGES where crop_code = c and P_min<= P1 and P_MAX >= P1;
select KR into KR1 from HORT_P_K_RANGES where crop_code = c and K_min<= K1 and K_MAX >= K1;
:P_REC:=PR1;
:K_REC:= KR1;
select LE into LE1 from HORT_LE_REC where PR=PR1 and KR=KR1;
SELECT SUGGESTION INTO SUGG1 FROM HORT_LE_SUGGESTION WHERE LE = LE1;
:SUGGESTIONS:= SUGG1;
SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'EXISTING LAWN';
:COMMENTS1:= COMM1;
SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIMING TURF';
:COMMENTS2 := COMM2;
-- FOR CROP CODE 3.
ELSIF C=3 THEN
select PR into PR1 from HORT_P_K_RANGES where crop_code = c and P_min<= P1 and P_MAX >= P1;
select KR into KR1 from HORT_P_K_RANGES where crop_code = c and K_min<= K1 and K_MAX >= K1;
:P_REC:=PR1;
:K_REC:= KR1;
select SRL into SRL1 from HORT_SRL_REC where PR=PR1 and KR=KR1;
SELECT SUGGESTION INTO SUGG1 FROM HORT_SRL_SUGGESTION WHERE SRL = SRL1;
:SUGGESTIONS:= SUGG1;
SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'NEW LAWN';
:COMMENTS1:= COMM1;
SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIMING TURF';
:COMMENTS2 := COMM2;
-- FOR CROP CODE 4.
ELSIF C=4 THEN
select PR into PR1 from HORT_P_K_RANGES where crop_code = c and P_min<= P1 and P_MAX >= P1;
select KR into KR1 from HORT_P_K_RANGES where crop_code = c and K_min<= K1 and K_MAX >= K1;
:P_REC:=PR1;
:K_REC:= KR1;
select TSF into TSF1 from HORT_TSF_REC where PR=PR1 and KR=KR1;
SELECT SUGGESTION INTO SUGG1 FROM HORT_TSF_SUGGESTION WHERE TSF = TSF1;
:SUGGESTIONS:= SUGG1;
IF TSF1= 15 THEN
SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'EXCESS';
:COMMENTS1:= COMM1;
ELSE
SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'ALL';
:COMMENTS1:=COMM1;
END IF;
IF PH1>7.9 THEN
SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIMEX';
:COMMENTS2 := COMM2;
ELSE
SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIME FOR SMALL FRUITS';
:COMMENTS2 := COMM2;
END IF;
-- FOR CROP CODE 5,6.
ELSIF C=5 OR C=6 THEN
select PR into PR1 from HORT_P_K_RANGES where crop_code = c and P_min<= P1 and P_MAX >= P1;
select KR into KR1 from HORT_P_K_RANGES where crop_code = c and K_min<= K1 and K_MAX >= K1;
:P_REC:=PR1;
:K_REC:= KR1;
select TSF into TSF1 from HORT_TSF_REC where PR=PR1 and KR=KR1;
SELECT SUGGESTION INTO SUGG1 FROM HORT_TSF_SUGGESTION WHERE TSF = TSF1;
:SUGGESTIONS:= SUGG1;
IF TSF1= 15 THEN
SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'EXCESS';
:COMMENTS1:= COMM1;
ELSE
SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'ALL';
:COMMENTS1:=COMM1;
END IF;
IF PH1>7.9 THEN
SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIMEX';
:COMMENTS2 := COMM2;
ELSE
SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIME';
:COMMENTS2 := COMM2;
END IF;
ELSE
MESSAGE('NO RECOMMENDATION PROVIDED BY SOIL AND PLANT ANALYSIS LAB.');
END IF;
-- ZN RECOMMENDATIONS
-- FOR ALL CROPS
ZN1 := :ZN;
if zn1 is null then
:ZN_REC := 0;
else
select ZN_REC into ZNR from HORT_ZN_REC where ZN_MIN<= ZN1 and ZN_MAX >= ZN1;
:ZN_REC := ZNR;
end if;
-- LIME RECOMMENDATIONS
-- FOR ALL CROPS
--CALCULATING FORMULA (7.0-BpH)*230
if ph1 is null then
:LIME_REC:=0;
:BPH := 0;
elsIF PH1>6.9 THEN
MESSAGE('pH IS GREATER THAN 6.9. BpH IS NOT TESTED.');
:BPH := 0;
ELSE
BPH1:=:BPH;
--message (bph1);
IF BPH1 <=7.0 THEN
LIME_REC1 :=(7.0-BPH1)* 230;
:LIME_REC:=LIME_REC1;
ELSE
:LIME_REC:=0;
END IF;
END IF;
END;
8. RECOMMENDATIONS – this frame shows all the recommendations generated by the system based on
the calculations provided along with the comments.
9. Press SAVE button to save all information in the database.(important)
10. For this we have a WHEN_BUTTON_PRESSED Trigger with COMMIT_FORM; command.
11. CLEAR FORM – clears the form for a new entry based on different LAB ID.
GO_BLOCK ('HORT_SOIL_FERT_TEST_RESULTS1');
CLEAR_BLOCK;
GO_ITEM('LAB_ID');
12. REPORT – takes to the report generation form to generate the reports based on individual client ID and
the date when the results were entered.
13. For this we have a WHEN_BUTTON_PRESSED Trigger with
new_form('c:projHORT_FERT_RESULT_REPORT.fmx',no_rollback,no_query_only,share_library_data);
14. The COMMENTS are auto generated as per the calculations but in some of the special cases we need to
use the ADDITIONAL COMMENTS radio bar. The situations are written there and when the radio button
are changed the system will save the required comments.
15. The special cases can be any one of the following – MULTIPLE CROPS in the soil sample information,
ATHELETIC TURF as the crop code, NON FERTILITY TEST requested, OUT OF STATE soil samples, NO
CROP INFO provided, MG test requested, COMMERCIAL GARDEN crop requested.
SOIL CEC TEST RESULTS GENERATION
NAME= HORT_CEC_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.
3. MENU BAR AND THE HEADER are same as all the other forms.
4. CLIENT 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.
5. For this we have a POST_TEXT_ITEM Trigger on LAB ID text field.
declare
test varchar2(70);
NA1 NUMBER;
P1 NUMBER;
K1 NUMBER;
CA1 NUMBER;
PH1 NUMBER;
BPH1 NUMBER;
CLIENT AND TEST
INFORMATION
LAB TEST RESULTS
MG1 NUMBER;
H1 NUMBER;
AL1 NUMBER;
T1 NUMBER;
SD1 NUMBER;
CC1 NUMBER;
begin
select client_id into :client_id from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
select CLIENT_SAMPLE_ID into :CLIENT_SAMPLE_ID from HORT_SOIL_FERT_SAMPLE_INFO where lab_id
=:lab_id;
select first_name into :first_name from client_details where client_id= :client_id;
select last_name into :last_name from client_details where client_id= :client_id;
select to_date(sysdate,'dd-mon-yy') into :dor from dual;
select COUNT(TEST_SERIES_CODE) into T1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
IF T1=0 THEN NULL;
ELSE
select TEST_SERIES_CODE into :TEST_CODE from HORT_SOIL_FERT_SAMPLE_INFO where lab_id
=:lab_id;
END IF;
IF :TEST_CODE <>7 THEN
MESSAGE ('THIS SAMPLE IS NOT FOR CEC TEST.');
END IF;
select COUNT(SAMPLE_depth) into SD1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
IF SD1=0 THEN NULL;
ELSE
select SAMPLE_depth into :ITEM14 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
END IF;
select COUNT(crop_code) into CC1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
IF CC1=0 THEN NULL;
ELSE
select crop_code into :crop_code from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
END IF;
---ALREADY LOADED RESULTS
select COUNT(K) into K1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
IF K1=0 THEN NULL;
ELSE
select K into :K from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(CA) into CA1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
IF CA1=0 THEN NULL;
ELSE
select CA into :CA from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(NA) into NA1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
IF NA1=0 THEN NULL;
ELSE
select NA into :NA from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(PH) into PH1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
IF PH1=0 THEN NULL;
ELSE
select PH into :PH from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(MG) into MG1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
IF MG1=0 THEN NULL;
ELSE
select MG into :MG from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(H) into H1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
IF H1=0 THEN NULL;
ELSE
select H into :H from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
END IF;
select COUNT(AL) into AL1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
IF AL1=0 THEN NULL;
ELSE
select AL into :AL from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id;
END IF;
select tests into test from HORT_SOIL_TEST_SERIES_CODE where test_code = :ITEM14;
message (test);
EXCEPTION
when NO_DATA_FOUND then
message ('The value entered does not have any records present. Please recheck the Lab ID. ');
end;
16. TEST RESULTS – this frame is for entering the values of the test results we receive from the lab.
17. Then press COMPUTE button to generate all the recommendation. And fill the next frame.
18. For this we have a WHEN_BUTTON_PRESSED trigger with the following code.
DECLARE
A NUMBER;
K NUMBER(7,3);
CA NUMBER(7,3);
NA NUMBER(7,3);
MG NUMBER(7,3);
AL NUMBER(7,3);
H NUMBER(7,3);
K2 NUMBER(7,3);
CA2 NUMBER(7,3);
NA2 NUMBER(7,3);
MG2 NUMBER(7,3);
AL2 NUMBER(7,3);
H2 NUMBER(7,3);
BEGIN
k :=NVL(:K,0);
CA :=NVL(:CA,0);
NA :=NVL(:NA,0);
MG :=NVL(:MG,0);
AL :=NVL(:AL,0);
H :=NVL(:H,0);
K2 := K/39;
CA2:= CA/20;
NA2:= NA/23;
AL2:= AL/8.9;
MG2:= MG/12;
IF :PH <5.5 THEN
:CEC := k2+CA2+NA2+MG2+AL2+H;
ELSE
:CEC := k2+CA2+NA2+MG2;
END IF;
END;
HORTICULTURE TEST RESULTS REPORT GENERATION
NAME – HORT_FERT_RESULT_REPORT.FMX
Report -HORT_RESULT_REPORT_NOR.RDF
HORT_RESULT_REPORT_MG_EC.RDF
HORT_RESULT_REPORT_MG_EC_CEC2.RDF
HORT_RESULT_REPORT.RDF
HORT_CEC_RESULT_REPORT.RDF
This is a form from which will generate and call the results report in pdf format.
The report is generated for each
client based on the LAB_ID.
Button to call report
This page comes from the main menu under the REPORTS section >HORTICULTURE PRODUCT>FERT TEST
RESULTS.
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. There are 5 different kinds of reports in the fertility section. We have so many kinds because the
requirement was to call the reports with inly the relevant fields included.
14. There are several scenarios for calling the reports. We have 3 sections of tests included in the test
results.
a. K, P, PH, BPH, OM,ZN (NORMAL)
b. MG, FE, S, B, EC (ADDITIONAL TESTS)
c. K, CA, NA, MG, AL, H, CEC (CEC TESTS)
15. There are different combination of reports which includes these fields.
a. Only normal fields ---- HORT_RESULT_REPORT_NOR.RDF
b. Normal fields + additional tests ------ HORT_RESULT_REPORT_MG_EC.RDF
c. Normal + CEC ------- HORT_RESULT_REPORT.RDF
d. Normal + additional fields + CEC ----- HORT_RESULT_REPORT_MG_EC_CEC2.RDF
e. Only CEC ------ HORT_CEC_RESULT_REPORT.RDF
16. The report calling code calculates and check which fields are present and which fields are completely
NULL for all the given LAB_IDs.
17. 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;
CC1 NUMBER:=0;
J NUMBER:=0;
CTR_MG NUMBER(7,3):=0;
MG_VAR NUMBER(7,3):=0;
K NUMBER:=0;
CTR_FE NUMBER(7,3):=0;
FE_VAR NUMBER(7,3):=0;
L NUMBER:=0;
CTR_S NUMBER(7,3):=0;
S_VAR NUMBER(7,3):=0;
M NUMBER:=0;
CTR_B NUMBER(7,3):=0;
B_VAR NUMBER(7,3):=0;
N NUMBER:=0;
CTR_EC NUMBER(7,3):=0;
EC_VAR NUMBER(7,3):=0;
Z NUMBER:=0;
CTR_CA2 NUMBER(7,3):=0;
CA2_VAR NUMBER(7,3):=0;
MG_TOTAL NUMBER:=0;
A1 NUMBER:=0;
CTR_K NUMBER(7,3):=0;
K_VAR NUMBER(7,3):=0;
A2 NUMBER:=0;
CTR_P NUMBER(7,3):=0;
P_VAR NUMBER(7,3):=0;
A3 NUMBER:=0;
CTR_PH NUMBER(7,3):=0;
PH_VAR NUMBER(7,3):=0;
A4 NUMBER:=0;
CTR_BPH NUMBER(7,3):=0;
BPH_VAR NUMBER(7,3):=0;
A5 NUMBER:=0;
CTR_OM NUMBER(7,3):=0;
OM_VAR NUMBER(7,3):=0;
A6 NUMBER:=0;
CTR_ZN NUMBER(7,3):=0;
ZN_VAR NUMBER(7,3):=0;
FERT_TOTAL NUMBER:=0;
B1 NUMBER:=0;
CTR_K2 NUMBER(7,3):=0;
K2_VAR NUMBER(7,3):=0;
B2 NUMBER:=0;
CTR_CA NUMBER(7,3):=0;
CA_VAR NUMBER(7,3):=0;
B3 NUMBER:=0;
CTR_NA NUMBER(7,3):=0;
NA_VAR NUMBER(7,3):=0;
B4 NUMBER:=0;
CTR_MG2 NUMBER(7,3):=0;
MG2_VAR NUMBER(7,3):=0;
B5 NUMBER:=0;
CTR_AL NUMBER(7,3):=0;
AL_VAR NUMBER(7,3):=0;
B6 NUMBER:=0;
CTR_H NUMBER(7,3):=0;
H_VAR NUMBER(7,3):=0;
B7 NUMBER:=0;
CTR_CEC NUMBER(7,3):=0;
CEC_VAR NUMBER(7,3):=0;
CEC_TOTAL 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 HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID;
select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID union
select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID ) ;
FOR I IN 0 .. LEN LOOP
SELECT CLIENT_ID INTO ID2 FROM (select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+I
union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+I );
IF ID2<>ID THEN
CTR:= CTR+1;
END IF;
ID2:=0;
END LOOP;
--MESSAGE(CTR);
IF CTR>0 THEN
MESSAGE('PLEASE CHECK THE LAB ID AS ALL THE CLIENTS ARE NOT SAME.');
GOTO ABC;
END IF;
--CHECKING FOR THE MG,FE,S, B,EC,CA TO CALL A DIFFERENT REPORT BASED ON THE DATA AVAILABLE IN THE
MG, FE ETC..
FOR J IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+J;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT MG INTO MG_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+J;
IF MG_VAR IS NOT NULL THEN
CTR_MG := CTR_MG+1;
END IF;
END IF;
-- MG_VAR :=0;
CC1 :=0;
END LOOP;
FOR I IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+I;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT FE INTO FE_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+I;
IF FE_VAR IS NOT NULL THEN
CTR_FE := CTR_FE+1;
END IF;
END IF;
-- FE_VAR :=0;
CC1 :=0;
END LOOP;
FOR L IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+L;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT S INTO S_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+L;
IF S_VAR IS NOT NULL THEN
CTR_S := CTR_S+1;
END IF;
END IF;
-- S_VAR :=0;
CC1 :=0;
END LOOP;
FOR M IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+M;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT B INTO B_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+M;
IF B_VAR IS NOT NULL THEN
CTR_B := CTR_B+1;
END IF;
END IF;
-- B_VAR :=0;
CC1 :=0;
END LOOP;
FOR N IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+N;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT EC INTO EC_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+N;
IF EC_VAR IS NOT NULL THEN
CTR_EC := CTR_EC+1;
END IF;
END IF;
-- EC_VAR :=0;
CC1 :=0;
END LOOP;
FOR Z IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+Z;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT CA INTO CA2_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+Z;
IF CA2_VAR IS NOT NULL THEN
CTR_CA2 := CTR_CA2+1;
END IF;
END IF;
-- EC_VAR :=0;
CC1 :=0;
END LOOP;
--MESSAGE (CTR_MG|| ' ' ||CTR_FE||' ' ||CTR_S||' '||CTR_B||' '||CTR_EC);
MG_TOTAL:= CTR_MG+CTR_FE +CTR_S +CTR_B +CTR_EC+CTR_CA;
--MESSAGE (MG_TOTAL);
FOR A1 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A1;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT K INTO K_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A1;
IF K_VAR IS NOT NULL THEN
CTR_K := CTR_K+1;
END IF;
END IF;
CC1 :=0;
-- MG_VAR :=0;
END LOOP;
FOR A2 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A2;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT P INTO P_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A2;
IF P_VAR IS NOT NULL THEN
CTR_P := CTR_P+1;
END IF;
END IF;
CC1 :=0;
-- FE_VAR :=0;
END LOOP;
FOR A3 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A3;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT PH INTO PH_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A3;
IF PH_VAR IS NOT NULL THEN
CTR_PH := CTR_PH+1;
END IF;
END IF;
CC1 :=0;
-- S_VAR :=0;
END LOOP;
FOR A4 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A4;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT BPH INTO BPH_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A4;
IF BPH_VAR IS NOT NULL THEN
CTR_BPH := CTR_BPH+1;
END IF;
END IF;
CC1 :=0;
-- B_VAR :=0;
END LOOP;
FOR A5 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A5;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT OM INTO OM_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A5;
IF OM_VAR IS NOT NULL THEN
CTR_OM := CTR_OM+1;
END IF;
END IF;
CC1 :=0;
-- EC_VAR :=0;
END LOOP;
FOR A6 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A6;
IF CC1 >= 1 AND CC1<=6 THEN
SELECT ZN INTO ZN_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A6;
IF ZN_VAR IS NOT NULL THEN
CTR_ZN := CTR_ZN+1;
END IF;
END IF;
CC1 :=0;
-- EC_VAR :=0;
END LOOP;
FERT_TOTAL:= CTR_K+CTR_P +CTR_PH +CTR_BPH +CTR_OM+CTR_ZN;
--MESSAGE (CTR_K|| ' ' ||CTR_P||' ' ||CTR_PH||' '||CTR_BPH||' '||CTR_OM||' '||CTR_ZN);
--MESSAGE(FERT_TOTAL);
FOR B1 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B1;
IF CC1 =7 THEN
SELECT K INTO K2_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B1;
IF K2_VAR IS NOT NULL THEN
CTR_K2 := CTR_K2+1;
END IF;
END IF;
CC1 :=0;
-- MG_VAR :=0;
END LOOP;
FOR B2 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B2;
IF CC1 =7 THEN
SELECT CA INTO CA_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B2;
IF CA_VAR IS NOT NULL THEN
CTR_CA := CTR_CA+1;
END IF;
END IF;
CC1 :=0;
-- FE_VAR :=0;
END LOOP;
FOR B3 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B3;
IF CC1 =7 THEN
SELECT NA INTO NA_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B3;
IF NA_VAR IS NOT NULL THEN
CTR_NA := CTR_NA+1;
END IF;
END IF;
CC1 :=0;
-- S_VAR :=0;
END LOOP;
FOR B4 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B4;
IF CC1 =7 THEN
SELECT MG INTO MG2_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B4;
IF MG2_VAR IS NOT NULL THEN
CTR_MG2 := CTR_MG2+1;
END IF;
END IF;
CC1 :=0;
-- B_VAR :=0;
END LOOP;
FOR B5 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B5;
IF CC1 =7 THEN
SELECT H INTO H_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B5;
IF H_VAR IS NOT NULL THEN
CTR_H := CTR_H+1;
END IF;
END IF;
CC1 :=0;
-- EC_VAR :=0;
END LOOP;
FOR B6 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B6;
IF CC1 =7 THEN
SELECT AL INTO AL_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B6;
IF AL_VAR IS NOT NULL THEN
CTR_AL := CTR_AL+1;
END IF;
END IF;
CC1 :=0;
-- EC_VAR :=0;
END LOOP;
FOR B7 IN 0 .. LEN LOOP
SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B7;
IF CC1 =7 THEN
SELECT CEC INTO CEC_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B7;
IF CEC_VAR IS NOT NULL THEN
CTR_CEC := CTR_CEC+1;
END IF;
END IF;
CC1 :=0;
-- EC_VAR :=0;
END LOOP;
CEC_TOTAL:= CTR_K2+CTR_CA +CTR_NA +CTR_MG2 +CTR_AL+CTR_H+CTR_CEC;
--MESSAGE (CTR_K2|| ' ' ||CTR_CA||' ' ||CTR_NA||' '||CTR_MG2||' '||CTR_AL||' '||CTR_H||' '||CTR_CEC);
--MESSAGE(CEC_TOTAL);
--FERT_TOTAL MG_TOTAL CEC_TOTAL
-- CALLING ONLY NORMAL REPORT WITH K,P,PH,BPH,OM,ZN
IF MG_TOTAL=0 AND CEC_TOTAL = 0 AND FERT_TOTAL>0 THEN
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:PROJhort_result_report_NOR.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);
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
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;
-- CALLING REPORT WITH K,P,PH,BPH,OM,ZN AND MG,FE,S,B,EC
ELSIF MG_TOTAL>0 AND CEC_TOTAL = 0 AND FERT_TOTAL>0 THEN
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:PROJhort_result_report_mg_ec.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);
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
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;
-- CALLING REPORT WITH K,P,PH,BPH,OM,ZN AND MG,FE,S,B,EC AND CEC
ELSIF MG_TOTAL>0 AND CEC_TOTAL > 0 AND FERT_TOTAL>0 THEN
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:PROJhort_result_report_mg_ec_CEC2.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);
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
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;
-- CALLING REPORT WITH K, P, PH, BPH, OM, ZN AND CEC
ELSIF MG_TOTAL=0 AND CEC_TOTAL > 0 AND FERT_TOTAL>0 THEN
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:PROJhort_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 STARTID='||:BLOCK2.TEXT_ITEM5||'
ENDID='||:BLOCK2.TEXT_ITEM6);
Str_Report_Server_Job := RUN_REPORT_OBJECT(repid);
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
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;
-- CALLING REPORT WITH ONLY CEC
ELSIF MG_TOTAL=0 AND CEC_TOTAL > 0 AND FERT_TOTAL=0 THEN
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:PROJHORT_CEC_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 STARTID='||:BLOCK2.TEXT_ITEM5||'
ENDID='||:BLOCK2.TEXT_ITEM6);
Str_Report_Server_Job := RUN_REPORT_OBJECT(repid);
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
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;
---- CALLING REPORT WITH K,P,PH,BPH,OM,ZN AND MG,FE,S,B,EC
ELSIF MG_TOTAL>0 AND CEC_TOTAL = 0 AND FERT_TOTAL=0 THEN
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:PROJhort_result_report_mg_ec.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);
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
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;
---- CALLING REPORT WITH K,P,PH,BPH,OM,ZN AND MG,FE,S,B,EC
ELSIF MG_TOTAL>0 AND CEC_TOTAL > 0 AND FERT_TOTAL=0 THEN
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:PROJhort_result_report_mg_ec_CEC2.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);
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
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;
ELSE
MESSAGE('THERE IS NO RESULT DATA FOR THESE LAB IDs.');
END IF;
<<ABC>>
NULL;
EXCEPTION
WHEN OTHERS THEN
MESSAGE('PLEASE CHECK THE LAB ID AS NO DATA IS PRESENT FOR THESE IDs.');
END;
Only normal fields ---- HORT_RESULT_REPORT_NOR.RDF
Normal fields + additional tests ------ HORT_RESULT_REPORT_MG_EC.RDF
Normal + CEC ------- HORT_RESULT_REPORT.RDF
Normal + additional fields + CEC ----- HORT_RESULT_REPORT_MG_EC_CEC2.RDF
Only CEC ------ HORT_CEC_RESULT_REPORT.RDF
REPORT
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.
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_9.
10. CF_1- displays FIRST NAME
function CF_1Formula return Char is
fname varchar2(60);
id number;
id2 number;
begin
select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE
LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid )
;
select FIRST_NAME into fname from client_details where client_id = ID;
return (fname);
exception
when no_data_found then
select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid;
select FIRST_NAME into fname from client_details where client_id = ID2;
return (fname);
end;
11. CF_2 – displays LAST NAME
function CF_2Formula return Char is
id number;
id2 number;
lname varchar2(60);
begin
select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS
WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID
=:startid ) ;
select lasT_NAME into lname from client_details where client_id = ID;
return (lname);
exception
when NO_DATA_FOUND then
select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid;
select lasT_NAME into lname from client_details where client_id = ID2;
return (lname);
end;
12. CF_3 – displays ADDRESS
function CF_3Formula return Char is
addr varchar2(100);
id number;
id2 number;
begin
select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS
WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID
=:startid ) ;
select address into addr from client_details where client_id = ID;
return (addr);
exception
when NO_DATA_FOUND then
select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid;
select address into addr from client_details where client_id = ID2;
return (addr);
end;
13. CF_4 – displays CITY
function CF_4Formula return Char is
vcity varchar2 (20);
id number;
id2 number;
begin
select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE
LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid )
;
select city into vcity from client_details where client_id = ID;
return (vcity);
exception
when NO_DATA_FOUND then
select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid;
select city into vcity from client_details where client_id = ID2;
return (vcity);
end;
14. CF_5 – displays STATE
function CF_5Formula return Char is
id number;
id2 number;
vstate varchar2 (20);
begin
select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS
WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID
=:startid ) ;
select state into vstate from client_details where client_id = ID;
return (vstate);
exception
when NO_DATA_FOUND then
select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid;
select state into vstate from client_details where client_id = ID2;
return (vstate);
end;
15. CF_6 – displays COUNTY
function CF_6Formula return Char is
id number;
id2 number;
vcounty varchar2 (27);
begin
select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE
LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid )
;
select county into vcounty from client_details where client_id = ID;
return (vcounty);
exception
when NO_DATA_FOUND then
select client_id into id2 from HR.HORT_SOIL_CEC_RESULTS where lab_id = :startid;
select county into vcounty from client_details where client_id = ID2;
return (vcounty);
end;
16. CF_7 – displays ZIP
function CF_7Formula return Number is
id number;
id2 number;
vzip number (15);
begin
select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE
LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid )
;
select zip into vzip from client_details where client_id = ID;
return (vzip);
exception
when NO_DATA_FOUND then
select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid;
select zip into vzip from client_details where client_id = ID2;
return (vzip);
end;
17. CF_8 – displays PHONE NUMBER
function CF_8Formula return char is
id number;
id2 number;
sfn varchar2(60);
begin
select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE
LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid ) ;
select sub_first_name into sfn from client_details where client_id = ID;
return (sfn);
exception
when NO_DATA_FOUND then
select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid;
select sub_first_name into sfn from client_details where client_id = ID2;
return (sfn);
end;
18. CF_9– displays submitter’s last name
19.
function CF_9Formula return char is
id number;
id2 number;
sln varchar2(60);
begin
select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE
LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid ) ;
select sub_last_name into sln from client_details where client_id = ID;
return (sln);
exception
when NO_DATA_FOUND then
select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid;
select sub_last_name into sln from client_details where client_id = ID2;
return (sln);
WHEN OTHERS THEN
RETURN 0;
end;
20. Parent modules starts after these 2 parts.
21. In the different reports there are different numbers of repeating parent form.
Normal + additional fields + CEC ----- HORT_RESULT_REPORT_MG_EC_CEC2.RDF
1. There are 13 data blocks used in this report to pull every needed details. The blocks are numbered
Q_1 – Q-13.
2. There are 7 parent repeating sections in the report which uses the above mentioned data query
blocks.
3. Q_1 is used by SOIL TEST RESULTS,RECOMMENDATIONS
SELECT ALL HORT_SOIL_FERT_TEST_RESULTS.CLIENT_SAMPLE_ID,
HORT_SOIL_FERT_TEST_RESULTS.LAB_ID,
HORT_SOIL_FERT_TEST_RESULTS.K, HORT_SOIL_FERT_TEST_RESULTS.CROP_CODE,
HORT_SOIL_FERT_TEST_RESULTS.P,
HORT_SOIL_FERT_TEST_RESULTS.PH, HORT_SOIL_FERT_TEST_RESULTS.OM,
HORT_SOIL_FERT_TEST_RESULTS.ZN, HORT_SOIL_FERT_TEST_RESULTS.BPH,
HORT_SOIL_FERT_TEST_RESULTS.MG, HORT_SOIL_FERT_TEST_RESULTS.FE,
HORT_SOIL_FERT_TEST_RESULTS.S,
HORT_SOIL_FERT_TEST_RESULTS.P_REC, HORT_SOIL_FERT_TEST_RESULTS.K_REC,
HORT_SOIL_FERT_TEST_RESULTS.LIME_REC, HORT_SOIL_FERT_TEST_RESULTS.ZN_REC,
HORT_SOIL_FERT_TEST_RESULTS.B,
HORT_SOIL_FERT_TEST_RESULTS.CA, HORT_SOIL_FERT_TEST_RESULTS.EC
FROM HORT_SOIL_FERT_TEST_RESULTS
WHERE (HORT_SOIL_FERT_TEST_RESULTS.LAB_ID> = :STARTID
AND HORT_SOIL_FERT_TEST_RESULTS.LAB_ID< = :ENDID) ORDER BY LAB_ID;
4. Q_2 is used by SUGGESTIONS
SELECT DISTINCT (HORT_SOIL_FERT_TEST_RESULTS.SUGGESTIONS) ,
HORT_SOIL_FERT_TEST_RESULTS.CROP_CODE,
HORT_SOIL_FERT_TEST_RESULTS.LAB_ID
FROM HORT_SOIL_FERT_TEST_RESULTS
WHERE (HORT_SOIL_FERT_TEST_RESULTS.LAB_ID> = :STARTID
AND HORT_SOIL_FERT_TEST_RESULTS.LAB_ID< = :ENDID)
5. Q_3 is used by COMMENTS
SELECT DISTINCT(HORT_SOIL_FERT_TEST_RESULTS.COMMENTS1),
CROP_CODE
FROM HORT_SOIL_FERT_TEST_RESULTS where HORT_SOIL_FERT_TEST_RESULTS.LAB_ID >=
:STARTID and HORT_SOIL_FERT_TEST_RESULTS.LAB_ID <= :ENDID ORDER BY CROP_CODE;
6. Q-4 is used by LIME COMMENTS
SELECT DISTINCT(HORT_SOIL_FERT_TEST_RESULTS.COMMENTS2),
CROP_CODE
FROM HORT_SOIL_FERT_TEST_RESULTS where HORT_SOIL_FERT_TEST_RESULTS.LAB_ID >=
:STARTID and HORT_SOIL_FERT_TEST_RESULTS.LAB_ID <= :ENDID ORDER BY CROP_CODE;
7. Q-5 is used by OTHER COMMENTS
SELECT DISTINCT(HORT_SOIL_FERT_TEST_RESULTS.COMMENTS4)
FROM HORT_SOIL_FERT_TEST_RESULTS where HORT_SOIL_FERT_TEST_RESULTS.LAB_ID >=
:STARTID and HORT_SOIL_FERT_TEST_RESULTS.LAB_ID <= :ENDID;
8. Q-6 is used by OTHER COMMENTS
SELECT DISTINCT(HORT_SOIL_FERT_TEST_RESULTS.COMMENTS5)
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS
LIMS_doc_for_HORT_PRODUCTS

More Related Content

Similar to LIMS_doc_for_HORT_PRODUCTS

Spinach Trial 81315 USA
Spinach Trial 81315 USASpinach Trial 81315 USA
Spinach Trial 81315 USAsnanda2001
 
Product information sheet booklet 2013 with micros
Product information sheet booklet 2013 with microsProduct information sheet booklet 2013 with micros
Product information sheet booklet 2013 with microsglind1014
 
Strawberry2
Strawberry2Strawberry2
Strawberry2mhnw
 
Carrot-Production-Guideline-2019.pdf
Carrot-Production-Guideline-2019.pdfCarrot-Production-Guideline-2019.pdf
Carrot-Production-Guideline-2019.pdfAMIT Singh
 
Fsc 506-need based nutrition,-splits and time of nutrients application
Fsc 506-need based nutrition,-splits and time of nutrients applicationFsc 506-need based nutrition,-splits and time of nutrients application
Fsc 506-need based nutrition,-splits and time of nutrients applicationPanchaal Bhattacharjee
 
ManureCompostComFertilizer_GalCoCropSch2006 ACP NCII.pdf
ManureCompostComFertilizer_GalCoCropSch2006 ACP NCII.pdfManureCompostComFertilizer_GalCoCropSch2006 ACP NCII.pdf
ManureCompostComFertilizer_GalCoCropSch2006 ACP NCII.pdfDARRENLOUIEESTOMO
 
Managing and Amending Soils for Productive Yields in High Tunnels, 2015
Managing and Amending Soils for Productive Yields in High Tunnels, 2015Managing and Amending Soils for Productive Yields in High Tunnels, 2015
Managing and Amending Soils for Productive Yields in High Tunnels, 2015University of Minnesota-Horticulture
 
Lawn Appreciation - Fall Grass Seeding Presentation
Lawn Appreciation - Fall Grass Seeding PresentationLawn Appreciation - Fall Grass Seeding Presentation
Lawn Appreciation - Fall Grass Seeding PresentationLawn Appreciation
 
nutrient-management-of-corn.pptxSfklavFV
nutrient-management-of-corn.pptxSfklavFVnutrient-management-of-corn.pptxSfklavFV
nutrient-management-of-corn.pptxSfklavFVFarhanaNoor12
 
Good Grass Guide.pdf
Good Grass Guide.pdfGood Grass Guide.pdf
Good Grass Guide.pdfloganscott18
 

Similar to LIMS_doc_for_HORT_PRODUCTS (20)

9 18-9-1
9 18-9-19 18-9-1
9 18-9-1
 
3 18-18-1
3 18-18-13 18-18-1
3 18-18-1
 
Cranberry Nutrient Management
Cranberry Nutrient ManagementCranberry Nutrient Management
Cranberry Nutrient Management
 
Pre-Sidedress Nitrate Test
Pre-Sidedress Nitrate TestPre-Sidedress Nitrate Test
Pre-Sidedress Nitrate Test
 
6 24-6-1
6 24-6-16 24-6-1
6 24-6-1
 
Nitro Max Presentation
Nitro Max PresentationNitro Max Presentation
Nitro Max Presentation
 
Spinach Trial 81315 USA
Spinach Trial 81315 USASpinach Trial 81315 USA
Spinach Trial 81315 USA
 
Product information sheet booklet 2013 with micros
Product information sheet booklet 2013 with microsProduct information sheet booklet 2013 with micros
Product information sheet booklet 2013 with micros
 
Strawberry2
Strawberry2Strawberry2
Strawberry2
 
Carrot-Production-Guideline-2019.pdf
Carrot-Production-Guideline-2019.pdfCarrot-Production-Guideline-2019.pdf
Carrot-Production-Guideline-2019.pdf
 
Fsc 506-need based nutrition,-splits and time of nutrients application
Fsc 506-need based nutrition,-splits and time of nutrients applicationFsc 506-need based nutrition,-splits and time of nutrients application
Fsc 506-need based nutrition,-splits and time of nutrients application
 
ManureCompostComFertilizer_GalCoCropSch2006 ACP NCII.pdf
ManureCompostComFertilizer_GalCoCropSch2006 ACP NCII.pdfManureCompostComFertilizer_GalCoCropSch2006 ACP NCII.pdf
ManureCompostComFertilizer_GalCoCropSch2006 ACP NCII.pdf
 
Farmex
Farmex Farmex
Farmex
 
Home Gardening- Valuable Tips
Home Gardening- Valuable TipsHome Gardening- Valuable Tips
Home Gardening- Valuable Tips
 
Home gardening
Home gardeningHome gardening
Home gardening
 
Managing and Amending Soils for Productive Yields in High Tunnels, 2015
Managing and Amending Soils for Productive Yields in High Tunnels, 2015Managing and Amending Soils for Productive Yields in High Tunnels, 2015
Managing and Amending Soils for Productive Yields in High Tunnels, 2015
 
Lawn Appreciation - Fall Grass Seeding Presentation
Lawn Appreciation - Fall Grass Seeding PresentationLawn Appreciation - Fall Grass Seeding Presentation
Lawn Appreciation - Fall Grass Seeding Presentation
 
nutrient-management-of-corn.pptxSfklavFV
nutrient-management-of-corn.pptxSfklavFVnutrient-management-of-corn.pptxSfklavFV
nutrient-management-of-corn.pptxSfklavFV
 
Good Grass Guide.pdf
Good Grass Guide.pdfGood Grass Guide.pdf
Good Grass Guide.pdf
 
Nachurs srn
Nachurs srnNachurs srn
Nachurs srn
 

LIMS_doc_for_HORT_PRODUCTS

  • 1. DOCUMENTATION OF LIMS FOR HORTICULTURE PRODUCTS. PREPARED BY – RAHUL SINGH 2015
  • 2. HORT PRODUCTS TABLE DESCRIPTION AND DEFINITION Horticulture product used the same CLIENT_DETAILS tables for storing the data of the clients. Horticulture products has a number of table to store soil sample info, fertility test results, CEC test results, the recommendation value storage table , crop code table, test code table, tables which stores suggestions and table that store comments. Below are the table definitions and creation code to better understand the structures.  HORT_COMMENTS ------------------------------------ This table contains the comments which are used inreports to give suggestions or recommendations. CREATE TABLE "HR"."HORT_COMMENTS" ( "NAME" VARCHAR2(100 BYTE), "COMMENTS" VARCHAR2(2000 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" ; DATA. NAME COMMENTS MULTIPLE CROPS Please note: recommendations are based on the assumption that the sample was obtained from the appropriate depth range. For new and existing lawns, samples should be taken to a depth of 3 inches below the sod, without including the sod plug. For flowers, vegetables, and small fruits, samples should be taken from the "plow layer" (0" to 6"). For trees and shrubs, the samples should be taken to a depth of 12". Multiple recommendations from a single sample may not be accurate, as the sample depth for one or more of the requested crops is inaccurate. ATHLETIC TURF NOTE: we are unable to provide more specific recommendations for athletic turf without more detailed information from the client (soil type, sample depth). It is also helpful to know the intended usage. NON-FERTILITY SOIL ANALYSIS (CHEMICAL CARRYOVER, ETC.) NOTE: chemical contamination analyses are not offered at the ISU soil testing lab. You will need to submit a sample to a Commercial laboratory for any additional testing. A list
  • 3. of labs certified by the state can be found at the following website: http://www.agriculture.state.ia.us/feedandfertilizer.asp OUT OF STATE Please note: the recommendations shown here are based on Iowa climate and soils.We provide these recommendations as a guideline; however, we strongly recommend that you contact your extension service or a local horticultural expert for an interpretation more suited to your region. In the meantime, the chart below may serve as a guide for interpreting your results. NO CROP INFO Please note: There was no crop code indicated on the information sheet submitted with your samples, making it necessary for us to use a default crop code for garden. Mg As noted on the information sheet, Magnesium analysis on soil samples is reserved for samples where the requested recommendation is for vineyards (crop code #7). Part #11 of the instructions for taking horticulture samples states we will not make any interpretations of Mg results for any other crop. However, we have included the result(s) of the Mg analysis above. Commercial Garden NOTE: we are unable to provide more specific recommendations for commercial gardens without more detailed information from the client (soil type, sample depth). It is also helpful to know the intended crop(s).NOTE: the methods for analyzing garden soil used at ISU Soil & Plant Analysis Lab are designed to extract to extract different elements from naturally formed soils. They do not work well on potting mixes or soils that have been heavily amended with mulch, pearlite, vermiculite, peat, and other materials. EXCESS The soil test levels of your sample(s) are extremely high (see below), and continued fertilizer additions may be detrimental to plant growth. Research has shown that excessive nutrient Levels may cause a deficiency and/or toxicity of other essential nutrients. Apply no fertilizer, except nitrogen, to the garden area this year. Retest the soil in 3 to 4 years to check nutrient levels. Enclosed is a copy of Pm 820 for suggested nitrogen levels for your crops (see page six of Pm 820). EXISTING LAWNApply lawn fertilizer only when the grass blades are dry, and water thoroughly immediately after application. Do not exceed a nitrogen rate of 1 lb N/1000 sq. Ft. in any single application.For example, where 20 lbs of 20-15-5 is suggested the total N applied would be 4 lbs.This amount should be divided into four equal treatments over the growing season.Use a calibrated fertilizer spreader for best results. NEW LAWN Before seeding the new lawn, broadcast the fertilizer (and lime, if required) and incorporate it to a depth of 4 to 6 Inches. Additional fertilizer at a rate of 1 pound of nitrogen per 1,000 square feet should be applied to the lawn 3 to 4 weeks after germination, when the grass is 1 to 1½ inches tall.If grass is already growing, apply lawn fertilizer only when the grass blades are dry,and water thoroughly immediately after application. Do not exceed a nitrogen rate of 1 lb N/1000 sq. Ft. in any single application. For example, where 20 lbs of 20-15-5 is suggested the total N applied would be 4 lbs. This amount should be divided into four equal treatments over the growing season. Use a calibrated fertilizer spreader for best results. NUTRITION "Using the suggested complete garden fertilizer each year may result in excess phosphate and/or potash soil levels over time. Therefore, it is better to use the single nutrient sources, such as superphosphate (0-46-0 or 0-20-0) and muriate of potash (0-0-60) or sulfate of potash (0-0-50).These are available at most home lawn & garden centers.One-half of the fertilizer (and lime, if required) can be applied in the fall of the year and plowed or disked under, and the other half can be applied in early spring before planting starts. Or, if you prefer,the entire application can be made in the early spring as you are preparing the area for planting. Work the fertilizer well into the top 4 or 5 inches of soil by disking, raking, or rototilling.Add 2 to 3 pounds of actual nitrogen per 1,000 square feet when using the single phosphate and potash sources. Also, if the plants are showing poor growth or light green foliage add extra nitrogen by sidedressing along the row. Use one of the nitrogen sources listed below. Nitrogen Sources Lbs/100 feet of row Ammonium nitrate (34-0-0) 1/3 to 3/4
  • 4. Ammonium sulfate (21-0-0) 3/4 to 1-1/4 Urea (46-0-0) 1/4 to ½ Apply the lower amount to closely spaced rows, such as carrots, lettuce, etc.For a convenient measuring unit, 1 pint weighs approximately 1 pound." ALL For fruit trees, small fruits, broadleaf and evergreen trees and shrubs, apply fertilizer evenly on the ground before spring growth starts. For trees, apply the fertilizer uniformly under the canopy. Small fruit crops include strawberries, raspberries, and grapes. For June-bearing strawberries, sidedress the recommended fertilizer at renovation, immediately after harvest.For everbearing strawberries, raspberries and grapes, apply the recommended amount in early spring, before growth starts.For new fruit plantings, incorporate the fertilizer 4 to 6 inches into the soil prior to planting.The total nitrogen recommendation for these crops is 2 lbs/1,000 square Feet. Thus, if needed, supplement the suggested fertilizer with additional nitrogen using either ammonium nitrate, ammonium sulfate, or urea. LIME The lime application, if required, can be made anytime the land is not growing a crop, but it is important that it be worked into the soil by plowing, disking, etc. One-half the rate can be applied in the fall,and plowed or disked under, and the other half in the early spring as you prepare the land for planting. LIMEX A pH of 8.0 is extremely high indicating free calcium carbonate in the soil profile or excessive use of wood ashes. Micronutrient deficiencies, particularly zinc, iron, and manganese, may be a problem.Consider using 100 pounds of elemental sulfur per 1,000 square feet of sample area. Work the sulfur thoroughly into the top six inches of soil. For existing fruit, shade tree and shrub plantings,consider using a foliar micronutrient spray available at most garden centers. LIMING TURF Lime can be applied any time during the year with preference in the fall or spring. Lime also neutralizes soil acidity faster when applied in combination with coring, slicing, or dethatching. On established turf do not exceed 50 lbs/1000 sq. ft. in a single application. If needed, make repeat applications 3 to 6 months apart until the total lime requirement has been applied. LIME FOR SMALL FRUITS The lime application is intended to raise the soil pH to 7.0, or neutral. Some crops require a soil pH that is either more basic or more acidic, and the lime recommendation should be adjusted accordingly. These content of this table are fixed comments but it can be edited accordingly.  HORT_CROP_DETAILS This table contains all the crop details. CREATE TABLE "HR"."HORT_CROP_DETAILS" ( "CROP_CODE" NUMBER(2,0) NOT NULL ENABLE, "CROP_NAME" VARCHAR2(30 BYTE), "SAMPLE_DEPTH" NUMBER(3,0), CONSTRAINT "HORT_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
  • 5. 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" ; DATA Crop_code crop_name sample depth 1 Vegetable and/or flower garden 6 2 Existing lawn (>2 years old) 3 3 New lawn (new seeding or sod) 3 4 Small fruit planting 6 5 Tree fruit planting 12 6 Shade tree and/or shrub plant 12 7 Vineyards 12 8 Commercial gardens 6 9 Athletic turf 3  HORT_SOIL_FERT_SAMPLE_INFO This table contains all the sample info for fertility test as well as the CEC test. CREATE TABLE "HR"."HORT_SOIL_FERT_SAMPLE_INFO" ( "CLIENT_ID" NUMBER(6,0), "CLIENT_SAMPLE_ID" VARCHAR2(20 BYTE), "LAB_ID" NUMBER(7,0) NOT NULL ENABLE, "DOS" DATE, "CROP_CODE" NUMBER(3,0), "TEST_SERIES_CODE" NUMBER(2,0), "SOIL_TYPE" VARCHAR2(50 BYTE),
  • 6. "SAMPLE_DEPTH" NUMBER(3,0), "COMMENTS" VARCHAR2(1000 BYTE), CONSTRAINT "HORT_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" ;  HORT_SOIL_TEST_SERIES_CODE This table contains all the test codes for the horticulture product. CREATE TABLE "HR"."HORT_SOIL_TEST_SERIES_CODE" ( "TEST_CODE" NUMBER(2,0) NOT NULL ENABLE, "TESTS" VARCHAR2(45 BYTE), "RATES" NUMBER(3,0), CONSTRAINT "HORT_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" ;
  • 7. DATA Test code tests rates 7 CEC 1 Dry soil K and P, pH and lime 9 2 Dry soil K and P, pH, lime and OM 12 3 Dry soil K and P, pH, lime and Zn 13 4 Dry soil K and P, pH, lime, OM and Zn 15 5 pH and lime 8 6 Dry soil K and P, pH, lime, OM, Zn and Mg 16  HORT_SOIL_FERT_TEST_RESULTS This table contains all the soil fertility test results that we get from the lab and also contains the recommendation given to the client based on the values. CREATE TABLE "HR"."HORT_SOIL_FERT_TEST_RESULTS" ( "CLIENT_SAMPLE_ID" VARCHAR2(20 BYTE), "LAB_ID" NUMBER(7,0) NOT NULL ENABLE, "DOR" DATE, "CLIENT_ID" NUMBER(6,0), "FIRST_NAME" VARCHAR2(50 BYTE), "LAST_NAME" VARCHAR2(50 BYTE), "CROP_CODE" NUMBER(3,0), "TILLAGE_DEPTH" NUMBER(3,0), "K" NUMBER(7,2), "P" NUMBER(7,2), "PH" NUMBER(7,3), "OM" NUMBER(6,3), "ZN" NUMBER(7,2),
  • 8. "BPH" NUMBER(7,2), "MG" NUMBER(7,2), "FE" NUMBER(7,2), "S" NUMBER(7,2), "P_REC" NUMBER(7,2), "K_REC" NUMBER(7,2), "LIME_REC" NUMBER(7,2), "ZN_REC" NUMBER(7,2), "SUGGESTIONS" VARCHAR2(150 BYTE), "COMMENTS1" VARCHAR2(2000 BYTE), "COMMENTS2" VARCHAR2(2000 BYTE), "COMMENTS3" VARCHAR2(2000 BYTE), "COMMENTS4" VARCHAR2(2000 BYTE), "COMMENTS5" VARCHAR2(2000 BYTE), "COMMENTS6" VARCHAR2(2000 BYTE), "COMMENTS7" VARCHAR2(2000 BYTE), "COMMENTS8" VARCHAR2(2000 BYTE), "COMMENTS9" VARCHAR2(2000 BYTE), "COMMENTS10" VARCHAR2(2000 BYTE), "TEST_CODE" VARCHAR2(3 BYTE), "B" NUMBER(7,2), "EC" NUMBER(7,2), "CA" NUMBER(7,2) ) 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" ;  HORT_SOIL_CEC_RESULTS This table contains all the test result values calculated in the lab and also stores the calculated value of CEC.
  • 9. CREATE TABLE "HR"."HORT_SOIL_CEC_RESULTS" ( "LAB_ID" NUMBER(7,0), "CLIENT_ID" NUMBER(7,0), "CLIENT_SAMPLE_ID" VARCHAR2(20 BYTE), "FIRST_NAME" VARCHAR2(50 BYTE), "LAST_NAME" VARCHAR2(50 BYTE), "DOR" DATE, "CROP_CODE" VARCHAR2(3 BYTE), "TEST_CODE" VARCHAR2(3 BYTE), "K" NUMBER(7,3), "CA" NUMBER(7,3), "NA" NUMBER(7,3), "MG" NUMBER(7,3), "AL" NUMBER(7,3), "H" NUMBER(7,3), "CEC" NUMBER(7,3), "PH" NUMBER(7,3), "CEC2" NUMBER(7,3), "A1" VARCHAR2(2000 BYTE), "A2" VARCHAR2(2000 BYTE), "TILLAGE_DEPTH" NUMBER, "A4" VARCHAR2(2000 BYTE), "A5" VARCHAR2(2000 BYTE), "A6" VARCHAR2(2000 BYTE), "A7" VARCHAR2(2000 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" ;
  • 10.  HORT_P_K_RANGES This table contains the data of all the ranges which are used to calculate the recommendations and suggestions based on the value of Phosphorus and Pottasium. CREATE TABLE "HR"."HORT_P_K_RANGES" ( "CROP_CODE" NUMBER(2,0) NOT NULL ENABLE, "P_MIN" NUMBER(3,0), "P_MAX" NUMBER(5,0), "PR" NUMBER(6,2), "K_MIN" NUMBER(3,0), "K_MAX" NUMBER(5,0), "KR" NUMBER(6,2) ) 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" ; DATA Crop code P_MIN P_MAX PR K_MIN K_MAX KR 1 0 7 7 0 43 8 1 8 14 6 44 84 6 1 15 19 3.5 85 124 3.5 1 20 29 2.5 125 187 2.5 1 30 49 1.5 188 249 1.5 1 50 10000 0 250 10000 0 2 0 5 2 0 40 2 2 6 10 1.5 41 175 1 2 11 20 1 176 10000 0
  • 11. 2 21 10000 0 3 0 5 3 0 40 2 3 6 10 2.5 41 175 1 3 11 20 2 176 10000 1 3 21 10000 0 4 0 7 3 0 43 2 4 8 14 2 44 83 1 4 15 29 1 84 124 0.5 4 30 10000 0 125 10000 0 5 0 7 3 0 43 2 5 8 14 2 44 83 1 5 15 29 1 84 124 0.5 5 30 10000 0 125 10000 0 6 0 7 3 0 43 2 6 8 14 2 44 83 1 6 15 29 1 84 124 0.5 6 30 10000 0 125 10000 0 These content of the table are fixed but the values can be edited as per requirement.  HORT_LE_REC This table contains the LE recommendation based on the values we get from the P-K ranges table. CREATE TABLE "HR"."HORT_LE_REC" ( "PR" NUMBER(6,2), "KR" NUMBER(6,2), "LE" 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)
  • 12. TABLESPACE "USERS" ; DATA PR KR LE 0 0 6 0 1 5 0 2 4 1 0 9 1 1 3 1 2 1 1.5 0 8 1.5 1 8 1.5 2 2 2 0 7 2 1 7 2 2 1 These content of the table are fixed but the values can be edited as per requirement.  HORT_LE_SUGGESTION This table contains the LE suggestions based on the values we get from the LE_REC table. CREATE TABLE "HR"."HORT_LE_SUGGESTION" ( "LE" NUMBER(3,0), "SUGGESTION" VARCHAR2(55 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" ; DATA LE SUGGESTION 1 SUGGEST 20 LBS OF 12-12-12
  • 13. 2 SUGGEST 15 LBS OF 12-12-12 3 SUGGEST 10 LBS OF 12-12-12 4 SUGGEST 4 LBS OF 0-0-50 5 SUGGEST 2 LBS OF 0-0-50 6 SUGGEST SEE PM 1057 FOR N NEEDS 7 SUGGEST 20 LBS OF 20-10-5 8 SUGGEST 25 LBS OF 10-6-4 9 SUGGEST 12 LBS OF 23-3-7 These content of the table are fixed but the values can be edited as per requirement.  HORT_SR_REC This table contains the SR recommendation based on the values we get from the P-K ranges table. CREATE TABLE "HR"."HORT_SR_REC" ( "PR" NUMBER(6,2), "KR" NUMBER(6,2), "SR" 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" ; DATA PR KR SR 0 0 6 0 1.5 5 0 2.5 4 0 3.5 3 0 6 2 0 8 1 1.5 0 28
  • 14. 1.5 1.5 27 1.5 2.5 23 1.5 3.5 4 1.5 6 2 1.5 8 1 2.5 0 25 2.5 1.5 24 2.5 2.5 23 2.5 3.5 22 2.5 6 21 2.5 8 20 3.5 0 19 3.5 1.5 18 3.5 2.5 17 3.5 3.5 17 3.5 6 16 3.5 8 15 6 0 14 6 1.5 13 6 2.5 10 6 3.5 9 6 6 12 6 8 8 7 0 11 7 1.5 10 7 2.5 9 7 3.5 9 7 6 8 7 8 7 These content of the table are fixed but the values can be edited as per requirement.  HORT_SR_SUGGESTION
  • 15. This table contains the SR suggestions based on the values we get from the SR_REC table. DATA SR SUGGESTION 0 0 6 0 1.5 5 0 2.5 4 0 3.5 3 0 6 2 0 8 1 1.5 0 28 1.5 1.5 27 1.5 2.5 23 1.5 3.5 4 1.5 6 2 1.5 8 1 2.5 0 25 2.5 1.5 24 2.5 2.5 23 2.5 3.5 22 2.5 6 21 2.5 8 20 3.5 0 19 3.5 1.5 18 3.5 2.5 17 3.5 3.5 17 3.5 6 16 3.5 8 15 6 0 14 6 1.5 13 6 2.5 10 6 3.5 9 6 6 12
  • 16. 6 8 8 7 0 11 7 1.5 10 7 2.5 9 7 3.5 9 7 6 8 7 8 7 These content of the table are fixed but the values can be edited as per requirement.  HORT_SRL_REC This table contains the SRL recommendation based on the values we get from the P-K ranges table. CREATE TABLE "HR"."HORT_SRL_REC" ( "PR" NUMBER(6,2), "KR" NUMBER(6,2), "SRL" 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" ; DATA PR KR SRL 0 0 4 0 1 2 0 2 1 2 0 7 2 1 7 2 2 1 2.5 0 6
  • 17. 2.5 1 6 2.5 2 1 3 0 5 3 1 5 3 2 3 These content of the table are fixed but the values can be edited as per requirement.  HORT_SRL_SUGGESTION This table contains the SRL suggestions based on the values we get from the SRL_REC table. DATA SRL SUGGESTION 1 SUGGEST 20 LBS OF 12-12-12 2 SUGGEST 10 LBS OF 12-12-12 3 SUGGEST 25 LBS OF 12-12-12 4 SUGGEST 12 LBS OF 23-7-7 5 SUGGEST 30 LBS OF 5-10-5 6 SUGGEST 25 LBS OF 5-10-5 7 SUGGEST 20 LBS OF 20-10-5 These content of the table are fixed but the values can be edited as per requirement.  HORT_TSF_REC This table contains the TSF recommendation based on the values we get from the P-K ranges table. CREATE TABLE "HR"."HORT_TSF_REC" ( "PR" NUMBER(6,2), "KR" NUMBER(6,2), "TSF" NUMBER(3,0) ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  • 18. 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" ; DATA PR KR TSF 0 0 15 0 0.5 14 0 1 13 0 2 12 1 0 11 1 0.5 3 1 1 10 1 2 9 2 0 8 2 0.5 7 2 1 2 2 2 6 3 0 5 3 0.5 4 3 1 4 3 2 1 These content of the table are fixed but the values can be edited as per requirement.  HORT_TSF_SUGGESTION This table contains the TSF suggestions based on the values we get from the TSF_REC table. CREATE TABLE "HR"."HORT_TSF_SUGGESTION" ( "TSF" NUMBER(3,0), "SUGGESTION" VARCHAR2(55 BYTE)
  • 19. ) 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" ; DATA TSF SUGGESTION 1 SUGGEST 20 LBS OF 12-12-12 2 SUGGEST 10 LBS OF 12-12-12 3 SUGGEST 5 LBS OF 12-12-12 4 SUGGEST 20 LBS OF 5-10-5 5 SUGGEST 4 LBS OF 18-46-0 6 SUGGEST 15 LBS OF 12-12-12 7 SUGGEST 10 LBS OF 5-10-5 8 SUGGEST 2 LBS OF 18-46-0 9 SUGGEST 10 LBS OF 10-6-4 PLUS 3 LBS OF 0-0-60 10 SUGGEST 10 LBS OF 10-6-4 PLUS 1 LB OF 0-0-61 11 SUGGEST 8 LBS OF 10-6-4 12 SUGGEST 4 LBS OF 0-0-60 13 SUGGEST 2 LBS OF 0-0-60 14 SUGGEST 1 LB OF 0-0-60 15 SUGGEST NO FERTILIZER RECOMMENDED These content of the table are fixed but the values can be edited as per requirement.  HORT_ZN_REC This table contains the ZN recommendation ranges. CREATE TABLE "HR"."HORT_ZN_REC" ( "ZN_MIN" NUMBER(6,2),
  • 20. "ZN_MAX" NUMBER(6,2), "ZN_REC" NUMBER(6,2) ) 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" ; DATA ZN_MIN ZN_MAX ZN_REC 0 0.7 0.2 0.8 1000 0
  • 21. Forms explanation 1. The main menu is the same as explained in the FARM PRODUCT explanations. 2. CLIENT SEARCH PAGE 1. NAME- HORT_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. 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 Link for home page Client search fields
  • 22. p_id paramlist; p_name varchar(20) := 'client_id'; begin --check if parameter already exists p_id := get_parameter_list(p_name); if id_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(:block6.text_item11)); new_form ('c:projHORT_SOILINFO_ENTRY.fmx',no_rollback,no_query_only,share_library_data,p_id); if not form_success then message('ERROR: Unable to open the form. '); raise form_trigger_failure; end if; exception when others then message('ERROR: Unable to create parameter list. ');
  • 23. raise form_trigger_failure; end; 1. 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. 2. 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. 3. Link for new user is MENU >HORTICULTURE> SOIL INFO ENTRY (N). 4. We can check for various client at a time and then enter the values of soil information for all the clients one-by-one. 5. 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); 6. 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. 7. We have to enter any value and press TAB and all fields are automatically filled. If user is not present tool gives appropriate message. 8. LOV – first name, last name, ID has a LOV attached with it where we can easily search for any user. 9. 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. 6. When these fields are clicked the LOV open automatically and we can choose any user. LOV
  • 24. 7. When we select any user from LOV or search from other text fields all the other fields are filled automatically. 8. To make the LOV we go through LOV wizard and then attach it with the required text fields. 9. These LOV are present on CLIENT_ID, CLIENT_FIRST_NAME, and CLIENT_LAST_NAME. 10. Phone_number- this field has a POST_TEXT-ITEM TRIGGER on it to search from the database if we search with phone number. BEGIN select client_id into :text_item11 from client_details where phone = :text_item9; select first_name into :text_item7 from client_details where phone = :text_item9; select last_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 when too_many_rows then message('Multiple value detected. Try different filters.'); when no_data_found then message('No matching records could be found in the database. try different filters.'); END; 11. This code will fill all the details in all the respective fields if data is present. 12. 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 select client_id into :text_item11 from client_details where email = :text_item10; select first_name into :text_item7 from client_details where email = :text_item10; select last_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;
  • 25. EXCEPTION when too_many_rows then message('Multiple value detected. Try different filters.'); when no_data_found then message('No matching records could be found in the database. try different filters.'); END; 13. When a user is found we have to press ENTER button to enter the next page for soil info entry. 14. New search – this button clears the form and we can do a new search. go_block('block2'); clear_block; 3. SOILINFO ENTRY PAGE(FOR EXISTING USERS) NAME – HORT_SOILINFO_ENTRY.FMX
  • 26. 1. This form is to enter the soil information given by the clients. 2. We get to this page from the HORT_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 into client_id text item :block7.client_id:= :parameter.ID; id1 :=:parameter.ID; --showing all the values in the respective text items. select first_name into :block7.first_name from CLIENT_DETAILS where client_id = id1; This frame is filled automatically and can be edited here. It takes the parameter from client search page and displaysall the informationabout the client. Soil sample info frame Saves anychanges done Takes back to client search pagefor newentryof soil info Saves corresponding record
  • 27. select last_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; select submitter_id into :block7.submitter_id from CLIENT_DETAILS where client_id = id1; select sub_first_name into :block7.sub_first_name from CLIENT_DETAILS where client_id = id1; select sub_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;
  • 28. 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 HORT_CLIENT_SEARCH page 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
  • 29. 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 HORT_CROP_DETAILS where crop_code =:text_item154; if b=0 then message('CROP CODE NOT RECOGNIZED'); raise form_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); else select crop_name into a from HORT_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); exception -- when NO_DATA_FOUND then -- message('CROP CODE NOT RECOGNIZED'); -- set_item_property('block60.TEXT_ITEM154', navigable,property_false); --when otherS then --message ('unexpected error'); when no_data_found then message ('CROP CODE NOT RECOGNIZED'); raise form_trigger_failure; when otherS then message ('unexpected error');
  • 30. raise form_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); END; 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 HORT_SOIL_TEST_SERIES_CODE where TEST_code =:text_item164; if b=0 then message('TEST CODE NOT RECOGNIZED'); raise form_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); else select TESTS into a from HORT_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 -- when NO_DATA_FOUND then
  • 31. -- message('CROP CODE NOT RECOGNIZED'); -- set_item_property('block60.TEXT_ITEM154', navigable,property_false); --when otherS then --message ('unexpected error'); when no_data_found then message ('TEST CODE NOT RECOGNIZED'); raise form_trigger_failure; when otherS then message ('unexpected error'); raise form_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); END; 1. These value are dynamically matched with the values in the HORT_CROP_DETAILS and HORT_SOIL_TEST_SERIES_CODE table . 2. These values can be edited from MENU >HORTICULTURE> EDIT VALUES tab. 3. All the rows except row 1 are disabled. 4. 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.HORT_SOIL_FERT_SAMPLE_INFO values(:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM 113,:BLOCK60.TEXT_ITEM154,:BLOCK60.TEXT_ITEM164,:BLOCK60.TEXT_ITEM8,:BLOCK60.TEXT_ITEM124 ,:BLOCK60.TEXT_ITEM343); commit; insert into HR.lab_id_tracker values(:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM 113);
  • 32. commit; SET_ITEM_PROPERTY ( 'BLOCK60.ITEM73',ENABLED ,PROPERTY_TRUE); --Set_item_property('BLOCK60.ITEM73',background_color,'r88g100b75'); 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_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.ITEM9',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); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM344',ENABLED ,PROPERTY_TRUE); GO_ITEM('BLOCK60.ITEM73'); --message('color'); END;
  • 33. 5. The DELETE button delete any information entered. DECLARE BEGIN DELETE FROM HR.HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID = :BLOCK60.TEXT_ITEM103; DELETE FROM HR.lab_id_tracker WHERE LAB_ID = :BLOCK60.TEXT_ITEM103; commit; GO_ITEM('BLOCK60.TEXT_ITEM62'); END; 6. 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.HORT_SOIL_FERT_SAMPLE_INFO values(:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM 121,:BLOCK60.TEXT_ITEM162,:BLOCK60.TEXT_ITEM172,:BLOCK60.ITEM16,:BLOCK60.TEXT_ITEM132,:BL OCK60.TEXT_ITEM351); commit; insert into HR.lab_id_tracker values(:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM 121); commit; go_BLOCK ('BLOCK60'); clear_block; GO_ITEM('BLOCK60.TEXT_ITEM62'); END; 7. BACK TO SEARCH button takes back to the client search page for entering new information. 8. new_form('C:projhort_client_search.fmx',no_rollback,no_query_only,share_library_data); 9. CLEAR FORM clears the form. declare begin
  • 34. GO_block('BLOCK7'); CLEAR_BLOCK(no_validate); GO_block('BLOCK60'); CLEAR_BLOCK(no_validate); message('d'); end; 4. SOIL INFO ENTRY PAGE(FOR NEW USERS) NAME- HORT_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 >HORTICULTURE>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;
  • 35. This code checks the maximum CLIENT_ID from CLIENT_DETAILS TABLE and adds 1 to generate new ID. 1. The client information frame is for entering the value of client details. 2. The text boxes have individual checks on them like: 3. Id – number only (auto) 4. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to FM999999999 5. Doc – sysdate(auto) can be changed (date of profile creation) SELECT to_date(sysdate,'dd-mon-yy') into :DOC FROM dual; 6. Zip – 5 digit number only 7. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to 99999 8. Phone – 10 digit number only 9. This is implemented by changing the FORMAT MASK property in PROPERTY PALLET to 9999999999 10. Email – in the format of ‘xyz@ab.com’ only 11. For this we have a POST_TEXT_ITEM trigger on EMAIL Text field.
  • 36. DECLARE v_email varchar2(100); v_length number(10); v_error varchar2(10):='OK'; v_rates number(5):=0; v_dots number(5):=0; v_spfound boolean; v_ret varchar2(100); BEGIN v_email := :email; v_length:=length(v_email); for i in 1..v_length loop if substr(v_email,i,1)='@' then ---counting @ v_rates:=v_rates+1; end if; if substr(v_email,i,1)='.' then ---counting dots v_dots:=v_dots+1; end if; end loop; --message (v_length); --if v_length = 0 then --goto exitif; if ascii(substr(v_email,1,1)) between 48 and 57 then v_error:='SN'; elsif ascii(substr(v_email,1,1)) not between 97 and 122 then
  • 37. v_error:='FS'; elsif v_rates =0 or v_dots = 0 then message ('Incomplete email address'); elsif not v_rates=1 or v_dots > 2 then v_error:='SE'; elsif v_dots =2 then if instr(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'; elsif instr(v_email,'@') not between instr(v_email,'.') and instr(v_email,'.',1,2) then v_error:='DFM'; end if; elsif v_dots=1 then if instr(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','Email verified','SE','Single Email Allowed','DFM','format not matched email@removed',
  • 38. 'SN','Starting Number found','FS','First Special Character found','FM','Wrong format email@removed') into v_ret from dual; message(v_ret); END; 12. Username and password for future use. Optional to fill it. 13. 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; 14. Soil information frame works same as the form in soil information entry form for existing users with several checks and automated data entry. 15. 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. 16. Crop details and test details display area for reference purpose. 17. When we click on the SOIL SAMPLE INFO FRAME We will get the client ID filled automatically. 18. For that purpose we have a Trigger on client ID text fields 19. :block60.text_item62 := :BLOCK7.CLIENT_ID; -- this copies the value from CLIENT_INFO FRAME - CLIENT_ID 20. 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. 21. While running the tool just pre tab as everything is done.
  • 39. 22. 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; 19. 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; 20. 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. 21. 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. 22. Both CROP_CODE and TEST_CODE fields have a POST_TEXT_ITEM trigger on them. 23. For CROP_CODE declare a varchar2(130); b number;
  • 40. begin set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); select count(crop_name) into b from HORT_CROP_DETAILS where crop_code =:text_item154; if b=0 then message('CROP CODE NOT RECOGNIZED'); raise form_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); else select crop_name into a from HORT_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); exception -- when NO_DATA_FOUND then -- message('CROP CODE NOT RECOGNIZED'); -- set_item_property('block60.TEXT_ITEM154', navigable,property_false); --when otherS then --message ('unexpected error'); when no_data_found then message ('CROP CODE NOT RECOGNIZED'); raise form_trigger_failure; when otherS then message ('unexpected error'); raise form_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM154', item_is_valid, property_true); END;
  • 41. 24. 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 HORT_SOIL_TEST_SERIES_CODE where TEST_code =:text_item164; if b=0 then message('TEST CODE NOT RECOGNIZED'); raise form_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); else select TESTS into a from HORT_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 -- when NO_DATA_FOUND then -- message('CROP CODE NOT RECOGNIZED'); -- set_item_property('block60.TEXT_ITEM154', navigable,property_false);
  • 42. --when otherS then --message ('unexpected error'); when no_data_found then message ('TEST CODE NOT RECOGNIZED'); raise form_trigger_failure; when otherS then message ('unexpected error'); raise form_trigger_failure; set_item_property('BLOCK60.TEXT_ITEM164', item_is_valid, property_true); END; 10. These value are dynamically matched with the values in the HORT_CROP_DETAILS and HORT_SOIL_TEST_SERIES_CODE table . 11. These values can be edited from MENU >HORTICULTURE> EDIT VALUES tab. 12. All the rows except row 1 are disabled. 13. 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.HORT_SOIL_FERT_SAMPLE_INFO values(:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM 113,:BLOCK60.TEXT_ITEM154,:BLOCK60.TEXT_ITEM164,:BLOCK60.TEXT_ITEM8,:BLOCK60.TEXT_ITEM124 ,:BLOCK60.TEXT_ITEM343); commit; insert into HR.lab_id_tracker values(:BLOCK60.TEXT_ITEM103,:BLOCK60.TEXT_ITEM62,:BLOCK60.TEXT_ITEM83,:BLOCK60.TEXT_ITEM 113); commit; SET_ITEM_PROPERTY ( 'BLOCK60.ITEM73',ENABLED ,PROPERTY_TRUE);
  • 43. --Set_item_property('BLOCK60.ITEM73',background_color,'r88g100b75'); 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_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.ITEM9',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); SET_ITEM_PROPERTY ( 'BLOCK60.text_ITEM344',ENABLED ,PROPERTY_TRUE); GO_ITEM('BLOCK60.ITEM73'); --message('color'); END; 14. The DELETE button delete any information entered. DECLARE BEGIN
  • 44. DELETE FROM HR.HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID = :BLOCK60.TEXT_ITEM103; DELETE FROM HR.lab_id_tracker WHERE LAB_ID = :BLOCK60.TEXT_ITEM103; commit; GO_ITEM('BLOCK60.TEXT_ITEM62'); END; 15. 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.HORT_SOIL_FERT_SAMPLE_INFO values(:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM 121,:BLOCK60.TEXT_ITEM162,:BLOCK60.TEXT_ITEM172,:BLOCK60.ITEM16,:BLOCK60.TEXT_ITEM132,:BL OCK60.TEXT_ITEM351); commit; insert into HR.lab_id_tracker values(:BLOCK60.TEXT_ITEM111,:BLOCK60.TEXT_ITEM80,:BLOCK60.TEXT_ITEM91,:BLOCK60.TEXT_ITEM 121); commit; go_BLOCK ('BLOCK60'); clear_block; GO_ITEM('BLOCK60.TEXT_ITEM62'); END; 16. BACK TO SEARCH button takes back to the client search page for entering new information. 17. new_form('C:projhort_client_search.fmx',no_rollback,no_query_only,share_library_data); 18. CLEAR FORM clears the form. declare begin GO_block('BLOCK7'); CLEAR_BLOCK(no_validate); GO_block('BLOCK60');
  • 45. CLEAR_BLOCK(no_validate); message('d'); end; SOIL FERTILITY TEST RESULTS GENERATION There are 2 kinds of tests in the horticulture section of the tool. 1. Fertility tests 2. CEC Both have the same features in the tool but different tests so these are kept in different forms in the tool. Both the forms can be accessed from the main menu under the TEST RESULTS tab. This section of the documents explains the fertility test results entry and the report generations for the fertility tests.
  • 46. NAME= HORT_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); OM1 NUMBER; P1 NUMBER; K1 NUMBER; Test information viewing frame. It is auto generated when a LAB ID is entered. Test result entry frame for entering the values we getfrom lab tests. After entering the values press this button to generate the recommendations Auto generated recommendation from calculations based on the lab test values Takes to the report generation form to generate reports. Additional comments for special scenarios
  • 47. ZN1 NUMBER; PH1 NUMBER; BPH1 NUMBER; MG1 NUMBER; FE1 NUMBER; S1 NUMBER; T1 NUMBER; SD1 NUMBER; CC1 NUMBER; B1 NUMBER; EC1 NUMBER; CA1 NUMBER; begin select client_id into :client_id from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; select CLIENT_SAMPLE_ID into :CLIENT_SAMPLE_ID from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; select first_name into :first_name from client_details where client_id= :client_id; select last_name into :last_name from client_details where client_id= :client_id; select to_date(sysdate,'dd-mon-yy') into :dor from dual; select COUNT(TEST_SERIES_CODE) into T1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; IF T1=0 THEN NULL; ELSE select TEST_SERIES_CODE into :ITEM39 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; END IF; IF :item39 =7 THEN MESSAGE ('THIS SAMPLE IS FOR CEC TEST.'); END IF;
  • 48. select COUNT(SAMPLE_depth) into SD1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; IF SD1=0 THEN NULL; ELSE select SAMPLE_depth into :tillage_depth from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; END IF; select COUNT(crop_code) into CC1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; IF CC1=0 THEN NULL; ELSE select crop_code into :crop_code from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; END IF; select COUNT(OM) into OM1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF OM1=0 THEN NULL; ELSE select OM into :OM from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; END IF; select COUNT(P) into P1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF P1=0 THEN NULL; ELSE select P into :P from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; END IF; select COUNT(K) into K1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF K1=0 THEN NULL; ELSE select K into :K from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; END IF;
  • 49. select COUNT(ZN) into ZN1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF ZN1=0 THEN NULL; ELSE select ZN into :ZN from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; END IF; select COUNT(PH) into PH1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF PH1=0 THEN NULL; ELSE select PH into :PH from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; END IF; select COUNT(BPH) into BPH1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF BPH1=0 THEN NULL; ELSE select BPH into :BPH from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; END IF; select COUNT(MG) into MG1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF MG1=0 THEN NULL; ELSE select MG into :MG from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; END IF; select COUNT(FE) into FE1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF FE1=0 THEN NULL; ELSE select FE into :FE from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id;
  • 50. END IF; select COUNT(S) into S1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF S1=0 THEN NULL; ELSE select S into :S from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; END IF; select COUNT(B) into B1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF B1=0 THEN NULL; ELSE select B into :TEXT_ITEM44 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; END IF; select COUNT(EC) into EC1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF EC1=0 THEN NULL; ELSE select EC into :TEXT_ITEM45 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; END IF; select COUNT(CA) into CA1 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; IF CA1=0 THEN NULL; ELSE select CA into :TEXT_ITEM46 from HORT_SOIL_FERT_TEST_RESULTS where lab_id =:lab_id; END IF; select tests into test from HORT_SOIL_TEST_SERIES_CODE where test_code = :ITEM39; message (test); exception when NO_DATA_FOUND then
  • 51. message ('The value entered does not have any records present. Please recheck the Lab ID. '); end; 5. TEST RESULTS – this frame is for entering the values of the test results we receive from the lab. 6. Then press COMPUTE button to generate all the recommendation. And fill the next frame. 7. For this we have a WHEN_BUTTON_PRESSED trigger with the following code. DECLARE p1 number:=0; c number(3):=0; K1 NUMBER:=0; PR1 NUMBER; KR1 NUMBER; v_tillage_depth number:=0; SR1 NUMBER; SUGG1 VARCHAR(60); COMM1 VARCHAR2(2000); LE1 number; SRL1 NUMBER; TSF1 NUMBER; COMM2 VARCHAR2(2000); ZN1 NUMBER(6,2):=0; ZNR NUMBER(6,2):=0; BPH1 NUMBER(6,2):=0; LIME_REC1 NUMBER(6,3):=0; PH1 NUMBER(6,2):=0; BEGIN c:=:crop_code;
  • 52. v_tillage_depth :=:TILLAGE_DEPTH; P1:=nvl(:P,0); K1:=nvl(:K,0); PH1:=nvl(:PH,0); -- P AND K RECOMMENDATIONS, COMMENTS , LIME COMMENTS. -- FOR CROP CODE 1 OR NO CROP CODE. IF C IS NULL OR C=1 THEN select PR into PR1 from HORT_P_K_RANGES where crop_code = c and P_min<= P1 and P_MAX >= P1; select KR into KR1 from HORT_P_K_RANGES where crop_code = c and K_min<= K1 and K_MAX >= K1; :P_REC:=PR1; :K_REC:= KR1; select SR into SR1 from HORT_SR_REC where PR=PR1 and KR=KR1; SELECT SUGGESTION INTO SUGG1 FROM HORT_SR_SUGGESTION WHERE SR = SR1; :SUGGESTIONS:= SUGG1; IF SR1= 6 THEN SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'EXCESS'; :COMMENTS1:= COMM1; ELSE SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'NUTRITION'; :COMMENTS1:=COMM1; END IF; IF PH1>7.9 THEN SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIMEX'; :COMMENTS2 := COMM2;
  • 53. ELSE SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIME'; :COMMENTS2 := COMM2; END IF; -- FOR CROP CODE 2. ELSIF C=2 THEN select PR into PR1 from HORT_P_K_RANGES where crop_code = c and P_min<= P1 and P_MAX >= P1; select KR into KR1 from HORT_P_K_RANGES where crop_code = c and K_min<= K1 and K_MAX >= K1; :P_REC:=PR1; :K_REC:= KR1; select LE into LE1 from HORT_LE_REC where PR=PR1 and KR=KR1; SELECT SUGGESTION INTO SUGG1 FROM HORT_LE_SUGGESTION WHERE LE = LE1; :SUGGESTIONS:= SUGG1; SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'EXISTING LAWN'; :COMMENTS1:= COMM1; SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIMING TURF'; :COMMENTS2 := COMM2; -- FOR CROP CODE 3. ELSIF C=3 THEN select PR into PR1 from HORT_P_K_RANGES where crop_code = c and P_min<= P1 and P_MAX >= P1; select KR into KR1 from HORT_P_K_RANGES where crop_code = c and K_min<= K1 and K_MAX >= K1; :P_REC:=PR1; :K_REC:= KR1;
  • 54. select SRL into SRL1 from HORT_SRL_REC where PR=PR1 and KR=KR1; SELECT SUGGESTION INTO SUGG1 FROM HORT_SRL_SUGGESTION WHERE SRL = SRL1; :SUGGESTIONS:= SUGG1; SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'NEW LAWN'; :COMMENTS1:= COMM1; SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIMING TURF'; :COMMENTS2 := COMM2; -- FOR CROP CODE 4. ELSIF C=4 THEN select PR into PR1 from HORT_P_K_RANGES where crop_code = c and P_min<= P1 and P_MAX >= P1; select KR into KR1 from HORT_P_K_RANGES where crop_code = c and K_min<= K1 and K_MAX >= K1; :P_REC:=PR1; :K_REC:= KR1; select TSF into TSF1 from HORT_TSF_REC where PR=PR1 and KR=KR1; SELECT SUGGESTION INTO SUGG1 FROM HORT_TSF_SUGGESTION WHERE TSF = TSF1; :SUGGESTIONS:= SUGG1; IF TSF1= 15 THEN SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'EXCESS'; :COMMENTS1:= COMM1; ELSE SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'ALL'; :COMMENTS1:=COMM1; END IF;
  • 55. IF PH1>7.9 THEN SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIMEX'; :COMMENTS2 := COMM2; ELSE SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIME FOR SMALL FRUITS'; :COMMENTS2 := COMM2; END IF; -- FOR CROP CODE 5,6. ELSIF C=5 OR C=6 THEN select PR into PR1 from HORT_P_K_RANGES where crop_code = c and P_min<= P1 and P_MAX >= P1; select KR into KR1 from HORT_P_K_RANGES where crop_code = c and K_min<= K1 and K_MAX >= K1; :P_REC:=PR1; :K_REC:= KR1; select TSF into TSF1 from HORT_TSF_REC where PR=PR1 and KR=KR1; SELECT SUGGESTION INTO SUGG1 FROM HORT_TSF_SUGGESTION WHERE TSF = TSF1; :SUGGESTIONS:= SUGG1; IF TSF1= 15 THEN SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'EXCESS'; :COMMENTS1:= COMM1; ELSE SELECT COMMENTS INTO COMM1 FROM HORT_COMMENTS WHERE NAME= 'ALL'; :COMMENTS1:=COMM1; END IF; IF PH1>7.9 THEN
  • 56. SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIMEX'; :COMMENTS2 := COMM2; ELSE SELECT COMMENTS INTO COMM2 FROM HORT_COMMENTS WHERE NAME= 'LIME'; :COMMENTS2 := COMM2; END IF; ELSE MESSAGE('NO RECOMMENDATION PROVIDED BY SOIL AND PLANT ANALYSIS LAB.'); END IF; -- ZN RECOMMENDATIONS -- FOR ALL CROPS ZN1 := :ZN; if zn1 is null then :ZN_REC := 0; else select ZN_REC into ZNR from HORT_ZN_REC where ZN_MIN<= ZN1 and ZN_MAX >= ZN1; :ZN_REC := ZNR; end if; -- LIME RECOMMENDATIONS -- FOR ALL CROPS --CALCULATING FORMULA (7.0-BpH)*230 if ph1 is null then :LIME_REC:=0; :BPH := 0; elsIF PH1>6.9 THEN MESSAGE('pH IS GREATER THAN 6.9. BpH IS NOT TESTED.');
  • 57. :BPH := 0; ELSE BPH1:=:BPH; --message (bph1); IF BPH1 <=7.0 THEN LIME_REC1 :=(7.0-BPH1)* 230; :LIME_REC:=LIME_REC1; ELSE :LIME_REC:=0; END IF; END IF; END;
  • 58. 8. RECOMMENDATIONS – this frame shows all the recommendations generated by the system based on the calculations provided along with the comments. 9. Press SAVE button to save all information in the database.(important) 10. For this we have a WHEN_BUTTON_PRESSED Trigger with COMMIT_FORM; command. 11. CLEAR FORM – clears the form for a new entry based on different LAB ID. GO_BLOCK ('HORT_SOIL_FERT_TEST_RESULTS1'); CLEAR_BLOCK; GO_ITEM('LAB_ID'); 12. REPORT – takes to the report generation form to generate the reports based on individual client ID and the date when the results were entered. 13. For this we have a WHEN_BUTTON_PRESSED Trigger with new_form('c:projHORT_FERT_RESULT_REPORT.fmx',no_rollback,no_query_only,share_library_data); 14. The COMMENTS are auto generated as per the calculations but in some of the special cases we need to use the ADDITIONAL COMMENTS radio bar. The situations are written there and when the radio button are changed the system will save the required comments. 15. The special cases can be any one of the following – MULTIPLE CROPS in the soil sample information, ATHELETIC TURF as the crop code, NON FERTILITY TEST requested, OUT OF STATE soil samples, NO CROP INFO provided, MG test requested, COMMERCIAL GARDEN crop requested. SOIL CEC TEST RESULTS GENERATION NAME= HORT_CEC_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.
  • 59. 2. 3. MENU BAR AND THE HEADER are same as all the other forms. 4. CLIENT 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. 5. For this we have a POST_TEXT_ITEM Trigger on LAB ID text field. declare test varchar2(70); NA1 NUMBER; P1 NUMBER; K1 NUMBER; CA1 NUMBER; PH1 NUMBER; BPH1 NUMBER; CLIENT AND TEST INFORMATION LAB TEST RESULTS
  • 60. MG1 NUMBER; H1 NUMBER; AL1 NUMBER; T1 NUMBER; SD1 NUMBER; CC1 NUMBER; begin select client_id into :client_id from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; select CLIENT_SAMPLE_ID into :CLIENT_SAMPLE_ID from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; select first_name into :first_name from client_details where client_id= :client_id; select last_name into :last_name from client_details where client_id= :client_id; select to_date(sysdate,'dd-mon-yy') into :dor from dual; select COUNT(TEST_SERIES_CODE) into T1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; IF T1=0 THEN NULL; ELSE select TEST_SERIES_CODE into :TEST_CODE from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; END IF; IF :TEST_CODE <>7 THEN MESSAGE ('THIS SAMPLE IS NOT FOR CEC TEST.'); END IF; select COUNT(SAMPLE_depth) into SD1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; IF SD1=0 THEN NULL; ELSE select SAMPLE_depth into :ITEM14 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; END IF; select COUNT(crop_code) into CC1 from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id;
  • 61. IF CC1=0 THEN NULL; ELSE select crop_code into :crop_code from HORT_SOIL_FERT_SAMPLE_INFO where lab_id =:lab_id; END IF; ---ALREADY LOADED RESULTS select COUNT(K) into K1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; IF K1=0 THEN NULL; ELSE select K into :K from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; END IF; select COUNT(CA) into CA1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; IF CA1=0 THEN NULL; ELSE select CA into :CA from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; END IF; select COUNT(NA) into NA1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; IF NA1=0 THEN NULL; ELSE select NA into :NA from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; END IF; select COUNT(PH) into PH1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; IF PH1=0 THEN NULL; ELSE select PH into :PH from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; END IF;
  • 62. select COUNT(MG) into MG1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; IF MG1=0 THEN NULL; ELSE select MG into :MG from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; END IF; select COUNT(H) into H1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; IF H1=0 THEN NULL; ELSE select H into :H from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; END IF; select COUNT(AL) into AL1 from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; IF AL1=0 THEN NULL; ELSE select AL into :AL from HORT_SOIL_CEC_RESULTS where lab_id =:lab_id; END IF; select tests into test from HORT_SOIL_TEST_SERIES_CODE where test_code = :ITEM14; message (test); EXCEPTION when NO_DATA_FOUND then message ('The value entered does not have any records present. Please recheck the Lab ID. '); end; 16. TEST RESULTS – this frame is for entering the values of the test results we receive from the lab. 17. Then press COMPUTE button to generate all the recommendation. And fill the next frame.
  • 63. 18. For this we have a WHEN_BUTTON_PRESSED trigger with the following code. DECLARE A NUMBER; K NUMBER(7,3); CA NUMBER(7,3); NA NUMBER(7,3); MG NUMBER(7,3); AL NUMBER(7,3); H NUMBER(7,3); K2 NUMBER(7,3); CA2 NUMBER(7,3); NA2 NUMBER(7,3); MG2 NUMBER(7,3); AL2 NUMBER(7,3); H2 NUMBER(7,3); BEGIN k :=NVL(:K,0); CA :=NVL(:CA,0); NA :=NVL(:NA,0); MG :=NVL(:MG,0); AL :=NVL(:AL,0); H :=NVL(:H,0); K2 := K/39; CA2:= CA/20; NA2:= NA/23; AL2:= AL/8.9; MG2:= MG/12;
  • 64. IF :PH <5.5 THEN :CEC := k2+CA2+NA2+MG2+AL2+H; ELSE :CEC := k2+CA2+NA2+MG2; END IF; END; HORTICULTURE TEST RESULTS REPORT GENERATION NAME – HORT_FERT_RESULT_REPORT.FMX Report -HORT_RESULT_REPORT_NOR.RDF HORT_RESULT_REPORT_MG_EC.RDF HORT_RESULT_REPORT_MG_EC_CEC2.RDF HORT_RESULT_REPORT.RDF HORT_CEC_RESULT_REPORT.RDF This is a form from which will generate and call the results report in pdf format. The report is generated for each client based on the LAB_ID. Button to call report
  • 65. This page comes from the main menu under the REPORTS section >HORTICULTURE PRODUCT>FERT TEST RESULTS. 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. There are 5 different kinds of reports in the fertility section. We have so many kinds because the requirement was to call the reports with inly the relevant fields included. 14. There are several scenarios for calling the reports. We have 3 sections of tests included in the test results. a. K, P, PH, BPH, OM,ZN (NORMAL) b. MG, FE, S, B, EC (ADDITIONAL TESTS) c. K, CA, NA, MG, AL, H, CEC (CEC TESTS) 15. There are different combination of reports which includes these fields. a. Only normal fields ---- HORT_RESULT_REPORT_NOR.RDF b. Normal fields + additional tests ------ HORT_RESULT_REPORT_MG_EC.RDF c. Normal + CEC ------- HORT_RESULT_REPORT.RDF d. Normal + additional fields + CEC ----- HORT_RESULT_REPORT_MG_EC_CEC2.RDF
  • 66. e. Only CEC ------ HORT_CEC_RESULT_REPORT.RDF 16. The report calling code calculates and check which fields are present and which fields are completely NULL for all the given LAB_IDs. 17. 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; CC1 NUMBER:=0; J NUMBER:=0; CTR_MG NUMBER(7,3):=0; MG_VAR NUMBER(7,3):=0; K NUMBER:=0; CTR_FE NUMBER(7,3):=0; FE_VAR NUMBER(7,3):=0; L NUMBER:=0; CTR_S NUMBER(7,3):=0; S_VAR NUMBER(7,3):=0;
  • 67. M NUMBER:=0; CTR_B NUMBER(7,3):=0; B_VAR NUMBER(7,3):=0; N NUMBER:=0; CTR_EC NUMBER(7,3):=0; EC_VAR NUMBER(7,3):=0; Z NUMBER:=0; CTR_CA2 NUMBER(7,3):=0; CA2_VAR NUMBER(7,3):=0; MG_TOTAL NUMBER:=0; A1 NUMBER:=0; CTR_K NUMBER(7,3):=0; K_VAR NUMBER(7,3):=0; A2 NUMBER:=0; CTR_P NUMBER(7,3):=0; P_VAR NUMBER(7,3):=0; A3 NUMBER:=0; CTR_PH NUMBER(7,3):=0; PH_VAR NUMBER(7,3):=0; A4 NUMBER:=0; CTR_BPH NUMBER(7,3):=0; BPH_VAR NUMBER(7,3):=0; A5 NUMBER:=0; CTR_OM NUMBER(7,3):=0; OM_VAR NUMBER(7,3):=0; A6 NUMBER:=0; CTR_ZN NUMBER(7,3):=0; ZN_VAR NUMBER(7,3):=0;
  • 68. FERT_TOTAL NUMBER:=0; B1 NUMBER:=0; CTR_K2 NUMBER(7,3):=0; K2_VAR NUMBER(7,3):=0; B2 NUMBER:=0; CTR_CA NUMBER(7,3):=0; CA_VAR NUMBER(7,3):=0; B3 NUMBER:=0; CTR_NA NUMBER(7,3):=0; NA_VAR NUMBER(7,3):=0; B4 NUMBER:=0; CTR_MG2 NUMBER(7,3):=0; MG2_VAR NUMBER(7,3):=0; B5 NUMBER:=0; CTR_AL NUMBER(7,3):=0; AL_VAR NUMBER(7,3):=0; B6 NUMBER:=0; CTR_H NUMBER(7,3):=0; H_VAR NUMBER(7,3):=0; B7 NUMBER:=0; CTR_CEC NUMBER(7,3):=0; CEC_VAR NUMBER(7,3):=0; CEC_TOTAL NUMBER:=0; BEGIN --CODE FOR CHECKING IF ALL THE CLIENTS ARE SAME FOR ALL THE LAB ID GIVEN.
  • 69. L_ID :=:TEXT_ITEM5;--START_ID L_ID2 :=:TEXT_ITEM6;--END_ID LEN := L_ID2-L_ID; --SELECT CLIENT_ID INTO ID FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID; select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID ) ; FOR I IN 0 .. LEN LOOP SELECT CLIENT_ID INTO ID2 FROM (select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+I union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+I ); IF ID2<>ID THEN CTR:= CTR+1; END IF; ID2:=0; END LOOP; --MESSAGE(CTR); IF CTR>0 THEN MESSAGE('PLEASE CHECK THE LAB ID AS ALL THE CLIENTS ARE NOT SAME.'); GOTO ABC; END IF; --CHECKING FOR THE MG,FE,S, B,EC,CA TO CALL A DIFFERENT REPORT BASED ON THE DATA AVAILABLE IN THE MG, FE ETC.. FOR J IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+J; IF CC1 >= 1 AND CC1<=6 THEN
  • 70. SELECT MG INTO MG_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+J; IF MG_VAR IS NOT NULL THEN CTR_MG := CTR_MG+1; END IF; END IF; -- MG_VAR :=0; CC1 :=0; END LOOP; FOR I IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+I; IF CC1 >= 1 AND CC1<=6 THEN SELECT FE INTO FE_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+I; IF FE_VAR IS NOT NULL THEN CTR_FE := CTR_FE+1; END IF; END IF; -- FE_VAR :=0; CC1 :=0; END LOOP; FOR L IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+L; IF CC1 >= 1 AND CC1<=6 THEN SELECT S INTO S_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+L;
  • 71. IF S_VAR IS NOT NULL THEN CTR_S := CTR_S+1; END IF; END IF; -- S_VAR :=0; CC1 :=0; END LOOP; FOR M IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+M; IF CC1 >= 1 AND CC1<=6 THEN SELECT B INTO B_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+M; IF B_VAR IS NOT NULL THEN CTR_B := CTR_B+1; END IF; END IF; -- B_VAR :=0; CC1 :=0; END LOOP; FOR N IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+N; IF CC1 >= 1 AND CC1<=6 THEN SELECT EC INTO EC_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+N; IF EC_VAR IS NOT NULL THEN CTR_EC := CTR_EC+1; END IF; END IF;
  • 72. -- EC_VAR :=0; CC1 :=0; END LOOP; FOR Z IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+Z; IF CC1 >= 1 AND CC1<=6 THEN SELECT CA INTO CA2_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+Z; IF CA2_VAR IS NOT NULL THEN CTR_CA2 := CTR_CA2+1; END IF; END IF; -- EC_VAR :=0; CC1 :=0; END LOOP; --MESSAGE (CTR_MG|| ' ' ||CTR_FE||' ' ||CTR_S||' '||CTR_B||' '||CTR_EC); MG_TOTAL:= CTR_MG+CTR_FE +CTR_S +CTR_B +CTR_EC+CTR_CA; --MESSAGE (MG_TOTAL); FOR A1 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A1; IF CC1 >= 1 AND CC1<=6 THEN SELECT K INTO K_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A1; IF K_VAR IS NOT NULL THEN CTR_K := CTR_K+1; END IF; END IF; CC1 :=0;
  • 73. -- MG_VAR :=0; END LOOP; FOR A2 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A2; IF CC1 >= 1 AND CC1<=6 THEN SELECT P INTO P_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A2; IF P_VAR IS NOT NULL THEN CTR_P := CTR_P+1; END IF; END IF; CC1 :=0; -- FE_VAR :=0; END LOOP; FOR A3 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A3; IF CC1 >= 1 AND CC1<=6 THEN SELECT PH INTO PH_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A3; IF PH_VAR IS NOT NULL THEN CTR_PH := CTR_PH+1; END IF; END IF; CC1 :=0; -- S_VAR :=0; END LOOP;
  • 74. FOR A4 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A4; IF CC1 >= 1 AND CC1<=6 THEN SELECT BPH INTO BPH_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A4; IF BPH_VAR IS NOT NULL THEN CTR_BPH := CTR_BPH+1; END IF; END IF; CC1 :=0; -- B_VAR :=0; END LOOP; FOR A5 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A5; IF CC1 >= 1 AND CC1<=6 THEN SELECT OM INTO OM_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A5; IF OM_VAR IS NOT NULL THEN CTR_OM := CTR_OM+1; END IF; END IF; CC1 :=0; -- EC_VAR :=0; END LOOP; FOR A6 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+A6; IF CC1 >= 1 AND CC1<=6 THEN SELECT ZN INTO ZN_VAR FROM HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =L_ID+A6; IF ZN_VAR IS NOT NULL THEN CTR_ZN := CTR_ZN+1; END IF;
  • 75. END IF; CC1 :=0; -- EC_VAR :=0; END LOOP; FERT_TOTAL:= CTR_K+CTR_P +CTR_PH +CTR_BPH +CTR_OM+CTR_ZN; --MESSAGE (CTR_K|| ' ' ||CTR_P||' ' ||CTR_PH||' '||CTR_BPH||' '||CTR_OM||' '||CTR_ZN); --MESSAGE(FERT_TOTAL); FOR B1 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B1; IF CC1 =7 THEN SELECT K INTO K2_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B1; IF K2_VAR IS NOT NULL THEN CTR_K2 := CTR_K2+1; END IF; END IF; CC1 :=0; -- MG_VAR :=0; END LOOP; FOR B2 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B2; IF CC1 =7 THEN SELECT CA INTO CA_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B2; IF CA_VAR IS NOT NULL THEN CTR_CA := CTR_CA+1;
  • 76. END IF; END IF; CC1 :=0; -- FE_VAR :=0; END LOOP; FOR B3 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B3; IF CC1 =7 THEN SELECT NA INTO NA_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B3; IF NA_VAR IS NOT NULL THEN CTR_NA := CTR_NA+1; END IF; END IF; CC1 :=0; -- S_VAR :=0; END LOOP; FOR B4 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B4; IF CC1 =7 THEN SELECT MG INTO MG2_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B4; IF MG2_VAR IS NOT NULL THEN CTR_MG2 := CTR_MG2+1; END IF; END IF; CC1 :=0; -- B_VAR :=0; END LOOP;
  • 77. FOR B5 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B5; IF CC1 =7 THEN SELECT H INTO H_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B5; IF H_VAR IS NOT NULL THEN CTR_H := CTR_H+1; END IF; END IF; CC1 :=0; -- EC_VAR :=0; END LOOP; FOR B6 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B6; IF CC1 =7 THEN SELECT AL INTO AL_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B6; IF AL_VAR IS NOT NULL THEN CTR_AL := CTR_AL+1; END IF; END IF; CC1 :=0; -- EC_VAR :=0; END LOOP; FOR B7 IN 0 .. LEN LOOP SELECT TEST_SERIES_CODE INTO CC1 FROM HORT_SOIL_FERT_SAMPLE_INFO WHERE LAB_ID= L_ID+B7; IF CC1 =7 THEN SELECT CEC INTO CEC_VAR FROM HORT_SOIL_CEC_RESULTS WHERE LAB_ID =L_ID+B7; IF CEC_VAR IS NOT NULL THEN CTR_CEC := CTR_CEC+1;
  • 78. END IF; END IF; CC1 :=0; -- EC_VAR :=0; END LOOP; CEC_TOTAL:= CTR_K2+CTR_CA +CTR_NA +CTR_MG2 +CTR_AL+CTR_H+CTR_CEC; --MESSAGE (CTR_K2|| ' ' ||CTR_CA||' ' ||CTR_NA||' '||CTR_MG2||' '||CTR_AL||' '||CTR_H||' '||CTR_CEC); --MESSAGE(CEC_TOTAL); --FERT_TOTAL MG_TOTAL CEC_TOTAL -- CALLING ONLY NORMAL REPORT WITH K,P,PH,BPH,OM,ZN IF MG_TOTAL=0 AND CEC_TOTAL = 0 AND FERT_TOTAL>0 THEN 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:PROJhort_result_report_NOR.RDF');
  • 79. 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); 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 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; -- CALLING REPORT WITH K,P,PH,BPH,OM,ZN AND MG,FE,S,B,EC ELSIF MG_TOTAL>0 AND CEC_TOTAL = 0 AND FERT_TOTAL>0 THEN plid := Get_parameter_List('tmp'); IF NOT Id_Null(plid) THEN Destroy_parameter_List( plid ); END IF; plid := Create_parameter_List('tmp');
  • 80. 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:PROJhort_result_report_mg_ec.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); 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 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;
  • 81. -- CALLING REPORT WITH K,P,PH,BPH,OM,ZN AND MG,FE,S,B,EC AND CEC ELSIF MG_TOTAL>0 AND CEC_TOTAL > 0 AND FERT_TOTAL>0 THEN 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:PROJhort_result_report_mg_ec_CEC2.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); 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
  • 82. 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; -- CALLING REPORT WITH K, P, PH, BPH, OM, ZN AND CEC ELSIF MG_TOTAL=0 AND CEC_TOTAL > 0 AND FERT_TOTAL>0 THEN 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:PROJhort_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 STARTID='||:BLOCK2.TEXT_ITEM5||' ENDID='||:BLOCK2.TEXT_ITEM6); Str_Report_Server_Job := RUN_REPORT_OBJECT(repid);
  • 83. 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 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; -- CALLING REPORT WITH ONLY CEC ELSIF MG_TOTAL=0 AND CEC_TOTAL > 0 AND FERT_TOTAL=0 THEN 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:PROJHORT_CEC_RESULT_REPORT.RDF');
  • 84. 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); 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 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; ---- CALLING REPORT WITH K,P,PH,BPH,OM,ZN AND MG,FE,S,B,EC ELSIF MG_TOTAL>0 AND CEC_TOTAL = 0 AND FERT_TOTAL=0 THEN 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');
  • 85. 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:PROJhort_result_report_mg_ec.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); 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 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; ---- CALLING REPORT WITH K,P,PH,BPH,OM,ZN AND MG,FE,S,B,EC ELSIF MG_TOTAL>0 AND CEC_TOTAL > 0 AND FERT_TOTAL=0 THEN 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');
  • 86. 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:PROJhort_result_report_mg_ec_CEC2.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); 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 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; ELSE MESSAGE('THERE IS NO RESULT DATA FOR THESE LAB IDs.'); END IF; <<ABC>> NULL; EXCEPTION WHEN OTHERS THEN MESSAGE('PLEASE CHECK THE LAB ID AS NO DATA IS PRESENT FOR THESE IDs.'); END;
  • 87. Only normal fields ---- HORT_RESULT_REPORT_NOR.RDF
  • 88.
  • 89. Normal fields + additional tests ------ HORT_RESULT_REPORT_MG_EC.RDF
  • 90.
  • 91. Normal + CEC ------- HORT_RESULT_REPORT.RDF
  • 92.
  • 93. Normal + additional fields + CEC ----- HORT_RESULT_REPORT_MG_EC_CEC2.RDF
  • 94.
  • 95. Only CEC ------ HORT_CEC_RESULT_REPORT.RDF
  • 96. REPORT 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. 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_9. 10. CF_1- displays FIRST NAME function CF_1Formula return Char is fname varchar2(60); id number; id2 number; begin select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid ) ; select FIRST_NAME into fname from client_details where client_id = ID; return (fname); exception when no_data_found then select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid; select FIRST_NAME into fname from client_details where client_id = ID2; return (fname); end; 11. CF_2 – displays LAST NAME function CF_2Formula return Char is id number; id2 number; lname varchar2(60); begin
  • 97. select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid ) ; select lasT_NAME into lname from client_details where client_id = ID; return (lname); exception when NO_DATA_FOUND then select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid; select lasT_NAME into lname from client_details where client_id = ID2; return (lname); end; 12. CF_3 – displays ADDRESS function CF_3Formula return Char is addr varchar2(100); id number; id2 number; begin select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid ) ; select address into addr from client_details where client_id = ID; return (addr); exception when NO_DATA_FOUND then select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid; select address into addr from client_details where client_id = ID2; return (addr); end; 13. CF_4 – displays CITY function CF_4Formula return Char is vcity varchar2 (20); id number; id2 number; begin select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid ) ; select city into vcity from client_details where client_id = ID; return (vcity);
  • 98. exception when NO_DATA_FOUND then select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid; select city into vcity from client_details where client_id = ID2; return (vcity); end; 14. CF_5 – displays STATE function CF_5Formula return Char is id number; id2 number; vstate varchar2 (20); begin select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid ) ; select state into vstate from client_details where client_id = ID; return (vstate); exception when NO_DATA_FOUND then select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid; select state into vstate from client_details where client_id = ID2; return (vstate); end; 15. CF_6 – displays COUNTY function CF_6Formula return Char is id number; id2 number; vcounty varchar2 (27); begin select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid ) ; select county into vcounty from client_details where client_id = ID; return (vcounty); exception when NO_DATA_FOUND then select client_id into id2 from HR.HORT_SOIL_CEC_RESULTS where lab_id = :startid; select county into vcounty from client_details where client_id = ID2;
  • 99. return (vcounty); end; 16. CF_7 – displays ZIP function CF_7Formula return Number is id number; id2 number; vzip number (15); begin select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid ) ; select zip into vzip from client_details where client_id = ID; return (vzip); exception when NO_DATA_FOUND then select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid; select zip into vzip from client_details where client_id = ID2; return (vzip); end; 17. CF_8 – displays PHONE NUMBER function CF_8Formula return char is id number; id2 number; sfn varchar2(60); begin select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid ) ; select sub_first_name into sfn from client_details where client_id = ID; return (sfn); exception when NO_DATA_FOUND then select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid; select sub_first_name into sfn from client_details where client_id = ID2; return (sfn);
  • 100. end; 18. CF_9– displays submitter’s last name 19. function CF_9Formula return char is id number; id2 number; sln varchar2(60); begin select client_id into id from(select client_id from HORT_SOIL_FERT_TEST_RESULTS WHERE LAB_ID =:startid union select client_id from HORT_SOIL_CEC_RESULTS WHERE LAB_ID =:startid ) ; select sub_last_name into sln from client_details where client_id = ID; return (sln); exception when NO_DATA_FOUND then select client_id into id2 from HORT_SOIL_CEC_RESULTS where lab_id = :startid; select sub_last_name into sln from client_details where client_id = ID2; return (sln); WHEN OTHERS THEN RETURN 0; end; 20. Parent modules starts after these 2 parts. 21. In the different reports there are different numbers of repeating parent form. Normal + additional fields + CEC ----- HORT_RESULT_REPORT_MG_EC_CEC2.RDF 1. There are 13 data blocks used in this report to pull every needed details. The blocks are numbered Q_1 – Q-13. 2. There are 7 parent repeating sections in the report which uses the above mentioned data query blocks.
  • 101. 3. Q_1 is used by SOIL TEST RESULTS,RECOMMENDATIONS SELECT ALL HORT_SOIL_FERT_TEST_RESULTS.CLIENT_SAMPLE_ID, HORT_SOIL_FERT_TEST_RESULTS.LAB_ID, HORT_SOIL_FERT_TEST_RESULTS.K, HORT_SOIL_FERT_TEST_RESULTS.CROP_CODE, HORT_SOIL_FERT_TEST_RESULTS.P, HORT_SOIL_FERT_TEST_RESULTS.PH, HORT_SOIL_FERT_TEST_RESULTS.OM,
  • 102. HORT_SOIL_FERT_TEST_RESULTS.ZN, HORT_SOIL_FERT_TEST_RESULTS.BPH, HORT_SOIL_FERT_TEST_RESULTS.MG, HORT_SOIL_FERT_TEST_RESULTS.FE, HORT_SOIL_FERT_TEST_RESULTS.S, HORT_SOIL_FERT_TEST_RESULTS.P_REC, HORT_SOIL_FERT_TEST_RESULTS.K_REC, HORT_SOIL_FERT_TEST_RESULTS.LIME_REC, HORT_SOIL_FERT_TEST_RESULTS.ZN_REC, HORT_SOIL_FERT_TEST_RESULTS.B, HORT_SOIL_FERT_TEST_RESULTS.CA, HORT_SOIL_FERT_TEST_RESULTS.EC FROM HORT_SOIL_FERT_TEST_RESULTS WHERE (HORT_SOIL_FERT_TEST_RESULTS.LAB_ID> = :STARTID AND HORT_SOIL_FERT_TEST_RESULTS.LAB_ID< = :ENDID) ORDER BY LAB_ID; 4. Q_2 is used by SUGGESTIONS SELECT DISTINCT (HORT_SOIL_FERT_TEST_RESULTS.SUGGESTIONS) , HORT_SOIL_FERT_TEST_RESULTS.CROP_CODE, HORT_SOIL_FERT_TEST_RESULTS.LAB_ID FROM HORT_SOIL_FERT_TEST_RESULTS WHERE (HORT_SOIL_FERT_TEST_RESULTS.LAB_ID> = :STARTID AND HORT_SOIL_FERT_TEST_RESULTS.LAB_ID< = :ENDID) 5. Q_3 is used by COMMENTS SELECT DISTINCT(HORT_SOIL_FERT_TEST_RESULTS.COMMENTS1), CROP_CODE FROM HORT_SOIL_FERT_TEST_RESULTS where HORT_SOIL_FERT_TEST_RESULTS.LAB_ID >= :STARTID and HORT_SOIL_FERT_TEST_RESULTS.LAB_ID <= :ENDID ORDER BY CROP_CODE; 6. Q-4 is used by LIME COMMENTS SELECT DISTINCT(HORT_SOIL_FERT_TEST_RESULTS.COMMENTS2), CROP_CODE FROM HORT_SOIL_FERT_TEST_RESULTS where HORT_SOIL_FERT_TEST_RESULTS.LAB_ID >= :STARTID and HORT_SOIL_FERT_TEST_RESULTS.LAB_ID <= :ENDID ORDER BY CROP_CODE; 7. Q-5 is used by OTHER COMMENTS SELECT DISTINCT(HORT_SOIL_FERT_TEST_RESULTS.COMMENTS4) FROM HORT_SOIL_FERT_TEST_RESULTS where HORT_SOIL_FERT_TEST_RESULTS.LAB_ID >= :STARTID and HORT_SOIL_FERT_TEST_RESULTS.LAB_ID <= :ENDID; 8. Q-6 is used by OTHER COMMENTS SELECT DISTINCT(HORT_SOIL_FERT_TEST_RESULTS.COMMENTS5)