|
Java Examples for ASE 12.5 |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Routines1
A class with two methods for simple SQL create function and create procedure examples.
Constructor Summary | |
Routines1()
|
Method Summary | |
static void |
correctStates(java.lang.String oldSpelling,
java.lang.String newSpelling)
A method that updates the "salesemp" table to correct the spelling of a given state. |
static int |
region(java.lang.String s)
A method that returns a code for the geographic region of a given state. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Routines1()
Method Detail |
public static int region(java.lang.String s) throws java.sql.SQLException
This method is intended for use with an SQLJ create function such as the following:
create function regionof(state char(20)) returns integer language java parameter style java external name 'Routines1.region(java.lang.String)'
That SQLJ function "regionof" would be called in SQL as follows:
select name, dbo.regionof(state) as region from salesemps where dbo.regionof(state)=3
s
- the given state abbreviationpublic static void correctStates(java.lang.String oldSpelling, java.lang.String newSpelling) throws java.sql.SQLException
This method is intended for use with an SQLJ create procedure such as the following:
create procedure correctstates(old char(20), notold char(20)) modifies sql data language java parameter style java external name 'Routines1.correctStates(java.lang.String java.lang.String)'
That SQLJ procedure 'correctstates' would be called in SQL as follows:
execute correctstates 'GEO', 'GA'
oldSpelling
- the incorrect spelling, e.g. "Calif"newSpelling
- the correct spelling, e.g. "CA"
|
Java Examples for ASE 12.5 |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |