how do read single column data from realm database?

1,903 views
Skip to first unread message

Mob Code

unread,
Aug 18, 2015, 7:25:47 AM8/18/15
to Realm

One table with three column which named "Id,Name,Last Name". For get data of Name column in sq-lite we are using query like 'SELECT Name form table_name' if we using realm in "IOS" then which method we use for get only one column data.


Thanks

Sebastian Bachmann

unread,
Aug 18, 2015, 7:35:53 AM8/18/15
to Mob Code, Realm
Hi Mob Code,

not sure if you are using Swift or Objective-C but maybe you have a look at the section: "Querying with Predicates"

Hope that helps!

Kind regards,
Sebastian

Mob Code <code...@gmail.com> schrieb am Di., 18. Aug. 2015 um 13:25 Uhr:

One table with three column which named "Id,Name,Last Name". For get data of Name column in sq-lite we are using query like 'SELECT Name form table_name' if we using realm in "IOS" then which method we use for get only one column data.


Thanks

--
You received this message because you are subscribed to the Google Groups "Realm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-cocoa...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-cocoa/d0d3e377-f964-4278-a0f0-9e61e1e18a95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mob Code

unread,
Aug 18, 2015, 8:35:23 AM8/18/15
to Realm
Thank  you Sebastian Bachmann
i am using obj-c. i am not exactly getting which predicts i have to use for same.

Thomas Goyne

unread,
Aug 18, 2015, 10:35:43 AM8/18/15
to Mob Code, realm...@googlegroups.com
Realm reads data only when you access the property, so you don't need to explicitly list which columns you want when querying. If you loop over the results of a query and only access the Name property of the returned objects, only the data for that column will be read.

--
Thomas Goyne



--

You received this message because you are subscribed to the Google Groups "Realm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-cocoa...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-cocoa/d0d3e377-f964-4278-a0f0-9e61e1e18a95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



{#HS:113177178-1692#}

Mob Code

unread,
Aug 18, 2015, 11:56:07 PM8/18/15
to Realm
Thank you Thomas Goyne for the tip. I got which i want.


On Tuesday, August 18, 2015 at 4:55:47 PM UTC+5:30, Mob Code wrote:
Reply all
Reply to author
Forward
0 new messages