sql connector: dynamic table and column
-
Klaus795 years ago #18549
Is it possible to select a column from a table which is only known at runtime.
I tried that Statement:
SELECT :attribute: as attribute FROM :table: where pernr = :pernr: and begda <= :date: and endda >= :date:
but it runs into error.
Mathieu RollHas successfully completed the online course IntroductionHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Klaus794 years ago #23563::Hi Mathieu,
several months ago when this topic was created I managed it without a dynamic sql but now I have chance to do it without one.
I don’r really understand what you’re thinking of when you say “if you want to create a complete dynamic select you can fill the request parameter with a business object and create the select there”.
I can’t imagine how to execute a complete sql statement imported as string or to take a dynamic sql where-clause as string and execute it.
Could you provide me an example, please?
Best regards
Klaus
Armin WinklerHas successfully completed the online course IntroductionHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)3 years ago #24478::Hi Klaus,
what Mathieu meant was to build the whole SQL statement dynamically inside of a business object script and then pass it to the request parameter of your SQL connector call which must then be left blank in the respective creation dialog field. Basically this will give you the option to treat the SQL statement like an input parameter instead of the request getting taken from the SQL tab of the creation dialog.
Hope this clarifies Mathieu’s suggestion.
Regards,
Armin
You must be logged in to reply to this topic.