PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'

michaelk46

This is the first time I have tried writing an Oracle procedure and I am getting an error (shown in the question title) centering on the DBMS_OUTPUT.PUT_LINE line.

I read online that it can only hand back VARCAHR2 columns, so I have cast the only two non VARCHAR2 columns that are being accessed, but I am still getting the error. This error is happening when I try to run it directly in the oracle SQL Developer.

CREATE OR REPLACE PROCEDURE LOGGING_PRC 
(
  STARTDATE_IN IN VARCHAR2,
  ENDDATE_IN IN VARCHAR2,
  NAMES_IN IN VARCHAR2, 
  MODS_IN IN VARCHAR2, 
  LOGS_IN IN VARCHAR2,

  ID_OUT OUT VARCHAR2,
  NAME_OUT OUT VARCHAR2,
  MODULE_OUT OUT VARCHAR2,
  ENTRYDATE_OUT OUT VARCHAR2,
  STATUS_OUT OUT VARCHAR2,
  TYPE_OUT OUT VARCHAR2
)  
  AS 
BEGIN
    SELECT
    CAST(ID_LOG AS VARCHAR2(16)),
     APNAME,
     APPMOD,
     CAST(ENTRYDATE AS VARCHAR2(30)),
     APPSTATUS,
     LOGTYPE
  INTO 
      ID_OUT,
      NAME_OUT,
      MODULE_OUT,
      ENTRYDATE_OUT,
      STATUS_OUT,
      TYPE_OUT
   FROM 
     BASE          
   WHERE     
     ENTRYDATE > STARTDATE_IN AND
     ENTRYDATE  < ENDDATE_IN AND
     (NAMES  =  NAMES_IN OR NAMES_IN IS NULL) AND
     (MODS = MODS_IN OR MODS_IN IS NULL) AND
     (LOGS = LOGS_IN  OR LOGS_IN IS NULL);      
  RETURN;
DBMS_OUTPUT.PUT_LINE(ID_OUT, NAME_OUT, MODULE_OUT, ENTRYDATE_OUT, STATUS_OUT, TYPE_OUT);
END LOGGING_PRC;

Does someone see where I have the incorrect code?

Aleksej

DBMS_OUTPUT.PUT_LINE is defined as follows

procedure put_line(a varchar2);

so, it only accepts one input parameter.

If you need to print the values of more than one field, you need to concatenate them in a single varchar2; you can try with :

DBMS_OUTPUT.PUT_LINE(ID_OUT || ',' || NAME_OUT || ',' || MODULE_OUT || ',' || ENTRYDATE_OUT || ',' || STATUS_OUT || ',' || TYPE_OUT);

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Oracle procedure call results in "PLS-00306: wrong number or types of arguments in call"

From Dev

Call Oracle Stored Procedure with Char Out Parameter errors with PLS-00306: wrong number or types of arguments in call

From Dev

PL/SQL: Error "PLS-00306: wrong number or types of arguments in call to" triggered for table of numbers

From Dev

PLS-00306: wrong number or types of arguments in call to 'OUTPUT_ARRAY'

From Dev

PLS-00306: wrong number or types of arguments in call to 'CREATE_PROGRAM'

From Dev

Oracle Stored Procedure PLS-00306: wrong number or types of arguments

From Dev

Oracle Procedure - PLS-00306: wrong number or types of arguments

From Dev

nPLS-00306: wrong number or types of arguments in call

From Dev

passing PHP array to Oracle Stored Proc (PLS-00306: wrong number or types of arguments)

From Dev

Wrong number or types of arguments in call to even after correct parameters

From Dev

Getting wrong number or types of arguments in call to exception while executing stored procedure

From Dev

Wrong number or TYPES of arguments, error in PL/SQL

From Dev

PLS 00306 Error PL/SQL

From Dev

Wrong number or types of arguments error while calling procedure

From Dev

command line arguments rake task wrong number of arguments

From Dev

"Wrong number or types of argument in call to '>'" when comparing dates in PLSQL

From Dev

No luck getting most recent entry in sub-select: ORA-00904: invalid identifier, and ORA-06553: wrong number or types of arguments in call

From Dev

No luck getting most recent entry in sub-select: ORA-00904: invalid identifier, and ORA-06553: wrong number or types of arguments in call

From Dev

wrong number of template arguments

From Dev

Wrong number of arguments issue

From Dev

Wrong number of Arguments with Lombok

From Dev

Wrong number of arguments for pattern

From Dev

ArgumentError: wrong number of arguments

From Dev

Wrong number of arguments on initialize

From Dev

Mismatch in Number/Types of Arguments

From Dev

Fails to start LogMiner with PLS-00306

From Dev

COUNTIF phpexcel Wrong number of arguments

From Dev

wrong number of arguments for carrierwave for actionDispatch

From Dev

Ruby Mailer: Wrong number of arguments

Related Related

  1. 1

    Oracle procedure call results in "PLS-00306: wrong number or types of arguments in call"

  2. 2

    Call Oracle Stored Procedure with Char Out Parameter errors with PLS-00306: wrong number or types of arguments in call

  3. 3

    PL/SQL: Error "PLS-00306: wrong number or types of arguments in call to" triggered for table of numbers

  4. 4

    PLS-00306: wrong number or types of arguments in call to 'OUTPUT_ARRAY'

  5. 5

    PLS-00306: wrong number or types of arguments in call to 'CREATE_PROGRAM'

  6. 6

    Oracle Stored Procedure PLS-00306: wrong number or types of arguments

  7. 7

    Oracle Procedure - PLS-00306: wrong number or types of arguments

  8. 8

    nPLS-00306: wrong number or types of arguments in call

  9. 9

    passing PHP array to Oracle Stored Proc (PLS-00306: wrong number or types of arguments)

  10. 10

    Wrong number or types of arguments in call to even after correct parameters

  11. 11

    Getting wrong number or types of arguments in call to exception while executing stored procedure

  12. 12

    Wrong number or TYPES of arguments, error in PL/SQL

  13. 13

    PLS 00306 Error PL/SQL

  14. 14

    Wrong number or types of arguments error while calling procedure

  15. 15

    command line arguments rake task wrong number of arguments

  16. 16

    "Wrong number or types of argument in call to '>'" when comparing dates in PLSQL

  17. 17

    No luck getting most recent entry in sub-select: ORA-00904: invalid identifier, and ORA-06553: wrong number or types of arguments in call

  18. 18

    No luck getting most recent entry in sub-select: ORA-00904: invalid identifier, and ORA-06553: wrong number or types of arguments in call

  19. 19

    wrong number of template arguments

  20. 20

    Wrong number of arguments issue

  21. 21

    Wrong number of Arguments with Lombok

  22. 22

    Wrong number of arguments for pattern

  23. 23

    ArgumentError: wrong number of arguments

  24. 24

    Wrong number of arguments on initialize

  25. 25

    Mismatch in Number/Types of Arguments

  26. 26

    Fails to start LogMiner with PLS-00306

  27. 27

    COUNTIF phpexcel Wrong number of arguments

  28. 28

    wrong number of arguments for carrierwave for actionDispatch

  29. 29

    Ruby Mailer: Wrong number of arguments

HotTag

Archive