Accessing data in the database

In an application can we access the entire data in the database using an attribute in the database other than the primary key.

Hi,

Yes, you can apply a filter using Aggregate/Advanced SQL on the column which identified the row uniquely(If you need a unique row), otherwise, it will return all the records matched with filter value.

Thanks.

Hi, friend!

What de you mean with 'entire data'?

Are you using aggregate or advanced SQL widget?


Its depend on you which attribute you want on filter but mainly use primary key to find data because it return single data and if you use other attribute you can get more than one row.

If you want all data than dont use filter and if you want data with similar name than use filter by this attribute

like i have customer table where attribute is - ID,NAME,Address,Mobile

and if you want data of all Cutomer whose name is like Jhon

than use condition in filter

Customer.NAME like "%Jhon%" or Customer.NAME="Jhon"


Regards

Rahul Sahu

Lenon Manhães wrote:

Hi, friend!

What de you mean with 'entire data'?

Are you using aggregate or advanced SQL widget?


 i mean aggregate

 

Ok. 

The aggregate is optimized to fetch all attributes from the table. There are many ways to filter the data, not only the Id.

If you need to use only one or two attributes, the best way is the advanced SQL.

Lenon Manhães wrote:

Ok. 

The aggregate is optimized to fetch all attributes from the table. There are many ways to filter the data, not only the Id.

If you need to use only one or two attributes, the best way is the advanced SQL.

 

ok let me explain what i have done.First of all i have taken an input widget and took a local parameter called "employee no" which is a text datatype and have created a button which sends the created local variable as input parameter to another screen called "employee details" to retrieve the data related to that particular "employee no" .And i have also added a filter in the "employee details" screen like this 

EmployeeDetails.EmployeeNo=EmployeeNo

 In the preparation i have put the aggregate called "GetEmployeeDetailsByEmployeeNo"

But i am unable to retrieve the data into the "employee details" screen.Did i miss any logic here?

 

varthi jyothi wrote:

Lenon Manhães wrote:

Ok. 

The aggregate is optimized to fetch all attributes from the table. There are many ways to filter the data, not only the Id.

If you need to use only one or two attributes, the best way is the advanced SQL.

 

ok let me explain what i have done.First of all i have taken an input widget and took a local parameter called "employee no" which is a text datatype and have created a button which sends the created local variable as input parameter to another screen called "employee details" to retrieve the data related to that particular "employee no" .And i have also added a filter in the "employee details" screen like this 

EmployeeDetails.EmployeeNo=EmployeeNo

 In the preparation i have put the aggregate called "GetEmployeeDetailsByEmployeeNo"

But i am unable to retrieve the data into the "employee details" screen.Did i miss any logic here?

 

 Hi varthi jyothi,


Possible to share the OML?


I tried recreating the scenario you mentioned. Please take a look at OML attached.


Hope this solves your issue.


Thanks

 

varthi jyothi wrote:

Lenon Manhães wrote:

Ok. 

The aggregate is optimized to fetch all attributes from the table. There are many ways to filter the data, not only the Id.

If you need to use only one or two attributes, the best way is the advanced SQL.

 

ok let me explain what i have done.First of all i have taken an input widget and took a local parameter called "employee no" which is a text datatype and have created a button which sends the created local variable as input parameter to another screen called "employee details" to retrieve the data related to that particular "employee no" .And i have also added a filter in the "employee details" screen like this 

EmployeeDetails.EmployeeNo=EmployeeNo

 In the preparation i have put the aggregate called "GetEmployeeDetailsByEmployeeNo"

But i am unable to retrieve the data into the "employee details" screen.Did i miss any logic here?

 

 I get it.

Makes no sense you use this 'employee no' variable as text type. The way I see, would be better use it like Boolean type.

But ok, if you keep it type text, the filter must be "EmployeeDetails.EmployeeNo = 'Employee no'", so the comparison will get the content of the 'employee no' variable. That should work, but is not recomended use the filter equal '=' with a string type, because any change in variable  will cause error on query.

Hi, friend!

Was that helpful? If the issue is solved, please mark the answer as solution!


Best regards

Hi,

I would like to add this information: Using SQL to access data

Cheers

varthi jyothi wrote:

Lenon Manhães wrote:

Ok. 

The aggregate is optimized to fetch all attributes from the table. There are many ways to filter the data, not only the Id.

If you need to use only one or two attributes, the best way is the advanced SQL.

 

ok let me explain what i have done.First of all i have taken an input widget and took a local parameter called "employee no" which is a text datatype and have created a button which sends the created local variable as input parameter to another screen called "employee details" to retrieve the data related to that particular "employee no" .And i have also added a filter in the "employee details" screen like this 

EmployeeDetails.EmployeeNo=EmployeeNo

 In the preparation i have put the aggregate called "GetEmployeeDetailsByEmployeeNo"

But i am unable to retrieve the data into the "employee details" screen.Did i miss any logic here?

 

Hi varthi jyothi, 

Your logic looks fine to me. It's should get the data that you want to retrieve. Can you describe your problem more specifically? if it's possible to share the oml file will be quick way.