CREATE OR REPLACE PROCEDURE InsertIntoTemp AS
/* Declare variables to be used in this block. */
v_Num1 NUMBER := 5;
v_Num2 NUMBER := 6;
v_String1 VARCHAR2(50) := 'Hello World!';
v_String2 VARCHAR2(50) := '-- This message brought to you by PL/SQL!';
v_OutputStr VARCHAR2(50);
BEGIN
/* First, insert two rows into temp_table, using the values of the
variables. */
INSERT INTO temp_table (num_col, char_col)
VALUES (v_Num1, v_String1);
INSERT INTO temp_table (num_col, char_col)
VALUES (v_Num2, v_String2);
/* Now query temp_table for the two rows we just inserted, and output
them to the screen using the DBMS_OUTPUT package. */
SELECT char_col
INTO v_OutputStr
FROM temp_table
WHERE num_col = v_Num1;
DBMS_OUTPUT.PUT_LINE(v_OutputStr);
SELECT char_col
INTO v_OutputStr
FROM temp_table
WHERE num_col = v_Num2;
DBMS_OUTPUT.PUT_LINE(v_OutputStr);
END InsertIntoTemp;
/
/* Declare variables to be used in this block. */
v_Num1 NUMBER := 5;
v_Num2 NUMBER := 6;
v_String1 VARCHAR2(50) := 'Hello World!';
v_String2 VARCHAR2(50) := '-- This message brought to you by PL/SQL!';
v_OutputStr VARCHAR2(50);
BEGIN
/* First, insert two rows into temp_table, using the values of the
variables. */
INSERT INTO temp_table (num_col, char_col)
VALUES (v_Num1, v_String1);
INSERT INTO temp_table (num_col, char_col)
VALUES (v_Num2, v_String2);
/* Now query temp_table for the two rows we just inserted, and output
them to the screen using the DBMS_OUTPUT package. */
SELECT char_col
INTO v_OutputStr
FROM temp_table
WHERE num_col = v_Num1;
DBMS_OUTPUT.PUT_LINE(v_OutputStr);
SELECT char_col
INTO v_OutputStr
FROM temp_table
WHERE num_col = v_Num2;
DBMS_OUTPUT.PUT_LINE(v_OutputStr);
END InsertIntoTemp;
/
as
--定义部分;
begin
--语句部分;
--例外部分;
end;
/
country_oneself (provincecode in number,goodstype in number,goodsname in number,date in varchar2)
as
selldate varchar2(20);
provincename varchar2(20);
goodslabel varchar2(20);
sellcount number(8);
begin
/*怎么写*/
end country_oneself
这里面provincecode,goodsname这二个参数一次从前端传过来,可能是多值。比如说provincecode,是01,02,06,05.而goodsname可能也是这样的。你说这样存储过程怎么写?