You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mauro Velasco <mv...@hotmail.com> on 2001/08/05 19:00:43 UTC

ESQL - select * from any_table

Hi all,

I'm using ESQL with (Tomcat 3.2.1, Cocoon 1.8.2, WinNT 4 sp6), and need 
select all rows from any table, but I noticed before need know the columns 
the be retrieved, exist a form to make this query. I'm usign Oracle 8.1.6, 
Sql Server 7 and Mysql.

Any help is great...

Thanks in advanced

Mauro


_________________________________________________________________
Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp


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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Quotes in query

Posted by Sylvain Wallez <sy...@anyware-tech.com>.

Sébastien Lefebvre wrote:
> 
> Sylvain ,
> 
> Thank you  for your prompt answer.
> As far as I'm new to Cocoon, could you send me a piece of code ?
> It will help me very much.
> 
> Thanks again
> 
> Sébastien
> 
> >
> >Sébastien Lefebvre wrote:
> >
> >>Hi all,
> >>
> >>I have a form where I can type text.
> >>The form is submited  with post method to a xsp page.
> >>This texte can of course have quotes in it. ex:  I'd like this to work
> >>How to insert it in MySQL ?
> >>Do I have to write XSP logic in order to replace ' by \'    ?
> >>Or is there any other solution ?
> >>(I'd like to make the operation server side so javascript's regexp is
> >>not an issue for me).
> >>
> >>Thanks in advance
> >>Sébastien
> >>
> >Use a PreparedStatement to insert your String, the JDBC driver will take
> >care of this if needed. This will also increase the portability of your
> >code, since escaping syntax varies between databases.
> >
> 
If you're using JDBC calls, you should have a look at the dedicated
section of the excellent Java tutorial at
http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html
It is explained here certainly better than I could do !

If you're using the esql logicsheet, I cannot be of great help since I
don't use it, but Christian told that <esql:parameter> generates
prepared statements.
-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com

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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Quotes in query

Posted by Sébastien Lefebvre <sl...@i2m.fr>.
Sylvain ,

Thank you  for your prompt answer.
As far as I'm new to Cocoon, could you send me a piece of code ?
It will help me very much.

Thanks again

Sébastien

>
>Sébastien Lefebvre wrote:
>
>>Hi all,
>>
>>I have a form where I can type text.
>>The form is submited  with post method to a xsp page.
>>This texte can of course have quotes in it. ex:  I'd like this to work
>>How to insert it in MySQL ?
>>Do I have to write XSP logic in order to replace ' by \'    ?
>>Or is there any other solution ?
>>(I'd like to make the operation server side so javascript's regexp is
>>not an issue for me).
>>
>>Thanks in advance
>>Sébastien
>>
>Use a PreparedStatement to insert your String, the JDBC driver will take
>care of this if needed. This will also increase the portability of your
>code, since escaping syntax varies between databases.
>




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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Quotes in query

Posted by Sylvain Wallez <sy...@anyware-tech.com>.

Sébastien Lefebvre wrote:
> 
> Hi all,
> 
> I have a form where I can type text.
> The form is submited  with post method to a xsp page.
> This texte can of course have quotes in it. ex:  I'd like this to work
> How to insert it in MySQL ?
> Do I have to write XSP logic in order to replace ' by \'    ?
> Or is there any other solution ?
> (I'd like to make the operation server side so javascript's regexp is
> not an issue for me).
> 
> Thanks in advance
> Sébastien
> 
Use a PreparedStatement to insert your String, the JDBC driver will take
care of this if needed. This will also increase the portability of your
code, since escaping syntax varies between databases.
-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com



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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Quotes in query

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 06.Aug.2001 -- 10:23 AM, Sébastien Lefebvre wrote:
> Hi all,
> 
> I have a form where I can type text.
> The form is submited  with post method to a xsp page.
> This texte can of course have quotes in it. ex:  I'd like this to work
> How to insert it in MySQL ?
> Do I have to write XSP logic in order to replace ' by \'    ?
> Or is there any other solution ?
> (I'd like to make the operation server side so javascript's regexp is 
> not an issue for me).

I *think* a prepared statement doesn't care about a string's
content. Use <esql:parameter> in a query to get code that uses
a prepared statement.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Quotes in query

Posted by Sébastien Lefebvre <sl...@i2m.fr>.
Hi all,

I have a form where I can type text.
The form is submited  with post method to a xsp page.
This texte can of course have quotes in it. ex:  I'd like this to work
How to insert it in MySQL ?
Do I have to write XSP logic in order to replace ' by \'    ?
Or is there any other solution ?
(I'd like to make the operation server side so javascript's regexp is 
not an issue for me).

Thanks in advance
Sébastien





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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: ESQL - select * from any_table

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 05.Aug.2001 -- 12:00 PM, Mauro Velasco wrote:
> Hi all,
> 
> I'm using ESQL with (Tomcat 3.2.1, Cocoon 1.8.2, WinNT 4 sp6), and need 
> select all rows from any table, but I noticed before need know the columns 
> the be retrieved, exist a form to make this query. I'm usign Oracle 8.1.6, 
> Sql Server 7 and Mysql.

You're right, you need to know your columns in advance -- but you
could refer to them by number as well. This way it's a bit easier to
do it.

The CVS version (2.1) allows for expressions to refer to columns as
well. I will propably check it in for 2.0 as well today.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>