Skip to main content
Solved

How to retrieve SQL columns having API in SQL query


Forum|alt.badge.img+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

Best answer by Furkan Zengin

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

View original
Did this topic help you find an answer to your question?

6 replies

Furkan Zengin
Superhero (Partner)
Forum|alt.badge.img+21
  • Superhero (Partner)
  • 697 replies
  • Answer
  • May 17, 2023

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


Forum|alt.badge.img+5
  • Author
  • Sidekick (Customer)
  • 11 replies
  • May 17, 2023
gumabs wrote:

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


Furkan Zengin
Superhero (Partner)
Forum|alt.badge.img+21
  • Superhero (Partner)
  • 697 replies
  • May 17, 2023

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


Forum|alt.badge.img+5
  • Author
  • Sidekick (Customer)
  • 11 replies
  • May 17, 2023

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


Furkan Zengin
Superhero (Partner)
Forum|alt.badge.img+21
  • Superhero (Partner)
  • 697 replies
  • May 17, 2023

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


Forum|alt.badge.img+5
  • Author
  • Sidekick (Customer)
  • 11 replies
  • May 18, 2023
gumabs wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings