-
There are three parameters in Oracle, which are in, in out, and out
The actual parameters corresponding to the parameters of the form with the mode in can be constants or variables.
The actual parameter corresponding to the parameter of the pattern in out or out must be a variable that stores the returned value, so it cannot be a constant or an expression.
Procedure calls with parameters.
Positional notation.
When calling, all parameters are added, and the actual participating parameters correspond to each other in order.
Name notation.
When called, the parameter name is given, and the argument is given.
procname(12,p_outparm=>v_var1,p_inout=>10);
For example, the script content is as follows:
create or replace function fun_test(p_id ,p_age out number)
Create a function with two arguments, one in and one out by default
return varchar2 -- return value of type varchar2
isv_name varchar2(20);- Define a variable.
beginselect nvl(name,'null'),to_number(round((sysdate-birthdate)/365),'999')
into v_name,p_age from account
where id=p_id;
Query the name and age of an account, and put the result to v name, p age
exception -- Custom exception handling.
when no data found then -- If the corresponding data cannot be found through the pass in p id, perform the following process.
v_name:='null';
p_age:=0;
return v_name;
end;Execute the following command to output the return value of the function.
exec dbms_,:a_out));
-
d: When the script is executed as follows, pass the parameter like SQLPLUS"scott/tiger@test" @d:
sysdate dual Note: The parameter must be represented by &[1-9], otherwise it will not be passed, and it will prompt you to manually enter the parameter [sql] view plaincopy c: >sqlpl....
-
For example, my sql script is: This script has the following tasks: create a database, create **, insert data, and so on.
I'm going to call this script in c to execute it, and I'm going to have parameters passed in to the script.
How to help, the two upstairs said that it is operated in the script, I don't need this.
-
Variables are used in sh with $1, $2, $3....The order represents the parameters passed in.
SQL Writing:
select dept_id,dept_name from department
where dept_id=$1
-
Is the script above in a shell, or a separate SQL file?
-
Dynamic statements are required.
For example: declare @参数 varchar(1000)set @参数='id=1'
print 'select * from table where'+@参数.
exec('select * from table where'+@参数.
-
There was a mistake in parentheses.
It should be "select * from category where catid =."" + categoryid ;
-
Stitch together the strings and try adding double quotation marks to the SQL statement you receive.
I think you should add breakpoints to debug and see if the string you received after passing it as an argument is correct.
-
It is estimated that it contains special characters (it seems to be a semicolon; Let's get rid of it)
-
In the Query Manager, create a new connection and paste the field that opens on the right.
Or just open it. sql file.
What are the methods of mosquito repellent?
Thank you for your trust in me.
I really don't know much about the field, I'm afraid I can't help you with this. Beijing charges a lot of money. Basically above 2000 months. It may be lower in the field. >>>More
I miss you Millennium Love Song Rainbow Try to listen to it and you will know if it sounds good or not.
1. **The test system can use the system's visual tool to add test questions, or you can use word, excel, and txt guide templates to add test questions in batches. It supports common question types such as multiple-choice questions, multiple-choice questions, fill-in-the-blank questions, true/false questions, and Q&A questions, as well as audio, **, ** and other types of test questions. >>>More
Zheng Zhihua. Sailors, star-lit lights, etc.