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 6622687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:26:23+00:00 2026-05-25T21:26:23+00:00

CREATE Function getNearIds (myLocationLon double, myLocationLat double) RETURNS WHAT I just want to return

  • 0

CREATE Function getNearIds (myLocationLon double, myLocationLat double) RETURNS WHAT

I just want to return an array of integers, after a long search: some say use Group_concat to make the list as a comma separated list then use find_in_set when calling the function. this works ok but in HQL (Hibernate query language) it doesn’t.

so I need a clear way for this function to return an array of integers, what if i want to return a list of items from items table, is this possible.

I think this is very simple to do in Oracle DB or even SQL server. why is it very tough in MySQL.

please help.

  • 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-05-25T21:26:23+00:00Added an answer on May 25, 2026 at 9:26 pm

    Why not just use a stored procedure instead? You could simply have it return a result set that had rows with just one column.

    Stored functions can’t do what you want to do – well, I suppose you could do that group concat thing but why bother? Create the stored procedure and have it return the ints you want.

    Something like:

    CREATE PROCEDURE getNearIds 
         (myLocationLon double, myLocationLat double)
    BEGIN
       # whatever your logic is to get the ids... 
       # e.g.,
       select id from locations where [whatever "near" means]
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create function to return a 1d array with 2 elements in
A few examples to show, just incase: Inline Table Valued CREATE FUNCTION MyNS.GetUnshippedOrders() RETURNS
here my code- create function dbo.emptable() returns Table as return (select id, name, salary
I have the following function CREATE FUNCTION GetIdentity() RETURNS INT AS BEGIN RETURN (IDENT_CURRENT('tblTempPo'))
I want to add mysql function: CREATE FUNCTION `chf_get_translation`(translation_id INT, site_lang INT) RETURNS text
So I have this working properly: CREATE FUNCTION dbo.GetLiveStream(@UserName NVARCHAR(MAX)) RETURNS TABLE AS RETURN
I want to create a function which returns a temporary table of dates, for
CREATE FUNCTION TWO_FRONT(txt CHAR(30)) RETURNS CHAR(2) RETURN SUBSTRING(txt, 1, 2); DELIMITER $$ CREATE FUNCTION
CREATE FUNCTION [dbo].[MSG_FilterAutoship] ( @ItemID VARCHAR(50) = NULL ) RETURNS @Autoship TABLE ( DistID
i have this simple plpgsql function: CREATE FUNCTION update_times () RETURNS trigger AS '

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.