Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
228 views
in Technique[技术] by (71.8m points)

I have a problem with oracle sql developer include of a with function not working

I have a file containing a WITH FUNCTION. Because of security limitations, I can not place the function into the database, so I am using the excellent WITH FUNCTION syntax to get around that limitation.

I have tried to include the function (starting with the WITH) in a SQL DEVELOPER CALL Using:

@x:fldr1fldr2WITH_FUNCTION.sql
SELECT WITH_FUNCTION(arg) FROM DUAL;

I get an error message that function is bad, even though if I copy the body of the function in the calling window it works fine.

I have tried removing the WITH in the included file and putting it into the calling window:

WITH
@x:fldr1fldr2WITH_FUNCTION.sql
SELECT WITH_FUNCTION(arg) FROM DUAL;

Get a WITH syntax error message, What magic is required to make this work?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You didn't post contents of the .sql file, but - if it contains a function, you can't use it as you planned to.

I suggest you write the whole query, store it into the .sql file and run it in SQL Developer as

@with_function.sql

The result will be displayed in the "Script output" window.


Or, maybe simpler / even better, copy/paste contents of the .sql file into SQL Developer and run it there as if you wrote it right now.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...