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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:23:53+00:00 2026-05-20T19:23:53+00:00

I am using this query to fetch data from webserver onto my iPhone app

  • 0

I am using this query to fetch data from webserver onto my iPhone app using JSON Parsing.

SELECT a.FundID, a.FundName, a.Strike, a.LongShort, a.Current, a.Points, a.OpenClose
FROM tbl_Positions a, tbl_FundStatic b
WHERE b.FundID = a.FundID
AND b.UserID = '14'
AND a.OpenClose != 'Close'
UNION 
SELECT c.FundID, c.FundName, '0' AS Strike, "-" AS LongShort, b.LastTradePrice, '0' AS Points, "-" AS OpenClose
FROM tbl_FundStatic c, tbl_MarketData b
WHERE c.UserID = '14'
AND b.IndexCode = c.`Index` 
AND c.FundID NOT 
IN (
     SELECT DISTINCT (FundID)
     FROM tbl_Positions
   )

Ideally it should return data like

enter image description here

But it shows junk value (like “MA==”,etc) for the columns Points and Strike.

What could be wrong?

EDIT:

I am using SBJSON Parser.

I am using following code to parse data into JSON String on server side:

        DataTable dt = new DataTable();
        MySqlDataAdapter da = new MySqlDataAdapter(cmd);
        da.Fill(dt);
        objMyCon.Close();

        String jsonString = JsonConvert.SerializeObject(dt);
        String finalString = "{\"ExecuteTrade\":";
        finalString += jsonString;
        finalString += "}";

        return finalString; 

finalString Value

{"ExecuteTrade":[{"FundID":28,"FundName":"Sam Fund 2","Strike":"MTIxMzA=","LongShort":"Long","Current":11985.00,"Points":"LTE0NQ==","OpenClose":"Open"},
{"FundID":27,"FundName":"Sam Fund 1","Strike":"MTE5ODU=","LongShort":"Long","Current":11985.00,"Points":"NTAwMDA=","OpenClose":"Open"},
{"FundID":32,"FundName":"Sam Fund 3","Strike":"MjIwMDA=","LongShort":"Long","Current":14000.00,"Points":"NjAwMA==","OpenClose":"Open"},
{"FundID":45,"FundName":"Rob Fund test","Strike":"OTk5OQ==","LongShort":"NULL","Current":11984.61,"Points":"OTk5OQ==","OpenClose":"NULL"},   
   {"FundID":46,"FundName":"newtestfund5th","Strike":"OTk5OQ==","LongShort":"NULL","Current":11984.61,"Points":"OTk5OQ==","OpenClose":"NULL"}]}

This is the Datatable:

enter image description here

On app side I am using

NSDictionary *diction = [responseString JSONValue];

NOTE: The Query works fine when executed on server.

  • 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-20T19:23:53+00:00Added an answer on May 20, 2026 at 7:23 pm

    Changed my Query to

    SELECT a.FundID, a.FundName, a.Strike, a.LongShort, a.Current, a.Points, a.OpenClose
    FROM tbl_Positions a, tbl_FundStatic b
    WHERE b.FundID = a.FundID
    AND b.UserID = '14'
    AND a.OpenClose != 'Close'
    UNION 
    SELECT c.FundID, c.FundName, 0 AS Strike, "-" AS LongShort, b.LastTradePrice, 0 AS Points, "-" AS OpenClose
    FROM tbl_FundStatic c, tbl_MarketData b
    WHERE c.UserID = '14'
    AND b.IndexCode = c.`Index` 
    AND c.FundID NOT 
    IN 
    (
          SELECT DISTINCT (FundID)
          FROM tbl_Positions
    )
    

    Just removed the single quotes ' around the decimal values.

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

Sidebar

Related Questions

I am using this query to fetch data from SQL Server 2008: select g.godown_name,
I retrieve data from database using this query: SELECT * FROM tickets_departement_groups WHERE group_id
I am using this query: SELECT DISTINCT pat.PublicationID FROM dbo.PubAdvTransData AS pat INNER JOIN
When using this SQL query: Select * from table_name what happens if the name
I am using this SQL query SELECT TOP 11 StockPrices.Close FROM StockPrices WHERE StockPrices.Date
i am joining 2 tables using this query SELECT DISTINCT (member.id), member_type FROM member
I have this Monster SQl Query that looks to fetch data from a Staging
Hi I have been using this code to fetch data from mysql database and
I have a query in oracle to fetch data from table using rownum but
I have written a code like this to fetch data from database using HQL:

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.