none
Can JDBC connector use stored procedure instead of selecting columns from a table or view. RRS feed

  • Question

  • Hi, I'm using below sql statement to feed the data in to fast by using JDBC connector

     

    <parameter name="JDBCSQL" type="string">
     
    <description>
     
    </description>
     
    <value>
       
    SELECT
        [Name],
        [Address],
        [Phoneno]
        FROM [SharePoint].[dbo].[MY_FAST_VIEW]
     
    </value>

    </parameter>

     


    My Question is, can I directly use a stored procedure insted of select columns from the view.

     

    <parameter name="JDBCSQL" type="string">
     
    <description>
     
    </description>
     
    <value>
       
    select * from dbo.MyStoredProcedure
     
    </value>

    </parameter>

    Thursday, October 6, 2011 10:07 PM

Answers

  • Hi,

    My guess without trying it is, yes. It sends whatever query you have to the database, and as long as the query is valid for the database receiving it it will return data.

    It is the JDBCDriver type which selects what kind of database you are running against.

    You should just try it and see :)

    Regards,
    Mikael Svenson 


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    • Marked as answer by Swetha Gandla Friday, October 7, 2011 10:46 PM
    Friday, October 7, 2011 2:05 PM

All replies

  • Hi,

    My guess without trying it is, yes. It sends whatever query you have to the database, and as long as the query is valid for the database receiving it it will return data.

    It is the JDBCDriver type which selects what kind of database you are running against.

    You should just try it and see :)

    Regards,
    Mikael Svenson 


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    • Marked as answer by Swetha Gandla Friday, October 7, 2011 10:46 PM
    Friday, October 7, 2011 2:05 PM
  • Mikael's correct. As long as your JDBC driver can execute the driver, you can send in whatever you want. Two examples against SQL server:

    <!-- Without parameters -->
    <parameter name="JDBCSQL" type="string">
        <value><![CDATA[spMyProc]]></value>
    </parameter>
    
    <!-- With parameter -->
    <parameter name="JDBCSQL" type="string">
        <value><![CDATA[{call spMyProc('test')}]]></value>
    </parameter>

     


    Marcus Johansson | Search Nerd | comperiosearch.com | linkedin.com/in/marcusjohansson
    Saturday, October 8, 2011 2:30 AM