Created
June 28, 2012 00:19
-
-
Save adamcrown/3007807 to your computer and use it in GitHub Desktop.
Printing the results of an Oracle function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Must me NUMBER or CHAR if you want to print it. Printing a VARCHAR is too complex for expensive databases like Oracle. | |
VARIABLE r CHAR (1000); | |
BEGIN | |
-- := is for assignment. vs = for equality | |
-- bind variables are prefixed with a colon | |
-- BANIST1 is the instance | |
-- BSK_INFO_REQUEST is the package | |
-- get_prel_codes() is the function | |
:r := BANINST1.BSK_INFO_REQUEST.get_prel_codes(); | |
END; | |
-- I don't know what this does. Stupid Oracle. | |
. | |
-- I guess this runs everything above. | |
run; | |
-- And now we can finally print the results we wanted. | |
-- Why can't you just do PRINT BANINST1.BSK_INFO_REQUEST.get_prel_codes();? Because it's Oracle and it's too expensive for that sort of simplicity. | |
PRINT :r; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment