cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <u....@cbim.it>
Subject Re: esql:parameter ?
Date Fri, 27 Sep 2002 10:39:04 GMT
Gabor Bartha wrote:
> Hi all,
> 
> I want to use esql, but I've got problems with <esql:parameter>. It 
> seems the parameter haven't been replaced by its real value.

You cannot have DDL statements with parametrized object names. At least, 
not in Oracle. Use string concatenation, if you must.

	Ugo

> Here is my xsp, with a java function:
> 
> <xsp:logic>
> private String createTable() throws SQLException, org.xml.sax.SAXException
> {
>    String tableName = "tmp123456";
> 
>    //Create table
> 
>    <esql:connection>
>    <esql:driver transactions="no">oracle.jdbc.OracleDriver</esql:driver>
>    <esql:dburl>jdbc:oracle:thin:@localhost:1521:OEMREP</esql:dburl>
>    <esql:username>SCOTT</esql:username>
>    <esql:password>TIGER</esql:password>
>    <esql:execute-query>
>                <esql:query>create table 
> <esql:parameter><xsp:expr>tableName</xsp:expr></esql:parameter>
(id int 
> not null primary key)</esql:query>
>            <!--esql:error-results>
>                    <error><esql:get-message/></error>
>                </esql:error-results-->
>        </esql:execute-query>
>    </esql:connection>
> 
>  return tableName;
> }
> </xsp:logic>
> ...
> ...
> 
> 
> 
> When I call the function from the xsp body I've got the following sql 
> exception:
> 
> Error executing statement: create table ? (cd_id int not null primary 
> key): java.sql.SQLException:
> ORA-00903: invalid table name
> 
> I tried to use the direction="in" with the same result. Any Idea?
> 
> Regards,
> Gabor
> 
> 
> 
> ---------------------------------------------------------------------
> 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:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it


---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message