logo
down
shadow

PL/SQL - I keep getting this error when concatenating: PLS-00306: wrong number or types of arguments in call to '||'


PL/SQL - I keep getting this error when concatenating: PLS-00306: wrong number or types of arguments in call to '||'

By : Rowan Feely
Date : November 22 2020, 03:01 PM
To fix this issue One thing that looks wrong is that prjt_name is a string, but you pass it as a number in your query. So here is what I would change:
code :
    || 'where  t.project_id = (select project_id from sandbox.sb_project@adhoc_pos15 where project_name = upper('''
    || prjt_name
    || '''))'
    'select count(t.project_id) as "CNT" from sandbox.'
    || tableName.table_name
    || '@adhoc_pos15 t'
    || 'where  t.project_id = (select project_id from sandbox.sb_project@adhoc_pos15 where project_name = upper('''
    || prjt_name
    || '''))'


Share : facebook icon twitter icon
PLS-00306: wrong number or types of arguments in call to

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


By : user3738246
Date : March 29 2020, 07:55 AM
Hope this helps Like Allan I'm not an ODP expert. However, I do know that Oracle stores the return value of a function as PARAMETER 0 in the Data Dictionary. The input parameters are 1, 2, etc.
So, if you declare and assign the return value before you assign the input parameters it might work.
PLS-00306: wrong number or types of arguments in call

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


By : Ankara
Date : March 29 2020, 07:55 AM
help you fix your problem Since your procedure has an out variable, provide it with a fifth variable to get the out value:
code :
declare
  p_user_id int;
begin
  insert_user('user', 'password', 'mail@mail.com', '5', p_user_id);
end;
Error in call from C# code-behind to a stored procedure: "PLS-00306: wrong number or types of arguments in call to&

Error in call from C# code-behind to a stored procedure: "PLS-00306: wrong number or types of arguments in call to&


By : Vivek Shahare
Date : March 29 2020, 07:55 AM
To fix the issue you can do Fixed. The issue was that using a wrong connection string in web.config.
PLS-00306: wrong number or types of arguments in call to 'fun'

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


By : Christian Riley
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , You cannot use associative array in SQL (and you cannot use any array declared in package specification in SQL in Oracle versions prior to 12c), but you can store result of the fun function into local variable, and then insert that variable into table t:
code :
PROCEDURE proc () AS
    CURSOR aging_sch_cursor IS
    SELECT ...
    GROUP BY ...;

    v_aging_sch_row aging_sch_cursor%rowtype;
    v_aging_sch_table aging_sch_table_type;
    v_fun number;
BEGIN
    FOR v_aging_sch_row IN aging_sch_cursor LOOP
        v_aging_sch_table(v_aging_sch_row.days_delq || ' ' || v_aging_sch_row.eligible).days_delq := v_aging_sch_row.days_delq;
        v_aging_sch_table(v_aging_sch_row.days_delq || ' ' || v_aging_sch_row.eligible).eligible := v_aging_sch_row.eligible;
        v_aging_sch_table(v_aging_sch_row.days_delq || ' ' || v_aging_sch_row.eligible).unit    := v_aging_sch_row.unit;
        v_aging_sch_table(v_aging_sch_row.days_delq || ' ' || v_aging_sch_row.eligible).balance := v_aging_sch_row.balance;
    END LOOP;

    v_fun := fun(v_aging_sch_table,0,2)
    INSERT INTO t
    VALUES (v_fun);
END proc;
INSERT INTO t (COLUMN1)
VALUES (v_fun);
PLS-00306: wrong number or types of arguments in call to error

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


By : user2793080
Date : March 29 2020, 07:55 AM
seems to work fine You didn't post what went wrong (which part of code); anyway, here you go.
Sample table:
code :
SQL> create table countries
  2    (country_name    varchar2(20),
  3     region_id       varchar2(20),
  4     currency_code   varchar2(20));

Table created.

SQL> insert into countries values ('Croatia', 'A', 'kn');

1 row created.
SQL> CREATE OR REPLACE PACKAGE traveler_assistance_package
  2  IS
  3    TYPE country_rec IS RECORD (
  4      country_name COUNTRIES.COUNTRY_NAME%TYPE,
  5      region COUNTRIES.REGION_ID%TYPE,
  6      currency COUNTRIES.CURRENCY_CODE%TYPE);
  7    PROCEDURE find_region_and_currency
  8      (p_country_name   IN COUNTRIES.country_name%TYPE,
  9       p_country_rec     OUT country_rec);
 10  END traveler_assistance_package;
 11  /

Package created.
SQL> CREATE OR REPLACE package body traveler_assistance_package
  2  IS
  3    PROCEDURE find_region_and_currency
  4      (p_country_name   IN countries.country_name%TYPE,
  5       p_country_rec     OUT country_rec)
  6    IS
  7    BEGIN
  8      SELECT country_name, region_id, currency_code INTO p_country_rec
  9      FROM COUNTRIES
 10      where COUNTRY_NAME = p_country_name;
 11
 12      --dbms_output.put_line('Printing from FIND_REGION_AND_CURRENCY');
 13      --DBMS_OUTPUT.PUT_LINE('Country Name:'||p_country_rec.country_name ||
 14      --  ' Region:' || p_country_rec.region ||
 15      --  ' Currency:' || p_country_rec.currency);
 16    END;
 17  END traveler_assistance_package;
 18  /

Package body created.
SQL> set serveroutput on;
SQL> declare
  2    l_out traveler_assistance_package.country_rec;
  3  begin
  4    traveler_assistance_package.find_region_and_currency ('Croatia', l_out);
  5
  6    dbms_output.put_line('Printing from anonymous PL/SQL block');
  7    dbms_output.put_line(l_out.country_name ||', '|| l_out.currency);
  8  end;
  9  /
Printing from anonymous PL/SQL block
Croatia, kn

PL/SQL procedure successfully completed.
Related Posts Related Posts :
  • How to I get a total count?
  • Many-to-many SQL relationship
  • Procedure call inside procedure
  • How to have decreasing running total in Oracle sql
  • SQL Group function query?
  • Which is the best way to calculate Year/Month in SQL Server?
  • Best way of sanitize unparametrizable sql
  • Querying for JSON data in Oracle creates syntax error
  • Show top 1 by max column
  • SQL: Insert newly created column in the same table
  • How to extract numbers after string using regexp?
  • SQL Query - Group consecutive items based on condition
  • Users who work in same department
  • Syntax error near column value Vb
  • Oracle Trigger BEFORE INSERT has No data found
  • What kind of join to use on SQL tables
  • Is there a way to add a constant value dynamically to all records returned in Hive?
  • SQL optimization (inner join or selects)
  • EF 6.x, LINQ-to-SQL and raw SQL clauses
  • Simple SQL Variable Assignment Only Returns One Letter: Why?
  • Converting a custom timestamp to date
  • SQL Server : inserting Player vs Player names in to new table from tblEntrants
  • invalid identifier in sql
  • Count records only from left side of a LEFT JOIN
  • get everything before a string including itself oracle
  • Format Data from Word Doc to SQL using RegEX
  • Conditional formatting on MAX value row
  • MS-Access : selecting data from two tables and only returning you need
  • SQL Server: optimal indexing strategies for many-to-many join
  • DBgrid column very wide
  • PostgreSQL Group values by category, count and calculate percentage
  • MS Access SQL - Most Recent Record for Each Consultant ID
  • Update table: Summary of previous rows without using cursor or while loop
  • PostgreSQL: built-in function to remove substring starting with certain pattern
  • ORA-00909: invalid number of arguments
  • How to summarize all possible combinations of variables?
  • Select Column within a Column SQL
  • PostgreSQL Inserting 2 relationships at once
  • T sql - How to store results from a dynamic query using EXEC or EXECUTE sp_executesql
  • How do I parse my json into CSV using regex?
  • Reverse foreign key cascading (or how to collect database garbage)
  • SQL Pivot Questions
  • Insert records into a table with a condition in SQL Server 2016
  • display null value using rank functions in oracle sql
  • SQL - Get count of group by column but also select top item of group
  • How to add an array of datarows into an exisitng table inside my database
  • There is no unique constraint matching given keys for referenced table "employee" 1
  • SQL: Unable to SELECT joined column
  • How to find out how much space a SQL Server table uses?
  • Window function to remove specific records from SQL Server dataset
  • How to add a column for each day in sql?
  • Create group column based on the specific rows
  • Not sure if this consistitues a transitive dependency
  • How to compare the values in a column to a long list in SQL Server
  • Preserving data format Decimal(6,5) from vba to sql
  • Oracle Query to rollup QTY by Year- only last 3 years
  • SQL - Calculate 2 columns and view result to another to column
  • Divide or Multiply according to a condition (Improving query)
  • PostgreSQL unnest() with consecutive integers grouped by number
  • SQL to limit output to certain months and years
  • shadow
    Privacy Policy - Terms - Contact Us © voile276.org