Forum Discussion

Mpeterson's avatar
Mpeterson
Occasional Contributor
9 years ago

Is there a bug in the SQL Query Wizard in Ready API 1.3.1?

Im connecting to SQL Server 2012, using the MSSQL SQLServerDriver provided with the Ready API Tool.

 

I create and test the connection, it's valid. Using the "Build Query" wizard I select the table and the one field i desire. Select the "Test Query" arrow, select max rows (0 = all) the desired results are displayed. The query is quite simple:

 

Select [API Attendance Values].PersonReferenceId
From [API Attendance Values]

 

I click ok and the property is created with the name "[API Attendance Values]_PersonReferenceId"

When Ran in the window an incorrect Syntax error is produced, and it's right, the value in the window is now:

 

Select [API Attendance Values].PersonReferenceId as [API Attendance Values]_PersonReferenceId
From [API Attendance Values]

 

Ok thats Bad, but if I edit the Query window puting the original working query in, the query runs, tells me it runs, with the time it took.... but no data is displayed in the window, just empty rows.

 

I have not added any custom drivers or configuation to the software.

 

Please Advise,

Mark

 

 

 

3 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Mpeterson,

     

    We’ve just release Ready! API 1.4. Could you please check if the same issue is reproduced there?

     

    • Mpeterson's avatar
      Mpeterson
      Occasional Contributor

      Installed ready API 1.4.0  Build Date: 20150811-1357

      The condition is unchanged.

      Create a Datasource> select the connection (sql)> Build querry> select table and column in querry builder> click the SQL Preview arrow> Specify max rows as "0"> "OK"

      Query is:

      Select [API Attendance Values].PersonReferenceId
      From [API Attendance Values]

      Six rows of valid data are returned and displayed.

       

      Click "OK"

       

      The value in the sql Query window is now:

      Select [API Attendance Values].PersonReferenceId as [API Attendance Values]_PersonReferenceId
      From [API Attendance Values]

       

      There is now a property called "[API Attendance Values]_PersonReferenceId"

       

      Click the green "run" arrow at the top of the page> specify max rows as "0" > click "ok"

       

      Error pop up appears "Incorrect Syntax near '_PersonReferenceId' "

      • Mpeterson's avatar
        Mpeterson
        Occasional Contributor

        Using Ready! API Pro 1.4.1 Build Date: 20150909-1157

         

        Another issue with the SQL interface. I have created a connection to my SQL server 2012 using the MSSQL(MicrosoftDriver)/com.microsoft.sqlserver.jdbc.SQLServerDriver. The connection is successful. I created a JDBC test step selected my connection, and entered {call CallSequence;1} in the SQL Query field to call my stored procedure.

         

         

        The problem is 1.) My procedure is hardcoded to return a static value, 10000.(for proof of course)

        USE [Attendance]

        GO

        /****** Object: StoredProcedure [dbo].[CallSequence] Script Date: 10/12/2015 8:43:22 AM ******/

        SET ANSI_NULLS ON

        GO

        SET QUOTED_IDENTIFIER ON

        GO

        ALTER PROC [dbo].[CallSequence]

        AS

        DECLARE @WebCallSequence bigint;

        UPDATE dbo.WebCallSequence

        SET @WebCallSequence = WebCallSequence = WebCallSequence + 1

        WHERE WebCallSequenceID = 1;

        SELECT @WebCallSequence AS WebCallSequence;

        return 10000

         

        When run the response is in the tool is :

        <Results>
            <UpdateCount>1</UpdateCount>
        </Results>

         

        And that brings me to issue 2.)

         

        When selecting the "Select if this is a stored procedure Checkbox" and selecting the Create Query icon I get an error "Line 1: Invalid procedure number (0) Must be between 1 and 32767"

         

        What is interesting is the call is correct and does cal the stored proc, (I can watch the table and see the values changing).

         

        My issue does appear to be similar to the thread in this forum: "Stored Proc, DYNAMIC SQL returns no rows" but no soulion is posted.

         

        So Am I missing something simple here? Do I need to use the Sourceforge driver?

        Why is a simple proc with a static value unable to return a value in the JDBC teststep?

         

        Thanks,

         

        Mark