oracle - Pass parameter to SQL file from within another SQL file -
i thought sure there question on this, haven't been able find one.
i have 2 sql files, myfile1.sql
, myfile2.sql
. myfile1.sql
calls myfile2.sql
so:
-- in myfile1.sql: @scripts/myfile2
this works no problem, i'd pass argument file. i've tried doing following, no success (results in file not found exception):
@scripts/myfile2 'imanargument'
does know syntax this?
i'm guessing problem scripts/myfile2.sql
relative path script located in. if so, following path directory sql*plus started (the current working directory). if problem, it's not parameter issue, rather sql*plus can't find file. in case, should use @@
, invokes path relative file it's located in.
the parameter should work proposed (documentation). parameters provided when invoking file placed substitution variables (rather bind variables) , can referenced using ampersand followed argument number. in example, 'imanargument'
&1
.
Comments
Post a Comment