| |

VerySource

 Forgot password?
 Register
Search
View: 44|Reply: 37

I was in contact with ORCALE for the first time today.

[Copy link]

2

Threads

19

Posts

16

Credits

Newbie

Rank: 1

Credits
16

 China

Post time: 2020-1-21 16:00:01
| Show all posts |Read mode
Write a stored procedure that is too simple. There are many questions.
 CREATE OR REPLACE PROCEDURE TEST
(CODE IN CHAR)-Here I specified why CHAR cannot specify the length (VARCHAR seems to be the same): CHAR (2)?
AS
BEGIN
  DBMS_OUTPUT.put_line (CODE);-Is there a similar method as PRINT of SQL Server ...... you can type a few words less.
END;


EXECUTE TEST ('AA'); --- how to prompt here that SQL is wrong ...

Hey. So many questions for the first time. How does SQL Server feel good?
Reply

Use magic Report

2

Threads

19

Posts

16

Credits

Newbie

Rank: 1

Credits
16

 China

 Author| Post time: 2020-1-31 06:09:01
| Show all posts
Checked the jars.Is it necessary to do PRO in Oracle?
set serveroutput on
exec TEST ('AA');

Tried it still SQL error.
Refer to the following:
CREATE OR REPLACE PROCEDURE HELLO_PRO (STR VARCHAR2) AS
 BEGIN
 DBMS_OUTPUT.PUT_LINE (STR);
 END;

SQL> set serveroutput on
SQL> exec hello_pro ('he');
Reply

Use magic Report

2

Threads

19

Posts

16

Credits

Newbie

Rank: 1

Credits
16

 China

 Author| Post time: 2020-1-31 19:09:01
| Show all posts
Ha ha. Thank you. I just checked the information and said that the stored procedure should be added with OWNER,
EXECUTE SYS.TEST ('AA');
Same error.
Reply

Use magic Report

0

Threads

13

Posts

10

Credits

Newbie

Rank: 1

Credits
10

 China

Post time: 2020-2-1 14:18:01
| Show all posts
SQL> CREATE OR REPLACE PROCEDURE HELLO_PRO (STR VARCHAR2) AS
  2 BEGIN
  3 DBMS_OUTPUT.PUT_LINE (STR);
  4 END;
  5 /

Procedure created

SQL> set serveroutput on
SQL> exec hello_pro ('he');
he

PL / SQL procedure successfully completed
Reply

Use magic Report

2

Threads

19

Posts

16

Credits

Newbie

Rank: 1

Credits
16

 China

 Author| Post time: 2020-2-1 18:36:01
| Show all posts
SQL> CREATE OR REPLACE PROCEDURE HELLO_PRO (STR VARCHAR2) AS
  2 BEGIN
  3 DBMS_OUTPUT.PUT_LINE (STR);
  4 END;
  5 /
correct.

set serveroutput on;
exec hello_pro ('he');
error.
Reply

Use magic Report

0

Threads

5

Posts

4

Credits

Newbie

Rank: 1

Credits
4

 China

Post time: 2020-2-1 20:27:01
| Show all posts
wang7498
There is no semicolon ';' after this set serveroutput on
Reply

Use magic Report

2

Threads

19

Posts

16

Credits

Newbie

Rank: 1

Credits
16

 China

 Author| Post time: 2020-2-1 22:36:01
| Show all posts
Yes, it is definitely not the problem.
Reply

Use magic Report

0

Threads

66

Posts

45

Credits

Newbie

Rank: 1

Credits
45

 China

Post time: 2020-2-10 19:45:02
| Show all posts
set serveroutput on
No semicolon
Reply

Use magic Report

0

Threads

10

Posts

6

Credits

Newbie

Rank: 1

Credits
6

 China

Post time: 2020-2-14 20:45:01
| Show all posts
It ’s natural to get used to it.

Can you post your specific error message to see it?
Reply

Use magic Report

2

Threads

19

Posts

16

Credits

Newbie

Rank: 1

Credits
16

 China

 Author| Post time: 2020-2-16 09:00:02
| Show all posts
CREATE OR REPLACE PROCEDURE "SYS". "TEST"
(CODE IN CHAR)
AS
BEGIN
  DBMS_OUTPUT.put_line (CODE);
END;
This is right.
Then execute the part:

EXECUTE TEST ('AA')
Error message: ORA-00900: invalid SQL statement
or
EXECUTE SYS.TEST ('AA');
Same error message.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2020|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list