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

  • Home
  • SEARCH
  • 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 8982863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:41:09+00:00 2026-06-15T20:41:09+00:00

I create one database related app. In this i create simple database and get

  • 0

I create one database related app.

In this i create simple database and get the value from database using in in sql query.

My problem is there i got the on string like a “2,6,8,9,10” this.
first i split this string and store in one arraylist. with out comma.
after this arraylist i merge with comma like a 2,6,8,9,10 this.

i do all of this very well.
i use this string in query to get the value from database.
My query is

SELECT tm.icon,tm.topic_no,td.topic_id,td.name FROM topicmaster tm ,topicmaster_description td  WHERE td.topic_id =tm.topic_id AND  td.langid='3' AND tm.oraganisationid ='1' AND  td.topic_id in(2,6,8,9,10);

this.

but when i pass the merge string it`s look like a

SELECT tm.icon,tm.topic_no,td.topic_id,td.name FROM topicmaster tm ,topicmaster_description td  WHERE td.topic_id =tm.topic_id AND  td.langid='3' AND tm.oraganisationid ='1' AND  td.topic_id in('2,6,8,9,10');

so i can not run the query because the different of pass value in in cause.
in above query work fine because its like ain(2,6,8,9,10)
in second it look like a
in(‘2,6,8,9,10’)
so what to do.
how to remove this
‘` from string?

First i split String

//getTopicFile ArrayList with 
    public  ArrayList<String> getAssignTopicArrayList(String passString) 
    {
        ArrayList<String> rtnArrayList=new ArrayList<String>();
        try 
        {
            StringTokenizer strTokens = new StringTokenizer(passString,",");
            while (strTokens.hasMoreElements()) 
            {
                rtnArrayList.add(String.valueOf(strTokens.nextToken()));
            }
        } catch (Exception ex) 
        {
            ex.printStackTrace();
            System.err.println("Error in Fetch ArrayList-->"+ex.toString());
        }
        return rtnArrayList;
    }       
    //getTopicFile ArrayList with 

After i merge in New String

genHelper.showErrorLog("Assign Topic-->"+chapterAssignTopicName);
        ArrayList<String> getTopicList=genHelper.getAssignTopicArrayList(chapterAssignTopicName);

        String passConcat = "";
        for (int i = 0; i < getTopicList.size(); i++) 
        {
            System.out.println("Topic List--->"+getTopicList.get(i));

            if(getTopicList.size()==1)
            {
                passConcat=passConcat.concat(String.valueOf(getTopicList.get(i)));
            }
            else
            {
                if(getTopicList.size()-1 == i)
                {
                    System.err.println("value if --> " + i);
                    passConcat=passConcat.concat(String.valueOf(getTopicList.get(i)));
                }else {
                    System.err.println("value else--> " + i);
                    passConcat=passConcat.concat(String.valueOf(getTopicList.get(i)).concat(","));
                }
            }
        }

        genHelper.showErrorLog("PassConcat String-->"+passConcat);

then i got New String and pass in query it` below

String topicQuery="SELECT tm.icon,tm.topic_no,td.topic_id,td.name FROM topicmaster tm ,topicmaster_description td  WHERE td.topic_id =tm.topic_id AND  td.langid='"+LanguageActivity.languageId+"' AND tm.oraganisationid ='"+genHelper.loadPreferences(String.valueOf(R.string.sharePrefin_Login_organizationid))+"' AND  td.topic_id in('"+passConcat+"')";
  • 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-15T20:41:10+00:00Added an answer on June 15, 2026 at 8:41 pm

    should not

    String topicQuery="SELECT tm.icon,tm.topic_no,td.topic_id,td.name FROM topicmaster tm ,topicmaster_description td  WHERE td.topic_id =tm.topic_id AND  td.langid='"+LanguageActivity.languageId+"' AND tm.oraganisationid ='"+genHelper.loadPreferences(String.valueOf(R.string.sharePrefin_Login_organizationid))+"' AND  td.topic_id in('"+passConcat+"')";
    

    be

    String topicQuery="SELECT tm.icon,tm.topic_no,td.topic_id,td.name FROM topicmaster tm ,topicmaster_description td  WHERE td.topic_id =tm.topic_id AND  td.langid='"+LanguageActivity.languageId+"' AND tm.oraganisationid ='"+genHelper.loadPreferences(String.valueOf(R.string.sharePrefin_Login_organizationid))+"' AND  td.topic_id in("+passConcat+")";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one SQL server database which was created using Import/Export Wizard from an
I have created one user named tuser with create database rights in SQL server
I'm trying to create one entity from 2 tables that are related not by
I'm writing an database app in C# using SQL Server CR E 3.5 and
I want to create a 'mini-database'. I want to have one file with lots
I created one app for database which contains a student table and 3 fields
I have created an entity data model and generated a database from it. One
I create one table by using jquery : <div class=productlist style=float:left; id=productlist> <script type=text/javascript
I have a three database tables related for example: company( one - one) Contact(
I'm developing a web-app where the user can create multiple related elements and then

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.