Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8708749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:12:40+00:00 2026-06-13T04:12:40+00:00

I have an sql function (no idea about sql) CREATE OR REPLACE FUNCTION RATELIMIT_OWN.Get_Conns_By_Login_IP_CallerId

  • 0

I have an sql function (no idea about sql)

CREATE OR REPLACE FUNCTION RATELIMIT_OWN.Get_Conns_By_Login_IP_CallerId (p_yyyymm VARCHAR2, p_login VARCHAR2, p_framed_ip VARCHAR2, p_caller_id VARCHAR2 )
    RETURN CONNECTION_RECORD_4_IPV6_TABLE PIPELINED IS

TYPE        ref0 IS REF CURSOR;
cur0        ref0;
v_where_clause VARCHAR2(512);

out_rec     CONNECTION_RECORD_4_IPV6 := connection_record_4_ipv6(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

BEGIN

  if p_login is not NULL
  then
    v_where_clause := 'where login=''' || p_login || '''';
    if p_framed_ip is not NULL
    then
      v_where_clause := v_where_clause || ' and framed_ip=''' || p_framed_ip || '''';
    end if;
    if p_caller_id is not NULL
    then
      v_where_clause := v_where_clause || ' and caller_id=''' || p_caller_id || '''';
    end if;
  else
    v_where_clause := '';
    if p_framed_ip is not NULL
    then
      v_where_clause := 'where framed_ip=''' || p_framed_ip || '''';
      if p_caller_id is not NULL
      then
        v_where_clause := v_where_clause || ' and caller_id=''' || p_caller_id || '''';
      end if;
    else
      if p_caller_id is not NULL
      then
        v_where_clause := 'where caller_id=''' || p_caller_id || '''';
      end if;    
    end if;
  end if;

  OPEN cur0 FOR
    'SELECT login,acct_ts_start,acct_ts_stop,cause,duration,inb,outb,framed_ip,caller_id,called_id,nas_id,radius_type,format_ipv6_prefix(framed_ipv6_prefix),format_ipv6_prefix(delegated_ipv6_prefix) from ticket partition (TICKETS_P' || p_yyyymm || ') ' || v_where_clause;

   LOOP
   FETCH cur0 INTO out_rec.login, out_rec.acct_start, out_rec.acct_stop, out_rec.cause, out_rec.duration, out_rec.in_bytes, out_rec.out_bytes, out_rec.public_ip, out_rec.caller_id, out_rec.called_id, out_rec.nas_id, out_rec.radius_type, out_rec.framed_ipv6_prefix, out_rec.delegated_ipv6_prefix;
   EXIT WHEN cur0%NOTFOUND;
   PIPE ROW(out_rec);
  END LOOP;
  CLOSE cur0;

RETURN;
END Get_Conns_By_Login_IP_CallerId;
/

I am calling this function using Spring JDBC template

 SimpleJdbcCall caller = new SimpleJdbcCall(this.jdbcTemplateMartinique).withSchemaName("RATELIMIT_OWN").withFunctionName("Get_Conns_By_Login_IP_CallerId").withReturnValue()
            .declareParameters(new SqlParameter(P_YYYYMM, Types.VARCHAR))
            .declareParameters(new SqlParameter(P_LOGIN, Types.VARCHAR))
            .declareParameters(new SqlParameter(P_FRAMED_IP, Types.VARCHAR))
            .declareParameters(new SqlParameter(P_CALLER_ID, Types.VARCHAR));

    SearchAccountBean resultBean = null;

    SqlParameterSource paramMap = new MapSqlParameterSource().addValue(P_YYYYMM, searchAccountBean.getDate(), Types.VARCHAR).addValue(P_LOGIN, searchAccountBean.getLogin(), Types.VARCHAR)
            .addValue(P_FRAMED_IP, searchAccountBean.getIpAddress(), Types.VARCHAR).addValue(P_CALLER_ID, searchAccountBean.getCaller(), Types.VARCHAR);
    caller.compile();
    Object result = caller.executeFunction(Object.class, paramMap);

Now it’s throwing invalid column type 1111.
I debugged and found it’s returning “return of SQL type 1111”.

I want to know how can i retrieve the values of function result in java.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:12:41+00:00Added an answer on June 13, 2026 at 4:12 am

    It looks like something I solved just recently by registering “type handler” for an output parameter. The trick was registering SqlReturnType for SqlOutParameter – see constructor for SqlOutParamater. The interface has method getTypeValue() the allows you to process information from Oracle STRUCT which is likely the representation of your type in JDBC.

    You can find more details here:
    http://rostislav-matl.blogspot.cz/2012/10/accessing-oracle-user-defined-type-with.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: CREATE OR REPLACE FUNCTION repeatable_rand_text(ftype IN VARCHAR2 , in_val
I have a huge problem with the REPLACE SQL function in Microsoft SQL Server
I have the following scalar function in MS SQL 2005: CREATE FUNCTION [dbo].[Distance] (
SQL Server 2005 I have an SQL Function (ftn_GetExampleTable) which returns a table with
Possible Duplicate: Parameterizing an SQL IN clause? I have a SQL function whereby I
I have a PL/SQL function (running on Oracle 10g) in which I update some
I have an MS SQL function that is called with the following syntax: SELECT
I'm currently debugging an Ms SQL Function (SQL 2008). In this function, I have
I have a function in SQL server 2008 that takes a string: 'A,B,C,D' and
I have an user defined table function in SQL Server that aggregate data from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.