Skip to main content
Nintex Community Menu Bar

Retrieving SQL database table columns onto K2 Object Browser

  • September 4, 2009
  • 14 replies
  • 13 views

Forum|alt.badge.img+9

HI all,


How can i get a particular sql table columns onto k2object browser. what are the steps to be followed to achieve this.

14 replies

Forum|alt.badge.img+8
  • September 5, 2009
Assuming you are using K2 blackpearl, you will need to create a Smart Object. First, you will need to look at the blackmarket and locate the Dynamic SQL service. This will allow you to create a smart object than can access SQL Databases and the included tables which will be available in the object browser. Please note that the tables will need to have a primary key to work with that service.

Forum|alt.badge.img+9
  • Author
  • September 7, 2009

Hi Scott, Thanks for the reply, Yes im using k2blackpearl. I have downloaded Dynamic SQL service but how it allows us to create the smartobject. Can u plz explain me in detailed steps.


Forum|alt.badge.img+8
  • September 7, 2009

1) register the dll as a service object using the k2 broker management tool or through the workspace.


2) then create a service instance and give the credentials to access your database.


3) Create a smartobject project in the k2 designer.


4) create a method referencing this service instance via the k2 context browser.


5) deploy the smartobject.


6) make use of the smartobject in the webpart


Forum|alt.badge.img+9
  • Author
  • September 8, 2009
HI Pirate, Thnx for the reply, it worked for me and i am able to get data from sql databse. I have another scenario like i have to retrieve the value depending on the value which im passing. How can i achieve this. Any suggestions.

Forum|alt.badge.img+8
  • September 8, 2009
create a stored procedure which takes a input paramater and returns your required result. Now create a smart object list method(u may use the same smartobject u built earlier or a new one) which takes in this value and returns your result.

Forum|alt.badge.img+9
  • Author
  • September 8, 2009

i have done the same way u said and its giving the below error shown in image.


My SP is taking EmployeeID as input and returning all values in Employee table. I dint use 'SP_' for my storedprocedure. It affects anything if i use 'SP_' .


I have created a SO with list method pointing to my 'SPEmployeeDetailsExecuteNonquery' service object method and i used 'Create All' option and clicked Finish then deployed. Am i missing any options here.


 


14294i635DFCC85A425F2B.bmp

Forum|alt.badge.img+8
  • September 8, 2009
Did u declare a property in the smartobject which would act as the input parameter. Did u use the input paramaters by running the method wizard in advanced mode. I have also run into similar issues while developing for the first time.

Forum|alt.badge.img+6
  • September 8, 2009
Irrespective of the input Parameter bring all the values, if the any input passed, based on that retreive that value which statify that condition

Forum|alt.badge.img+9
  • Author
  • September 8, 2009

Yes its returning all the values from database but i need a record which is dependent on input parameter.


maxpirate, yes i have declared an input property by choosing advanced mode. But when i add Service object method (i.e ExecuteNonQuery),the input property name,output property name getting disappeared, Only return property name is appearing,then im choosing "Create All" option to map. When i finish and deploy,i used smartobject service tester tool to test.In that it is asking Input Property,after entering it, all the records existing in table are returned.


Here am i missing any option. If u want i will provide u all the screens.


 


Forum|alt.badge.img+8
  • September 8, 2009

sri i don understand what u mean by "output property name getting disappeared". Please be specific.


If u want records without passing an input param then u shud use the list method.


Forum|alt.badge.img+9
  • Author
  • September 8, 2009
Plz check the attachments. Actually i want to give input parameter ex EmployeeID, depending on that it should return EmployeeDetails. I have checked and Executed StoredProcedure, and its returning the particular record. When i work through smartobject,its returning all the records not the record depending on Input Employee ID. Any ideas

Forum|alt.badge.img+8
  • September 8, 2009
Are u using the read method in the smartobject.

Forum|alt.badge.img+9
  • Author
  • September 8, 2009
No , i have tried with both List Type and Execute Type(Default 1) from method detials wizard.

Forum|alt.badge.img+9
  • Author
  • September 9, 2009

The query is resolved. actually it is the problem with the older version SourceCode.SmartObjects.Services.DynamicSQLSPService.dll . Because of this, when i add service object, it is showing only the return propert values not th input property values. Now i have updated it with version 1.06 can be downloaded from http://www.k2underground.com/k2/ProjectHome.aspx?ProjectID=42  Binaries V 1.06 . Register this dll in Broker Management Tool.