Solved

How to retrieve SQL columns having API in SQL query

  • 17 May 2023
  • 6 replies
  • 179 views

Userlevel 1
Badge +5

Hi,

    I am working on a SQL query related to  view PROJECT_FORECAST_ITEM_COST. When opening the project forecast, there is a SQL column address as “&AO.SUB_PROJECT_API.Get_Description(PROJECT_ID,SUB_PROJECT_ID)”. How do I include this column in my SQL query with PROJECT_FORECAST_ITEM_COST table?

I would like to understand how API works in general as well when it comes to SQL queries.

 

 

Many thanks

Housseiny

icon

Best answer by gumabs 17 May 2023, 14:37

View original

6 replies

Userlevel 6
Badge +19

Hi

Replace &AO. with IFSAPP and use parameter from PROJECT_FORECAST_ITEM_COST view. See a simple example below 

SELECT x.*,
IFSAPP.SUB_PROJECT_API.Get_Description(x.PROJECT_ID, x.SUB_PROJECT_ID) DESCRIPTION
FROM PROJECT_FORECAST_ITEM_COST x

Hope this helps

Userlevel 1
Badge +5

Hi

Replace &AO. with IFSAPP and use parameter from PROJECT_FORECAST_ITEM_COST view. See a simple example below 

SELECT x.*,
IFSAPP.SUB_PROJECT_API.Get_Description(x.PROJECT_ID, x.SUB_PROJECT_ID) DESCRIPTION
FROM PROJECT_FORECAST_ITEM_COST x

Hope this helps

Dear Gumabs,

                    This worked like a charm. Really appreciate your prompt feedback and help.

 

Regards

Housseiny

Userlevel 6
Badge +19

Hi @Housseiny 

I am happy that your issue is resolved. You can combine various functions from other APIs using parameter from the view you are trying to create report.

Have a good day ahead

Userlevel 1
Badge +5

Hi Gumabs,

                   Would it be possible to give a couple of examples for other functions from other APIs you are referring to please? I am not familiar with APIs or how it works :-)

 

Regards

Housseiny

Userlevel 6
Badge +19

Hi @Housseiny 

For example you can add project customer and name by adding 2 more functions. If you need any information from any window then you can add it by a function into your report. As long as parameters are entered correctly. 

SELECT x.*,

IFSAPP.SUB_PROJECT_API.Get_Description(x.PROJECT_ID, x.SUB_PROJECT_ID) DESCRIPTION,

IFSAPP.PROJECT_API.Get_Customer_Id(x.PROJECT_ID) CUSTOMER_ID,

IFSAPP.CUSTOMER_INFO_API.Get_Name(IFSAPP.PROJECT_API.Get_Customer_Id(x.PROJECT_ID)NAME

FROM PROJECT_FORECAST_ITEM_COST x

You must try different reports from different views so you will practice and understand the basics.

Hope this helps

Userlevel 1
Badge +5

Hi @Housseiny 

For example you can add project customer and name by adding 2 more functions. If you need any information from any window then you can add it by a function into your report. As long as parameters are entered correctly. 

SELECT x.*,

IFSAPP.SUB_PROJECT_API.Get_Description(x.PROJECT_ID, x.SUB_PROJECT_ID) DESCRIPTION,

IFSAPP.PROJECT_API.Get_Customer_Id(x.PROJECT_ID) CUSTOMER_ID,

IFSAPP.CUSTOMER_INFO_API.Get_Name(IFSAPP.PROJECT_API.Get_Customer_Id(x.PROJECT_ID)NAME

FROM PROJECT_FORECAST_ITEM_COST x

You must try different reports from different views so you will practice and understand the basics.

Hope this helps

Hi Gumabs,

                   This is exactly what i needed. Thanks a million!!

Reply