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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:58:28+00:00 2026-05-31T13:58:28+00:00

getting two arrays from controller and code is — Sql db = new Sql(dataSource_wldb1)

  • 0

getting two arrays from controller and code is —
Sql db = new Sql(dataSource_wldb1) // Create a new instance of groovy.sql.Sql with the DB of the Grails app
def ivrColumns = []

                    db.eachRow(ivrColumnsQuery) {
                        rsRow ->
                            ivrColumns.add(rsRow.name)  }

                    def ivrResults = []
                    db.eachRow(mssqlQuery) {rows ->
                        //print rows
                        ivrResults.add(rows)
                    }

one has all column names & other has all row data.as below-
return render(view:’xref’,model:[ivrcolumns:ivrColumns,ivrresults:ivrResults] )

getting data in below format-
Columns
[ClientKey, Abbr, ConfigKey, Federal, State, DMA, Internal, Wireless, CRssing, CurfewExemption, CampaignID]

Data
[groovy.sql.GroovyResultSetExtension@12f8d75, groovy.sql.GroovyResultSetE
oovy.sql.GroovyResultSetExtension@12f8d75, groovy.sql.GroovyResultSetExtension@1
roovyResultSetExtension@12f8d75, groovy.sql.GroovyResultSetExtension@12f8d75, gr
tSetExtension@12f8d75, groovy.sql.GroovyResultSetExtension@12f8d75, groovy.sql.G
ion@12f8d75, groovy.sql.GroovyResultSetExtension@12f8d75]

view code is—

<g:if test="${ivrcolumns != null }">
<center>Database Location - WLDB1      <br>DB Name - IVR_GUARDIAN  </center><br><br>
<table class="table loadTable" >

    <thead>
            <tr bgcolor="#f0f0f0" >

    <g:each in="${ivrcolumns}" status="ii" var="columnivr">
    <td nowrap>${columnivr}</td>
    </g:each>       
            </tr>
    </thead>
    <tbody>
    <g:each in="${ivrresults}" status="jj" var="hed">

                    <tr>               
                            <g:each in="${ivrcolumns}" status="kk" var="col">       
                                    <td nowrap>${hed.col}</td>  ///please suggest how    to do it.
                            </g:each>
                    </tr>
    </g:each>


    </tbody>
</table>

now want to show in GSP page .i am able to display the column but having hard time to display data.not getting how the dot will be used to get correct data to each column.

Will appreciate any help.

thanks

  • 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-31T13:58:29+00:00Added an answer on May 31, 2026 at 1:58 pm

    Assuming that’s just a sql result, you can just call ${ hed[ col ] } or ${ hed.”$col” }

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

Sidebar

Related Questions

I'm getting bamboozled by for each loops and two dimensional arrays, and I'm a
I'm working on binary matrices. Two of my arrays are getting overlapped. (I checked
Possible Duplicate: Compare dates in java I am getting two dates from server in
I have the following two methods for getting data from my database: - (void)
I'm trying to override the toString method in Java to output from two arrays
I have two arrays. Each is being pulled from MySQL via the following; $query
I am getting the following errors when making Arrays of two obecjts.. Edge and
When I try to create an ArrayList myArrayList from an array, using Arrays.asList(myArray) ,
If I want to compare two arrays and create an interpolated output string if
I need help getting two pieces of data, and comparing them. What I am

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.