Generating SQL expressions

I use Cloudscape for my entity bean. It's just a test.
I run cloudscare -start successfully
but when I try to generate the SQL command in "Deployment Settings..."
and I use jdbc/Cloudscape for database JNDI name, it gives me different error messages on different platform. I could never bring it to work.
following are set in resource.properties
jdbcDataSource.0.name=jdbc/Cloudscape
jdbcDataSource.0.url=jdbc:cloudscape:rmi:CloudscapeDB;create=true
May I have some opinions on what could be wrong?
Thanks,
Sasan

and I use jdbc/Cloudscape for database JNDI name, it
gives me different error messages on different
platform. I could never bring it to work....
May I have some opinions on what could be wrong?...
Depends on the error-messages, I suppose. Maybe you should post them?
[email protected]

Similar Messages

  • First time an SQL expression is placed on report a DB SELECT executes

    The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue). I'm using CR XI.
    Symptom:
    We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
    Some Detective Work/More Info:
    After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
    Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen. I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
    Steps to re-create:
    1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
    2. Add a new "SQL Expression" to your report.
    3. Drag and Drop your new "SQL Expression onto your report
    4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
    The Problem:
    I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
    Questions:
    Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
    Anybody else notice this and have a "work around"?

    This is a cross post of:
    1st time an SQL expression is placed on report a DB SELECT executes
    Please do not cross post. See the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement].
    The above post has been moved to the Crystal Reports Design forum, thus locking this thread.
    Ludek

  • 1st time an SQL expression is placed on report a DB SELECT executes

    The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue).
    Symptom:
    We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
    Some Detective Work/More Info:
    After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
    Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen. I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
    Steps to re-create:
    1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
    2. Add a new "SQL Expression" to your report.
    3. Drag and Drop your new "SQL Expression onto your report
    4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
    The Problem:
    I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
    Questions:
    Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
    Anybody else notice this and have a "work around"?

    Note that this is a "Lagacy Application Development SDKs" forum and as such it is dedicated to topics related to legacy SDKs, including the Report Designer Component (RDC), OCX, VCL, and Crystal Reports Print Engine (CRPE).
    As your issue concerns the Crystal Report Designer (crw32.exe), transferring to the Crystal Reports Design forum:
    SAP Crystal Reports
    Ludek

  • First time an SQL expression is placed on report a DB SELECT executes -CRXI

    The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue).
    Symptom:
    We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
    Some Detective Work/More Info:
    After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
    Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen.  I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
    Steps to re-create:
    1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
    2. Add a new "SQL Expression" to your report.
    3. Drag and Drop your new "SQL Expression onto your report
    4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
    The Problem:
    I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
    Questions:
    Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
    Anybody else notice this and have a "work around"?

    duplicate - please do not post multiple times

  • SQL Expressions in RAD -Getting error during runtime while generating rpt

    Hi
    We have just migrated from WSAD to RAD Version: 7.0.0.7. 
    The issue is: I am getting the error at the runtime when I am trying to use the SQL expression in my one of the report. The SQL Expression feature is not supported by this version of RAD. I checked the Help contents. It says
    Field Objects: SQL expression fields
    This report contains SQL Expression fields. These fields are not visible in this version of the Crystal Reports designer, but they will be evaluated by the system when the report is executed. New SQL Expression fields cannot be created by the designer. SQL Expression fields will remain in the .rpt file after saving and can be edited by other Crystal Reports designers
    To me it seems you can use the 'SQL Expressions' in the report using some Crystal Reports designers and at the runtime it will be evaluated. So I edited my report with some Crystal Reports Designer and tested it on WSAD. It worked fine. Now since we have migrated to RAD, this is an issue since I am getting the following error:
    ERROR [WebContainer : 0] com.crystaldecisions.reports.formatter.formatter.objectformatter - com.crystaldecisions.reports.dataengine.be: Failed to parse expression.
    [12/17/08 15:12:14:750 EST] 0000001c SystemOut     O 15:12:14,671 ERROR [WebContainer : 0] com.businessobjects.reports.sdk.JRCCommunicationAdapter - Failed to export report
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: Failed to parse expression.
         at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
         at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    When I remove the expression fields, it works fine on RAD too.
    I am using following versions:
    RAD Version: 7.0.0.7
    Crystal Reports for Rational Application Developer Version: 11.5.6.v20080304.
    Crystal Report Runtime Support version is 11.8.4.v1094
    Please let me know if somebody has faced the similar issue.
    Any help/suggestions would be appreciated.
    Thanks,
    Kamal

    Hi
    We have just migrated from WSAD to RAD Version: 7.0.0.7. 
    The issue is: I am getting the error at the runtime when I am trying to use the SQL expression in my one of the report. The SQL Expression feature is not supported by this version of RAD. I checked the Help contents. It says
    Field Objects: SQL expression fields
    This report contains SQL Expression fields. These fields are not visible in this version of the Crystal Reports designer, but they will be evaluated by the system when the report is executed. New SQL Expression fields cannot be created by the designer. SQL Expression fields will remain in the .rpt file after saving and can be edited by other Crystal Reports designers
    To me it seems you can use the 'SQL Expressions' in the report using some Crystal Reports designers and at the runtime it will be evaluated. So I edited my report with some Crystal Reports Designer and tested it on WSAD. It worked fine. Now since we have migrated to RAD, this is an issue since I am getting the following error:
    ERROR [WebContainer : 0] com.crystaldecisions.reports.formatter.formatter.objectformatter - com.crystaldecisions.reports.dataengine.be: Failed to parse expression.
    [12/17/08 15:12:14:750 EST] 0000001c SystemOut     O 15:12:14,671 ERROR [WebContainer : 0] com.businessobjects.reports.sdk.JRCCommunicationAdapter - Failed to export report
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: Failed to parse expression.
         at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
         at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    When I remove the expression fields, it works fine on RAD too.
    I am using following versions:
    RAD Version: 7.0.0.7
    Crystal Reports for Rational Application Developer Version: 11.5.6.v20080304.
    Crystal Report Runtime Support version is 11.8.4.v1094
    Please let me know if somebody has faced the similar issue.
    Any help/suggestions would be appreciated.
    Thanks,
    Kamal

  • Generating SQL in a PL/SQL progam ( getting the values of a value)

    Hi,
    We're using Oracle 11.1.
    I want to generate sql to do the following
    something like
    fld_pos(i) = 'MPI';Where fld_pos is part of a varray.
    The basic procedire is below.
    PROCEDURE get_oldest_mpi (
          pin_fld0 VARCHAR2
        , pin_fld1 VARCHAR2
        , pin_fld2 VARCHAR2
        , pin_fld3 VARCHAR2
        , pin_fld4 VARCHAR2
        , pin_fld5 VARCHAR2
        , pin_fld6 VARCHAR2
        , pin_fld7 VARCHAR2
        , pin_fld8 VARCHAR2
        , pin_fld9 VARCHAR2
        , pin_fld10 VARCHAR2
        , pin_fld11 VARCHAR2
        , pin_fld12 VARCHAR2
        , pin_fld13 VARCHAR2
    IS
         TYPE fld IS VARRAY(14) OF VARCHAR2(50);
         fld_pos fld;
         v_sql_stmt VARCHAR2(1000);
         mpi_pos  number;
    BEGIN
    --load the pin_fld vars into an array so they can be processed in a loop
        FOR i IN 1..fld_pos.COUNT
        LOOP
        fld_pos(i) := 'pin_fld'||i;
        END LOOP;
    --see if the variable pin_fld'x' = the word 'MPI'
        FOR i IN 1..fld_pos.COUNT
        LOOP
        IF  fld_pos(i) = 'MPI' then    -- I know this statement is wrong. This is where I need help.
          mpi_pos :=i;
        END IF;
        END LOOP;
    .I know that 'fld_pos(i)' equals 'pin_fld||i .
    So how do I get to the value in the value for this? How can generate the SQL to get the expression I need?
    Thanks,

    Hi,
    It's still an awkward procedure, but
    CREATE OR REPLACE PROCEDURE get_oldest_mpi (
      pin_fld0     VARCHAR2,
      pin_fld1     VARCHAR2,
      pin_fld2     VARCHAR2,
      pin_fld3     VARCHAR2,
      pin_fld4     VARCHAR2,
      pin_fld5     VARCHAR2,
      pin_fld6     VARCHAR2,
      pin_fld7     VARCHAR2,
      pin_fld8     VARCHAR2,
      pin_fld9     VARCHAR2,
      pin_fld10    VARCHAR2,
      pin_fld11    VARCHAR2,
      pin_fld12    VARCHAR2,
      pin_fld13    VARCHAR2
    ) IS
      TYPE fld IS VARRAY (14) OF VARCHAR2 (50);
      fld_pos      fld
                     := fld (pin_fld0,
                             pin_fld1,
                             pin_fld2,
                             pin_fld3,
                             pin_fld4,
                             pin_fld5,
                             pin_fld6,
                             pin_fld7,
                             pin_fld8,
                             pin_fld9,
                             pin_fld10,
                             pin_fld11,
                             pin_fld12,
                             pin_fld13
      v_sql_stmt   VARCHAR2 (1000);
      mpi_pos      NUMBER;
    BEGIN
      --see if the variable pin_fld'x' = the word 'MPI'
      FOR i IN 1 .. fld_pos.COUNT LOOP
        IF fld_pos (i) = 'MPI' THEN
          mpi_pos := i;
        END IF;
      END LOOP;
    END;
    /Regards
    Peter

  • Error in compiling SQL Expression

    In the [Error in SQL Expression; thread, Kurt Reinhardt wrote "Please note, a SQL Expression can only return a single, distinct value per each record in the main recordset.", I tried this where my main Record Selection's SQL query is:
    {GLF_LDG_ACC_TRANS.ldg_name} = {@&CH_LDG_GL_ACT_CURR} and
    {GLF_LDG_ACC_TRANS.period} = {@&CH_PERIOD_GL_CURR} and
    {GLF_LDG_ACC_TRANS.ACCNBRI}  "99991103" and
    {GLF_LDG_ACC_TRANS.DOC_REF1}  "{%SundryCreditors}" and
    {GLF_LDG_ACC_TRANS.DOC_TYPE} = "$APINVCE"
    My SQL Expression %SundryCreditors is:
    select doc_ref1
    from glf_ldg_acc_trans
    where ldg_name = 'APLED09'
      and period = "GLF_LDG_ACC_TRANS"."PERIOD"
      and doc_ref1 = "GLF_LDG_ACC_TRANS"."DOC_REF1"
      and accnbri like 'SUNDRY%'
    which essentially queries the same table as the main recordset using the same key fields, and returns one row only. However, when I click on the Check button in the Formula Workshop window, I get the error message "Error in compiling SQL Expression : Database Connection Error: '42000:MicrosoftODBC SQL Server DriverSQL ServerIncorrect syntax near the keyword 'select'. Database Vendor Code: 156 '".
    Do you know what is my issue?

    If you know what you're doing, you can add a full select statement into a SQL Expression... And Kurt is correct when he says that it may only return a single row of info. Don is also correct when he says that this not what SQL commands are designed for.
    Here's what's happening...
    When you link your tables in the Database Expert and drop fields onto the design surface (and optionally, add criteria to the Select Expert), CR builds out a SQL statement that can is to be sent out to the db server so that the data can be returned. You can view this SQL by going to Database > Show SQL Query...
    When you add a SQL Expression, CR inserts it into the SQL Query as another data column. This is typically done to take advantage of functions that are available in the data base but not in CR.
    A few crafty individuals, like Kurt, have figured out that you can in fact inset a full SELECT query into a SQL Expression and it will be inserted into the CR generated querie's SELECT list as a sub-query.
    Bear in mind 2 things... #1) You have to be familiar with SQL syntax, namely you have to know the proper syntax for using sub-queries in a SELECT list in your data base. #2) CR doesn't officially support is behavior and they won't offer you any help if the current functionality is removed in later versions.
    HTH,
    Jason

  • SQL Expression Fields (Field Explorer dialog box)

    I have Crystal Reports Version XI.  When I open the field explorer I can't see "SQL Expression Fields (Field Explorer dialog box) "
    Please help.

    The following information helps you
    Symptom
    In Crystal Reports 9 and later, the 'SQL Expression Fields' is unavailable in the 'Field Explorer' dialog box. The report is reporting off a stored procedure or command object.
    Why are 'SQL Expression Fields' unavailable in the 'Field Explorer' dialog box?
    Resolution
    'SQL Expression Fields' are unavailable in the 'Field Explorer' dialog box because the report is based on a stored procedure or command object.
    When connecting to a Stored Procedure or using a command object the SQL Statement is predefined and cannot be modified by Crystal Reports therefore the SQL Expression field will not be available when connecting to either of these objects.
    The SQL Expression field works by adding an entry into the SELECT portion of the SQL Statement in a Crystal report. A SQL Expression Field is only available in a report when:
    u2022 The report connects to tables or views.
    u2022 Crystal Reports generates the SQL statement.
    regards,
    Raghavendra

  • Transaction - a few SQL-Expressions

    How can I execute a few SQL-Expressions.
    Only the first SQL-Expression was executed. When i want to execute more SQL-Expressions then I get an Exception.
    OK here is my code:
    I hope its not too much.
    The Connect class is at the end.
    //add col at postgres 7.2 i need to use this version
    public int addCol(String tabname,String tNewArea,String tNewDTyp,
    String tNewLo,String tNewHi,String tNewNull,
    String tNewPK){
    try {
    //Connect class with DriverManager or is DataSource better,
    //but I need to use host,post,dbname,user,pw
    con = Connect.openConnection(host,_port,_dbname,_user,_pw);
    //is this a good way to do this with setAutoCommit
    _con.setAutoCommit(false);
    String sql="ALTER TABLE "+tabname+" ADD COLUMN "+tNewArea+" "+tNewDTyp+check;
    stmt=con.prepareStatement(sql);
    int res=_stmt.executeUpdate();
    //pk exists ?
    String pk=getPrimary(tabname);
    //pk del
    if(tNewPK.equals("Ja")){
    if(pk!=null){
    if(!pk.equals("")){
    sql="DROP INDEX "+tabname+"_pkey";
    stmt=con.prepareStatement(sql);
    System.out.println(_stmt);
    res = _stmt.executeUpdate();
    System.out.println("col:"+res);
    //pk add
    sql="ALTER TABLE "+tabname+" ADD PRIMARY KEY("+tNewArea+")";
    stmt=con.prepareStatement(sql);
    System.out.println(_stmt);
    res =_stmt.executeUpdate();
    System.out.println("pk:"+res);
    Connect.closeConnection(_con,_stmt,_rs);
    _con.commit();
    return 1;
    catch(Exception e) {
    try{
    _con.rollback();
    System.out.println("Transaktion at addCol failed");
    catch(SQLException sql){
    System.out.println("Exception at addCol: "+sql.getMessage());
    finally {
    Connect.closeConnection(_con,_stmt,_rs);
    return -1;
    public class Connect
    //open connection
    public static Connection openConnection(String host,String port,String db,String user,String pw)
    Connection con = null;
    try{
    // Class.forName(driver);
    con = DriverManager.getConnection("jdbc:postgresql://"+host+":"+port+"/"+db,user,pw);
    return con;
    catch (SQLException e) {
    System.out.println("Exception in openConnection: "+e.getMessage());
    catch (Exception exc){
    return con;
    //close connection
    public static void closeConnection (Connection con, PreparedStatement stmt, ResultSet rs) {
    if (rs != null) {
    try {
    rs.close();
    catch (SQLException e) {}
    if (stmt != null) {
    try {
    stmt.close();
    catch (SQLException e) {}
    if (con != null) {
    try {
    con.close();
    catch (SQLException e) {}
    Many thanks in advance
    Olaf

    Did you check wat kind of exception you are getting? May be the first sql statement itself is generating some db error which results in an exception being thrown.

  • Validating an sql expression

    Hi,
    I am using Oracle Forms 10.2.0.1.0 and Oracle 10g Database.
    My application has given the user option to create sql expressions and get the result as TRUE or FAlLSE.
    Is there any way i could validate the expression to make sure the syntax is correct.?
    If the user select the table as emp
    emp_no and Salary are column in emp table
    and the expression created is count(emp_no)* Salary >1000
    i will using it in if else statement to return True or false
    ie
    if count(emp_no)* Salary >1000 Then
    return True
    else
    return False;
    end if;
    Can someone suggest me a way to evaluate the expression generated by the user is syntactically correct or not
    Edited by: user8783669 on Dec 16, 2009 1:23 AM

    Hello,
    You can use the EXEC_SQL Forms internal package, but you cannot use aggregation function like COUNT, SUM, etc...
    Create this program unit:
    FUNCTION Check_SQL_Syntax ( PC$Clause  IN Varchar2 )
    RETURN VARCHAR2
    IS
      cursor_number EXEC_SQL.CursType;
      LC$sql_order   Varchar2(256);
    BEGIN
         -- Open the cursor --
         cursor_number := Exec_SQL.Open_cursor;
         -- build the complete SQL order -- 
         LC$sql_order := 'Select 1 From EMP Where ' || PC$clause  ;
         -- Parse the SQL order --
         EXEC_SQL.PARSE(cursor_number, LC$sql_order);
         Return 'OK' ;
         -- Close the cursors
         EXEC_SQL.CLOSE_CURSOR(cursor_number);
    EXCEPTION
      When EXEC_SQL.INVALID_CONNECTION Then
         Return 'Unexpected Invalid Connection error from EXEC_SQL';
      When EXEC_SQL.PACKAGE_ERROR Then
        return 'Unexpected error from EXEC_SQL: '||to_char(EXEC_SQL.LAST_ERROR_CODE)|| EXEC_SQL.LAST_ERROR_MESG;
      When Others Then
        return SQLERRM;
    END;That you can call with the following example:
    Declare
         res Varchar2(32000);
    Begin     
    res := Check_SQL_Syntax('empno * Sal >1000');
    message('res:' || res, no_acknowledge);
    End;Francois

  • Preview generated SQL

    Hi,
    Is there a way to view the SQL that would result from an Expression without actually executing the query via a session with logging turned on?
    regards
    George

    Here is my Code:
    ExpressionBuilder e = new ExpressionBuilder(MYClass.class);
    ReportQuery q = new ReportQuery(e);
    q.setReferenceClass(MYClass.class);
    q.dontRetrievePrimaryKeys();
    q.addAttribute(_MY_ATTR1);
    q.addAttribute(_MY_ATTR2, e.get(_MYREF).get(_MY_ATTR2));
    q.addSum(_OTHER_AGGREG_ATTRIB1);
    q.addSum(_OTHER_AGGREG_ATTRIB2);
    q.dontUseDistinct();
    Expression exp = e.get(_MY_ATTR1).equal(myInputVal_for_attr1);
    exp = exp.and(e.get(_MYREF).get(_MY_ATTR2).equal(myInputVal_for_attr2));
    oracle.toplink.publicinterface.DatabaseRow dbRow = new oracle.toplink.publicinterface.DatabaseRow();
    oracle.toplink.publicinterface.DatabaseSession dbSession = (oracle.toplink.publicinterface.DatabaseSession)MyAppServer.getTheServerSession();
    q.prepareCall(dbSession, dbRow);
    String sqlTrStr = q.getTranslatedSQLString(dbSession, dbRow);
    Problem:
    It works fine, but it includes ???? against all the given parameters.
    Upon debugging, I found that the dbRow was not filled and the query(q) always generates SQL with ????, whereas q.getCall().getParameters() holds all the parameters.
    Can any one please give me the final tip to get the custom SQl to solve this final step.
    Thanks
    A.T

  • Error: while generating SQL.java.rmi.ServerException:

    Hi:
    I tried the JGuru's "MusicStore" example. HOwever at Task 6 and 7 I am getting the following error:
    Error: while generating SQL.java.rmi.ServerException:
    RemoteException occured in server thread; nested exception is:
    * java.rmi.RemoteException: Error connecting to database;
    nested exception is:
    * SQL Exception: Failed to start database 'MusicStoreDB', see
    the next exception for details.
    Please make sure the database name/user/password is valid
    and the J2ee server and database are running.
    However when i check my database it is running perfectly:
    E:\>%j2ee_home%\bin\cloudscape -start
    Sun Feb 16 12:48:11 PST 2003: [RmiJdbc] Starting Cloudscape RmiJdbc Server Version
    Sun Feb 16 12:48:14 PST 2003: [RmiJdbc] COM.cloudscape.core.JDBCDriver registered i
    Sun Feb 16 12:48:14 PST 2003: [RmiJdbc] Binding RmiJdbcServer...
    Sun Feb 16 12:48:14 PST 2003: [RmiJdbc] No installation of RMI Security Manager...
    Sun Feb 16 12:48:14 PST 2003: [RmiJdbc] RmiJdbcServer bound in rmi registry
    Server:
    J2EE server listen port: 1050
    Naming service started:1050
    Binding DataSource, name = jdbc/DB2, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
    te=true
    Binding DataSource, name = jdbc/Cloudscape, url = jdbc:cloudscape:rmi:Cloudscape
    DB;create=true
    Binding DataSource, name = jdbc/InventoryDB, url = jdbc:cloudscape:rmi:Cloudscap
    eDB;create=true
    Binding DataSource, name = jdbc/DB1, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
    te=true
    Binding DataSource, name = jdbc/MusicStore, url = jdbc:cloudscape:rmi:MusicStore
    DB;create=false
    Binding DataSource, name = jdbc/XACloudscape, url = jdbc/XACloudscape__xa
    Binding DataSource, name = jdbc/XACloudscape__xa, dataSource = COM.cloudscape.co
    re.RemoteXaDataSource@1d88db7
    Starting JMS service...
    Initialization complete - waiting for client requests
    Binding: < JMS Destination : jms/Topic , javax.jms.Topic >
    Binding: < JMS Destination : jms/Queue , javax.jms.Queue >
    Binding: < JMS Cnx Factory : TopicConnectionFactory , Topic , No properties >
    Binding: < JMS Cnx Factory : QueueConnectionFactory , Queue , No properties >
    Binding: < JMS Cnx Factory : jms/QueueConnectionFactory , Queue , No properties
    >
    Binding: < JMS Cnx Factory : jms/TopicConnectionFactory , Topic , No properties
    >
    Starting web service at port: 8000
    Starting secure web service at port: 7000
    J2EE SDK/1.3.1
    Starting web service at port: 9191
    J2EE SDK/1.3.1
    J2EE server startup complete.
    Can anyone suggest me a way out..plz

    what type of persistent u r using also post ur query if bmp and check with another example with cmp.

  • SQL Expression in decode function or case statement?

    Can I put SQL expressions in decode function or case statement?
    For example,
    select le.profile, decode( select count(1) from profile_data where NAME= 'XXXX_AFTER' and object_id = le.profile, 0, 'N', 'Y')
    from element le;
    or
    select le.profile, case WHEN ( select count(1) from profile_data where NAME= 'XXXX_AFTER' and object_id = le.profile) = 0 THEN 'N'
    ELSE 'Y'
    from element le;
    None of the above work.
    Can anyone tell me how to make it work?
    Is there any workaround?
    Thanks,
    J

    You simply needed and END to your CASE statement;
    SQL> with profile_data as (
       select 'XXXX_AFTER' name, 1 object_id from dual),
         element as (
       select 1 profile from dual union all
       select 2 from dual)
    select le.profile,
       case WHEN ( select count(1) from profile_data where NAME= 'XXXX_AFTER' and object_id = le.profile) = 0
       THEN 'N'
       ELSE 'Y'
       END new_col
    from element le
       PROFILE N
             1 Y
             2 N

  • NOT ABLE TO SEE SQL EXPRESSION FIELDS IN CR2008

    Hi,
    I am not able to see the SQL EXPRESSION FIELDS in the FIELD EXPLORER of CR 2008.Can
    you please help me
    BABASHARI

    Hi,
    I would suggest you open the question in the Crystal Reports forum.
    Ingo

  • Weird behavior: PLSQL-generated SQL Report Region

    I am trying to tune my PLSQL-generated SQL Report Region. I put in some code to write the resulting query to a table. I turn it on, run the page, and then turn it off and look at the SQL. Instead of getting one query for each time I load the page, I get five. Trying to find out a bit more about why, I concatenate :APP_USER and to_char(sysdate, 'hh:mi:ss') to the resulting SQL. What I find is that four of the entries in the table have my ApEx dev username, and all of these writes are 3 seconds before the SQL generated under the app username is written!
    It probably goes without saying, but in all of the writes under my dev username, there are no session values and so any PLSQL if statements that depend on a session value act as if the session values are null. Also, any place I have :APP_ID show up as 4000 in those writes instead of the app number that shows up under my app username.
    Do you follow this?
    Well, on a hunch I copied the whole region back on to the page and disabled the original. This time, no writes with the dev username, only one select statement as originally expected.
    Is that wierd or what?
    Bill

    Scott, Your last comment - that was it. I should've paid more attention to the time. The minutes must have been off. I made sure to log out of the dev environment before I ran the page, but the writes under my dev login were occurring when I saved the region. I still don't see why that process causes four identical writes, but it's not that important.
    Thanks! Now I can to working on the real problem - improving my SQL.
    Bill

Maybe you are looking for