Skip to Content
0
Former Member
Oct 19, 2008 at 01:22 PM

split dynamic sql

32 Views

Hi All,

I hve a different Requirement, i'm creating a rfc which execute the sql which is given by the client side n these r long single dynamic sql.

MY work is to write a (dynamic)code which split this sql in different small sql acc to their join combinations.

Let's take a exmple suppose i hve a long sql like

SELECT MARCMATNR marcwerks FROM MARC INNER JOIN MARD ON MARDWERKS = MARCWERKS INNER JOIN MARA ON MARCMATNR = MARAMATNR AND MARDMATNR = MARAMATNR WHERE MARCWERKS ='1000' AND MARAMATKL = '001'.

which used three tables MARA,MRAC,MARD in diff join conditions then I hve to split these in three diff sql for MARA MARC & MARD that gives same result as first one.

So wht should be keep in mind to design that issue that these splits sql gives same result as gives single one.

Regards

Anuj