Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing values to an Oracle Function

Status
Not open for further replies.

MWToine

Programmer
Aug 20, 2009
4
US
Can anyone help?

We're trying to create a log so that we can know what reports are being used, when, and by whom.

We've created a table in Oracle and a function that receives the report name as a string. In Crystal 8.5, we are attempting to call that function via a SQL expression.
We see that the function is recognized because if we do not include a value to pass, the error indicates that the rignt number of arguments are not met.

However, we've tried every way to pass the argument by removing all quotes, various single and double quote methods and nothing works.

Can anyone help? It would be greatly appreciated!
 
Please show the actual syntax/punctuation you have tried.

-LB
 
Thanks for the f/u LB. I've tried the following:

PKGMONUTIL.LOG_REPORT ( 'NOW IS THE TIME' )
PKGMONUTIL.LOG_REPORT('NOWTIME')
PKGMONUTIL.LOG_REPORT(''NOW IS THE TIME'')
PKGMONUTIL.LOG_REPORT('''NOW IS THE TIME''')
PKGMONUTIL.LOG_REPORT('"NOW IS THE TIME"')
PKGMONUTIL.LOG_REPORT(['NOW IS THE TIME'])
PKGMONUTIL.LOG_REPORT 'NOW IS THE TIME'
PKGMONUTIL.LOG_REPORT "NOW IS THE TIME"
PKGMONUTIL.LOG_REPORT ''NOW IS THE TIME''
PKGMONUTIL.LOG_REPORT '''NOW IS THE TIME'''
(PKGMONUTIL.LOG_REPORT ( 'NOW IS THE TIME' ))
SELECT LOG_REPORT ( 'NOW IS THE TIME' ) INTO RETVAL FROM DUAL
(SELECT LOG_REPORT ( 'NOW IS THE TIME' ) INTO RETVAL FROM DUAL)
(SELECT LOG_REPORT ( 'NOW IS THE TIME' ) FROM DUAL)
 
LB - The problem was in the Package design. I've solved this part.

Thanks for the time!
 
Since I'm not familiar with custom functions, I'm not sure I can help. Ordinarily in SQL expressions you would enclose a select statement in parens, and in Oracle, enclose table and field names in double quotes, so the last one looks closest to something workable to me. I'm not sure how you would write the custom function though. Functions are often written like this {fn functionname()}, so you might want to try:

(
SELECT {fn LOG_REPORT('NOW IS THE TIME')} FROM DUAL
)

Just a guess. Please let us know if you find a solution.

-LG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top