Neoview Guide to Stored Procedures in Java (R2.2)
• First SQL parameter:
— Name: qty
— Direction: IN
— SQL Data Type: NUMERIC
◦ Precision: 18
◦ Scale: 0
— Java Data Type: java.math.BigDecimal
• Second SQL parameter:
— Name: rate
— Direction: IN
— SQL Data Type: VARCHAR
◦ Length: 10
◦ Upshift: not selected
◦ Character set: ISO88591
— Java Data Type: java.lang.String
• Third SQL parameter:
— Name: price
— Direction: INOUT
— SQL Data Type: NUMERIC
◦ Precision: 18
◦ Scale: 2
— Java Data Type: java.math.BigDecimal[]
Parameters:
• Dynamic result sets: 0
• Accesses Database: not selected
Attributes:
Calling the Procedure: TOTALPRICE
To invoke the TOTALPRICE procedure in Neoview Script:
SQL>set param ?p 10;
SQL>call sales.totalprice(23, 'standard', ?p);
The TOTALPRICE procedure calculates the total price of a purchase and returns this output in
Neoview Script:
*** WARNING[11217] Java execution: Data overflow occurred while retrieving data
at parameter position 3. Value is truncated.
p
--------------------
253.96
--- SQL operation complete.
The total price of 23 items, which cost $10 each and which are shipped at the standard rate, is
$253.96, including sales tax.
Procedures in the SALES Schema 83