RE: Getting parameters to SQLTransformer

2002-06-24 Thread Luca Morandini

Argyn,

here's a snippet of a stylesheet (let's pretend name-clean contains the given 
parameter, be it a session, request or static
parameter), which dynamically builds a stored procedure invokation for SQLTransformer 
to execute:



true
getproductsbyname
begin Noria.GetProductsByName('',
   
 ?, ?); end;



1
curProd
oracle.jdbc.driver.OracleTypes.CURSOR



2
intStatus
oracle.jdbc.driver.OracleTypes.INTEGER




As you may see, there is an input parameter (name-clean, a string) and two output 
ones, a cursor and a status code.

BTW, name-clean has been already "cleaned" (apostrophes aubstituted with double 
apostrophes), and, of course, Oracle is the DBMS of
choice.

Best regards,

-
   Luca Morandini
   GIS Consultant
  [EMAIL PROTECTED]
http://utenti.tripod.it/lmorandini/index.html
-


> -Original Message-
> From: Argyn Kuketayev [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 24, 2002 11:11 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Getting parameters to SQLTransformer
>
>
>
>
> > -Original Message-
> > From: Luca Morandini [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, June 24, 2002 4:41 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Getting parameters to SQLTransformer
> > What I would suggest is the use of stored procedures, with an
> > XSL building
> > the statement, hence:
>
> can you explain what do you mean in more details?
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: Getting parameters to SQLTransformer

2002-06-24 Thread Argyn Kuketayev



> -Original Message-
> From: Luca Morandini [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 24, 2002 4:41 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Getting parameters to SQLTransformer
> What I would suggest is the use of stored procedures, with an 
> XSL building
> the statement, hence:

can you explain what do you mean in more details?

-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: Getting parameters to SQLTransformer

2002-06-24 Thread Lajos Moczar

Hi Luca -

I agree that the SPs are the way to go - when I was a DBA, I used to 
enforce their use all the time. What I was after here was to include 
sitemap/request/session parameters into the XML file during the 
generation phase, so that the complete query would be passed to the 
transformer. I have gone the XSL route before, and I guess that is what 
I'll stick with now.

Thanks,

Lajos


Luca Morandini wrote:

> Lajos,
> 
> the substitution in SQL Transformer uses parameters defined in the sitemap,
> which don't fit your bill I presume...
> 
> ...but, being it a transformer, you can feed it any SQL you have built from
> whatever source (XSL, XSP, plain XML file, ...), including any parameters of
> your choice.
> This is not the same as "dynamic parameters" though, it is like "dynamic
> SQL".
> 
> What I would suggest is the use of stored procedures, with an XSL building
> the statement, hence:
> 1) max flexibility in the value of parameters (build them as you like, from
> whatever source you like)
> 2) min performance penalty (the real SQLs are already been parsed when the
> stored procedure was submitted to the DBMS)
> 
> Not to mention the SoC it enforces.
> 
> And if your DBMS doesn't support SPs ? Use dynamic SQL by using stylesheets
> or XSPs: after all, this is what a lot of people does with ASP anyway.
> 
> Hope this helps,
> 
> -
>Luca Morandini
>GIS Consultant
>   [EMAIL PROTECTED]
> http://utenti.tripod.it/lmorandini/index.html
> -
> 
> 
> 
>>-Original Message-----
>>From: Lajos Moczar [mailto:[EMAIL PROTECTED]]
>>Sent: Monday, June 24, 2002 10:18 PM
>>To: [EMAIL PROTECTED]
>>Subject: Getting parameters to SQLTransformer
>>
>>
>>I think I know the answer, but is there any way to construct dynamic
>>queries using SQLTransformer? Specifically, I'd like to build the where
>>clause of my query using either a session attribute or a sitemap
>>parameter. I've been thru the code and don't see that it can be done,
>>but I thought I'd ask just the same ... I'm on 2.0.2.
>>
>>Regards,
>>
>>Lajos
>>
>>--
>>galatea.com
>>Cocoon training, consulting & support
>>
>>
>>
>>-
>>Please check that your question  has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>>
>>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>>For additional commands, e-mail:   <[EMAIL PROTECTED]>
>>
> 
> 
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
> 
> 


-- 
galatea.com
Cocoon training, consulting & support



-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: Getting parameters to SQLTransformer

2002-06-24 Thread Luca Morandini

Lajos,

the substitution in SQL Transformer uses parameters defined in the sitemap,
which don't fit your bill I presume...

...but, being it a transformer, you can feed it any SQL you have built from
whatever source (XSL, XSP, plain XML file, ...), including any parameters of
your choice.
This is not the same as "dynamic parameters" though, it is like "dynamic
SQL".

What I would suggest is the use of stored procedures, with an XSL building
the statement, hence:
1) max flexibility in the value of parameters (build them as you like, from
whatever source you like)
2) min performance penalty (the real SQLs are already been parsed when the
stored procedure was submitted to the DBMS)

Not to mention the SoC it enforces.

And if your DBMS doesn't support SPs ? Use dynamic SQL by using stylesheets
or XSPs: after all, this is what a lot of people does with ASP anyway.

Hope this helps,

-
   Luca Morandini
   GIS Consultant
  [EMAIL PROTECTED]
http://utenti.tripod.it/lmorandini/index.html
-


> -Original Message-
> From: Lajos Moczar [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 24, 2002 10:18 PM
> To: [EMAIL PROTECTED]
> Subject: Getting parameters to SQLTransformer
>
>
> I think I know the answer, but is there any way to construct dynamic
> queries using SQLTransformer? Specifically, I'd like to build the where
> clause of my query using either a session attribute or a sitemap
> parameter. I've been thru the code and don't see that it can be done,
> but I thought I'd ask just the same ... I'm on 2.0.2.
>
> Regards,
>
> Lajos
>
> --
> galatea.com
> Cocoon training, consulting & support
>
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Getting parameters to SQLTransformer

2002-06-24 Thread Lajos Moczar

I think I know the answer, but is there any way to construct dynamic 
queries using SQLTransformer? Specifically, I'd like to build the where 
clause of my query using either a session attribute or a sitemap 
parameter. I've been thru the code and don't see that it can be done, 
but I thought I'd ask just the same ... I'm on 2.0.2.

Regards,

Lajos

-- 
galatea.com
Cocoon training, consulting & support



-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>