Check SQL statement in BI

Hi all.
I've wrote some SQL statement against charcteristic Master Data table in Transfer Routine to get the result for attribute value. It seems to me my SQL statement doesn't work. Is where any transation/tool in BI to run/check SQL statements ?

hi,
you can always check the syntax after writing a routine.Also, you can put a break-point and debug to check the behavior of the code.
Can u explain in more detail, what is the Statement that is giving problem?
Regards,
Srinivas Kamireddy.

Similar Messages

  • Check sql statement status

    Hi,
    this is the code:
    Statement stmt;
    try {
        stmt = conn.createStatement();
        //do some stuff
        stmt.close();
    catch( SQLException e ) {
         if(stmt.isClose()) {
               System.out.println( "The statement has been closed!" );
         else {
               System.out.println("The statement has not been closed!" );
               stmt.close();
    }Sure, there is no method ( stmt.isClose() ).... I have read the api. But how do you check whether the statement has been closed or not???? I got temporary solution. By giving null value then check whether the stmt has null value or not.... but that is not elegant.
    Thank you.

    You don't need to worry about it. As per the javadocs, closing a closed Statement has no effect. That said, however, you should move your close() call outside both of those locations into a finally {} block at the end.

  • Procedure not checking each sql statement.

    Hi All,
    I have created 2 tables names are A1 and B1. A1 table has some fields. Fields are no,sal,comm.,load_date. In A1 table NO (column) is the primary key.
    Second table is B1. this table has id,phone_no and load_date. In this table constraint
    ID column is the Not null.
    After that I have created 2 procedures one for A1 and one for B1. with in those procedures I used SQL insert statements.
    In procedures I used some valid sql statements and some invalid statements ( invalid statements means that I have specified constraint that’s why I specified duplicated and null values). While executing the procedures procedure shows error because of invalid statement and in that procedures I did not specify any Exceptions.
    If I specify Exceptions in procedures executing successfully some records are not loading procedure is comeing out. How do we mention server needs to be check and every insert sql startement.
    EX:
    If I give 6 records from 1 to 3 valid statements. I mentioned 4 th record copy of previos record( duplicated). 5 th record and 6 th valid records.
    Procedure executing successfully. Procedure loaded 1 to 4 records after that not loaded 5,6 and 7 records. How do we specify for record inserts 7. actually 7 th record is valid statement we should be insert this record. Please tell me how do we handle sql statements each and every one successfully or not.
    create or replace procedure a_proc as
    --declare
    begin
    insert into a1 values (100,2000,300,sysdate);
    insert into a1 values(200,1000,400,sysdate);
    insert into a1 values(300,3000,500,sysdate);
    insert into a1 values(400,6000,600,sysdate);
    insert into a1 values(400,900,700,sysdate);
    insert into a1 values(400,10000,1200,sysdate);
    insert into a1 values(900,11000,1300,sysdate);
    commit;
    EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ERROR - '||sqlerrm);
    end a_proc;
    In B1 table colums are ID,PHONE_NO and Load_date. ID is not null column.
    For B1 population I have created one procedure
    create or replace procedure b_proc as
    --declare
    begin
    insert into b1 values(1,123456,sysdate); -- 1 record
    insert into b1 (phone_no,load_date) values (7896538,sysdate); --2 record
    insert into b1 (phone_no) values(6763723458); ----3 record
    insert into b1 (phone_no) values(453465778); --4 record
    insert into b1 values(400,72894894,sysdate); --5 record
    insert into b1 values(500,72894894,sysdate); --6 record
    commit;
    EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ERROR - '||sqlerrm);
    end b_proc;
    if I execute above procedure procedure executing successfully but procedure inserting only first record not inserting 5th and 6th record. How do we exception for 5th and 6th records also.
    Thanks and Regards,
    Venkat

    {color:#808080}{color:#333300}Hi,
    Please find answer to your question below:{color}
    Venkat: Procedure executing successfully. Procedure loaded 1 to 4 records after that not loaded 5,6 and 7 records. How do we specify for record inserts 7. actually 7 th record is valid statement we should be insert this record. Please tell me how do we handle sql statements each and every one successfully or not.
    {color}
    {color:#0000ff}Guna: The procedure hits an exception after 4th record, and does not process anymore as it exits out of the procedure, I believe the data is not committed as well. You need handle exceptions if the processing has to continue. Same is the belwo case as well
    {color}{color:#333300}Regards,
    Guna{color}

  • Can normal sql statement check thru all occurance ?

    Hi ,
    i have the following sample data
    A)
    select * from tt_test11 ;
            IDX1     CREATION_DATE
    1     1     12/4/2006 11:00:23 AM
    2     1     12/1/2006 11:00:23 AM
    3     1     11/1/2006 11:00:23 AM
    B)
    select * from tt_test12
            IDX1     STARTTIME     ENDTIME
    1     1     12/4/2006 10:00:23 AM     12/5/2006 1:00:23 AM
    2     1     12/1/2006 10:00:23 AM     12/3/2006 1:00:23 AM
    3     1     11/1/2006 10:00:23 AM     11/5/2006 1:00:23 AM
    C)
    select  * from tt_test11 a
    where exists (select null from tt_test12 b
    where a.idx1 = b.idx1
    and a.creation_date not between b.starttime and b.endtime )
            IDX1     CREATION_DATE
    1     1     12/4/2006 11:00:23 AM
    2     1     12/1/2006 11:00:23 AM
    3     1     11/1/2006 11:00:23 AMwhat i want to acheive :
    i want to return all records from tt_test11 only when all records has been matched and there's no record that exists in the range from tt_test12
    if seems that from part C , that it'll return a record as long as record from tt_test11 is not matched against a record in tt_test12
    and i am now doing a function to check against all record in tt_test12 and return a flag to indicate whether the record from tt_test11 does not exist in tt_test12
    but how can i do that in using SQL statements alone ?
    pls advise
    tks & rgds

    I hope i have got your requirement right now. Is this what you want?
    SQL> create table tt_test11
      2  as
      3  (select 1 IDX1,to_date('12/4/2006 11:00:23 AM','dd/mm/yyyy hh:mi:ss AM') CREATION_DATE from dual
      4  union all
      5  select 1,to_date('12/1/2006 11:00:23 AM','dd/mm/yyyy hh:mi:ss AM') from dual
      6  union all
      7  select 1,to_date('11/12/2006 11:00:23 AM','dd/mm/yyyy hh:mi:ss AM') from dual
      8  )
      9  /
    Table created.
    SQL> create table tt_test12
      2  as
      3  (
      4  select 1 IDX1,to_date('12/4/2006 10:00:23','dd/mm/yyyy hh:mi:ss') STARTTIME,to_date('12/5/2006 1:00:23 AM','dd/mm/yyyy hh:mi:ss AM') ENDTIME
    from dual
      5  union all
      6  select 1,to_date('12/1/2006 10:00:23 AM','dd/mm/yyyy hh:mi:ss AM'),to_date('12/3/2006 1:00:23 AM','dd/mm/yyyy hh:mi:ss AM')  from dual
      7  union all
      8  select 1,to_date('11/1/2006 10:00:23 AM','dd/mm/yyyy hh:mi:ss AM'),to_date('11/5/2006 1:00:23 AM','dd/mm/yyyy hh:mi:ss AM')  from dual
      9  )
    10  /
    Table created.
    SQL> alter session set nls_date_format='dd/mm/yyyy hh:mi:ss AM'
      2  /
    Session altered.
    SQL> select * from tt_test11
      2  /
          IDX1 CREATION_DATE
             1 12/04/2006 11:00:23 AM
             1 12/01/2006 11:00:23 AM
             1 11/12/2006 11:00:23 AM
    SQL> select * from tt_test12
      2  /
          IDX1 STARTTIME              ENDTIME
             1 12/04/2006 10:00:23 AM 12/05/2006 01:00:23 AM
             1 12/01/2006 10:00:23 AM 12/03/2006 01:00:23 AM
             1 11/01/2006 10:00:23 AM 11/05/2006 01:00:23 AM
    SQL> select distinct idx1,CREATION_DATE
      2  from
      3  (
      4  select a.idx1,b.CREATION_DATE,a.STARTTIME,a.endtime,
      5         sum(case when b.CREATION_DATE between a.STARTTIME and a.endtime then 1 else 0 end )
      6         over(partition by a.idx1,b.CREATION_DATE) flag
      7  from tt_test12 a,tt_test11 b
      8  where a.idx1=b.idx1
      9  )
    10  where flag=0
    11  /
          IDX1 CREATION_DATE
             1 11/12/2006 11:00:23 AMMessage was edited by:
    Mohana

  • How can I write a SQL statement which checks if a table exists?

    How can I write a SQL statement which tells me whether a table exists?

    execute an sql query: select * from <tablename>
    catch the exception n check whether the erroe code
    matches the one that occurs for table doesn't exist
    that's itHow is your answer any different from the one given in the first reply?
    It isn't.
    As WorkForFood says DatabaseMetaData has a bunch of methods for getting information about tables but this is more useful when you don't know the names of any of the tables.. it sounds like you do so I would concur SELECT from table is probably the quickest way to go. If it helps the Xopen error should be either S1000 or 42S01 (I think) but I would try and see if there is a specific vendor code for table not found/not exists error and check for that.

  • Check the validity of a SQL statement before execution

    Hi everyone,
    In an applet I have created, I am allowing the user to create a SQL statement which will be sent to a servlet that in turn issues the JDBC request for the SQL statement. My concern is that since my GUI lets the user create more or less any kind of SQL statement (including an illegal one) I need to verify if the user has created the correct SQL. How can this be achieved?
    To recapitulate and summarize, I need to know how I can check the validity of a SQL statement without actually executing it and handling the SQLException. FYI, I am using the mm-mysql driver.
    Thanks,
    Alan

    jschell is correct. Unless you're writing something like an ISQL tool you want to be very careful doing this.
    Having said that Mimer SQL have SQL validators that may do what you want http://developer.mimer.com/validator/index.htm
    They've also got the SQL Validator running as a web service that you can use. Theres example code here showing how to use it.
    http://sqlvalidator.mimer.com/index.html
    At the risk of being accused of selfpromotion you can check out the SQL Validator plugin for SQuirreL SQL CLient. This is a fully functional example of using the Mimer SQL Validation web service. http://squirrel-sql.sourceforge.net/
    Col

  • SQL check result of the sql statement

    hello gurus, i have this sql statement:
    select MyTableColumn_PDF_File
    from Database.dbo.MyTableName
    where coalesce( MyTableColumn_PDF_File,' ') is null;
    so basically, it works fine on sql management studio.
    But what if I used this command on vb.net, how do I check whether the column is null or not?
    Any help is greatly appreciated.
    Thanks. :)
    Every second counts..make use of it. Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    IT Stuff Quick Bytes

    Dim con As New SqlClient.SqlConnection("connectionstring")
    Dim DR As SqlClient.SqlDataReader = Nothing
    Try
    con.Open()
    Dim cmd As New SqlClient.SqlCommand("select COUNT(*) AS TotalNull " & _
    "from Database.dbo.MyTableName " & _
    "where MyTableColumn_PDF_File is null", mSQLConnection)
    DR = cmd.ExecuteReader()
    If DR.Read Then
    '' found rows
    If CInt(DR.Item("TotalNull")) <> 0 Then
    '' We have more than 1 row that is not null
    End If
    Else
    '' not found nows
    End If
    Catch ex As Exception
    ''' oops
    Finally
    If Not IsNothing(DR) Then
    If Not DR.IsClosed Then DR.Close()
    DR = Nothing
    End If
    If Not IsNothing(con) Then
    If con.State = ConnectionState.Open Then con.Close()
    con = Nothing
    End If
    End Try
    This is a more complete example

  • Check the sql statement of view

    HI All
    I have a query that
    How can we check the SQL statement of any view in oracle 10.
    If any one knows then pls let me know

    SQL> select view_name,text from user_views where VIEW_NAME='HISTORY';
    VIEW_NAME
    TEXT
    HISTORY
    select
    Serial,
    0 State,
    Availablet At,
    AvailableD

  • Single SQL statement that does multiple column checks

    I have multiple sql statements (see below) that do value and format checking on different columns within the same table. I am trying to condense these checks into one SQL statement, anyone know how to do this?
    select colx, coly, col1 from table1 where col1 not in ('A','B','C')
    select colx, coly, col2 from table1 where col2 not in ('X','Y','Z')
    etc
    Note that I am looking for the value of the offending column (e,g col1 or col2) as the last of the three columns outputted,
    Thanks in advance

    Perhaps;
    SQL> create table t (colx number, coly number, col1 varchar2(1),
       col2 varchar2(1), col3 varchar2(1), col4 varchar2(1))
    Table created.
    SQL> insert all
       into t values(1,1,'A','D','G','J')
       into t values(1,2,'*','D','G','J')
       into t values(1,3,'A','D','G','J')
       into t values(1,4,'A','*','G','J')
       into t values(1,5,'A','D','G','J')
       into t values(1,6,'A','D','*','J')
       into t values(1,7,'A','D','G','J')
       into t values(1,8,'_','-','/','*')
    select * from dual
    8 rows created.
    SQL> select colx, coly,
       trim(regexp_replace('Col1' || col1,'(Col1)([^A|B|C])|(Col1)([A|B|C])', '\1 ') ||
            regexp_replace('Col2' || col2,'(Col2)([^D|E|F])|(Col2)([D|E|F])', '\1 ') ||
            regexp_replace('Col3' || col3,'(Col3)([^G|H|I])|(Col3)([G|H|I])', '\1 ') ||
            regexp_replace('Col4' || col4,'(Col4)([^J|K|L])|(Col4)([J|K|L])', '\1')) offending_column,
       trim(regexp_replace(col1,'([^A|B|C])|([A|B|C])', '\1 ') ||
            regexp_replace(col2,'([^D|E|F])|([D|E|F])', '\1 ') ||
            regexp_replace(col3,'([^G|H|I])|([G|H|I])', '\1 ') ||
            regexp_replace(col4,'([^J|K|L])|([J|K|L])', '\1')) offending_value
    from t
    where regexp_replace(col1||col2||col3||col4,
          '(A|B|C)(D|E|F)(G|H|I)(J|K|L)') is not null
          COLX       COLY OFFENDING_COLUMN     OFFENDING_VALUE    
             1          2 Col1                 *                  
             1          4 Col2                 *                  
             1          6 Col3                 *                  
             1          8 Col1 Col2 Col3 Col4  _ - / *            
    4 rows selected.Message was edited by:
    MScallion
    Added offending_value
    NOTE* this query only works on single character columns and requires modification for multi character columns

  • How check what kind od SQL statement procedure do

    I would like to check what kind of sql statement type (DML, DDL , Retrive) procedure do on objects.
    is it possible?

    You could try to parse the SQL in DBA_SOURCE for the procedure in question, but that probably doesn't help much...
    Note as well that procedures cannot do DDL unless they resort to dynamic SQL, in which case Oracle itself doesn't know what objects you're working with and what you're doing with them until runtime.
    Justin

  • How do I use SQL statements to perform calculations with form fields????

    Please help!!! I don't know how to use a SQL statement within my APEX form......
    My form is below. The user will enter the values in the form. Click on Submit. Then we need to run a SQL select statement with those values.
    Our form looks like this:
    Start_Date ____________
    Per_Period ____________
    Period ____________
    [Submit Button]
    The user will enter these 3 values in the form.
    This is an example of an user providing the values:
    Start_Date 03/14/08_______
    Per_Period $200.00________
    Period 4____________
    [Submit Button]
    Then they will click the Submit Button.
    The SQL statement (BELOW) returns output based on the users selections:
    START_DATE PER_PERIOD PERIOD
    14-MAR-2008 00:00 200 Week 1 of 4
    21-MAR-2008 00:00 200 Week 2 of 4
    28-MAR-2008 00:00 200 Week 3 of 4
    04-APR-2008 00:00 200 Week 4 of 4
    Total 800
    This is the full text of the SQL that makes the output above:
    with criteria as (select to_date('03/14/08', 'mm/dd/rr') as start_date,
    4 as periods,
    'Week' as period,
    200 per_period from dual),
    periods as (select 'Week' period, 7 days, 0 months from dual
    union all select 'BiWeek', 14, 0 from dual
    union all select 'Month', 0, 1 from dual
    union all select 'ByMonth', 0, 2 from dual
    union all select 'Quarter', 0, 3 from dual
    union all select 'Year', 0 , 12 from dual
    t1 as (
    select add_months(start_date,months*(level-1))+days*(level-1) start_date,
    per_period,
    c.period||' '||level||' of '||c.periods period
    from criteria c join periods p on c.period = p.period
    connect by level <= periods)
    select case grouping(start_date)
    when 1 then 'Total'
    else to_char(start_date)
    end start_date,
    sum(per_period) per_period,
    period
    from t1
    group by rollup ((start_date, period))
    THANKS VERY MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    You're just doing a parameterized report, where the input fields are your parameters.
    Check out the Advanced Tutorial titled Parameterized Report here:
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/rprt_query.htm#BGBEEBJA
    Good luck,
    Stew

  • SQl statement cause extreme Portal log growth

    Our Portal server log file is growing very fast (30 - 50 Mb per minute). When examining the log file we see that the log file does contain only the error messages:
    #1.5#00096BF521750058005A9CA900001E480003E80BD8A2C263#1099562506968#/System/Database/sql/jdbc/common#sap.com/irj#com.sap.sql.jdbc.common.StatementAnalyzerImpl#Guest#18####655e44612e4811d9b41300096bf52175#Thread[ThreadPool-Dispatcher,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error#1#com.sap.sql.jdbc.common.StatementAnalyzerImpl#Java#com.sap.sql.jdbc.common_1123#com.sap.sql.log.OpenSQLResourceBundle#The SQL statement "" contains the semantics error[s]: #2#SELECT MIN("ID"),"PRIORITY" FROM "KMC_TQ_QUEUE" WHERE "NAMESPACE_HASH" = ? AND "NAMESPACE" = ? AND "TASK_STATE" = 1 GROUP BY "PRIORITY" ORDER BY 2 DESC#type check error: the expression >>"NAMESPACE"<< (LONGVARCHAR) is not comparable and must not be used with "="
    This message occurs more than 500 times per log file. It has something to do with Knowledge management, but we cannot find anything that triggers this sql statement.
    Any ideas?
    Noel Hendrikx & Pascal Rijnart

    SAP tells us in reaction to our customer message:
    "The table's definition is correct. What has to be changed is the
    computed type for field NAMESPACE and the generated file for the table.
    As I wrote before, if you make any change in the field NAMESPACE the
    new computation is started (so change the description which has no
    effect on the table's version on the database). Make the change and
    save the table in the SapNetWeaver Developer Studio. You will then
    see that the field's JDBC-type changes to VARCHAR.
    Choose 'Create archive' for Dictionary Project the table belongs to
    and deploy the sda on the database. Both can be done in the studio."
    Can anyone tell us what to do now?
    Noel Hendrikx

  • OpenSQLException - The SQL statement "INSERT INTO "KMC_SUB_RCPT"...

    Hallo,
    We have the problem that subscriptions cannot be sent. In defaultTrace I have found following entry:
    #1.5 #32B150008004002400001641000710B80004539FE52B4274#1217846116565#com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionsOpenSQL#sap.com/irj#com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionsOpenSQL#LI01736#118449##iscp63.isc.aok.de_LFP_399377450#LI01736#03186780621111ddb4c432b150008004#SAPEngine_Application_Thread[impl:3]_10##0#0#Fatal##Plain###Cannot unsubscribe user. Context: ResourceContext: user=LI01736, creationTime=1217846116420, locale=de. User: LI01736. ID: 50cdd784-51ac-2810-2393-ea9709f50de3. Recipient: com.sapportals.wcm.util.channels.wcm.Recipient@ce9b7f70. Step: Executing SQL INSERT. . Trying to rollback transaction.#
    #1.5 #32B150008004002400001643000710B80004539FE52B989A#1217846116586#com.sap.sql.jdbc.common.StatementAnalyzerImpl#sap.com/irj#com.sap.sql.jdbc.common.StatementAnalyzerImpl#LI01736#118449##iscp63.isc.aok.de_LFP_399377450#LI01736#03186780621111ddb4c432b150008004#SAPEngine_Application_Thread[impl:3]_10##0#0#Error#1#/System/Database/sql/jdbc/common#Java#com.sap.sql_0019##Exception of type com.sap.sql.log.OpenSQLException caught: The SQL statement "INSERT INTO "KMC_SUB_RCPT" ("ID","RECIPIENT","RCPTTYPE","UNSUBSCRIBED") VALUES ('50cdd784-51ac-2810-2393-ea9709f50de3','LI01736','0','X')" contains the semantics error[s]: - 1:27 - the column >>ID<< is undefined in the current scope
    [EXCEPTION]
    #3#com.sap.sql.log.OpenSQLException#The SQL statement "INSERT INTO "KMC_SUB_RCPT" ("ID","RECIPIENT","RCPTTYPE","UNSUBSCRIBED") VALUES ('50cdd784-51ac-2810-2393-ea9709f50de3','LI01736','0','X')" contains the semantics error[s]: - 1:27 - the column >>ID<< is undefined in the current scope
    #com.sap.sql.log.OpenSQLException: The SQL statement "INSERT INTO "KMC_SUB_RCPT" ("ID","RECIPIENT","RCPTTYPE","UNSUBSCRIBED") VALUES ('50cdd784-51ac-2810-2393-ea9709f50de3','LI01736','0','X')" contains the semantics error[s]: - 1:27 - the column >>ID<< is undefined in the current scope
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:38)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
         at com.sap.sql.jdbc.common.CommonStatementImpl.executeUpdate(CommonStatementImpl.java:159)
         at com.sap.engine.services.dbpool.wrappers.StatementWrapper.executeUpdate(StatementWrapper.java:162)
         at com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionsOpenSQL$SqlCommand.executeUpdate(SubscriptionsOpenSQL.java:3834)
         at com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionsOpenSQL.unsubscribe(SubscriptionsOpenSQL.java:2127)
         at com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionManager.unsubscribe(SubscriptionManager.java:3226)
         at com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionManager.unsubscribe(SubscriptionManager.java:3205)
         at com.sapportals.wcm.repository.service.subscription.wcm.ActionInboxItemProducer.executeItemAction(ActionInboxItemProducer.java:222)
         at com.sapportals.wcm.service.actioninbox.wcm.ActionInboxService.executeItemAction(ActionInboxService.java:610)
         at com.sapportals.wcm.service.actioninbox.wcm.ActionInboxService.executeItemActions(ActionInboxService.java:1221)
         at com.sapportals.wcm.control.actioninbox.ActionInboxDetailsControl.onClick(ActionInboxDetailsControl.java:396)
    Any Idea?
    Regards,
    Gerhard

    Statement statement = connection.createStatement();
    //createing a statement object
    String query= "INSERT INTO table......"
    output.append("\nSending query:" + connection.nativeSQL(query));
    int result = statement.executeUpdate(query);//updates database wit record
    if (result==1)
    output.append("\ninsertation successfull");
    JOptionPane.showMessageDialog(null,"Insertation successfull ",
    JOptionPane.INFORMATION_MESSAGE);
    else
    output.append("\ninsertation unsuccessfull");
    JOptionPane.showMessageDialog(null,"Insertation unsuccessfull",
    JOptionPane.WARNING_MESSAGE);
    statement.close();
    have left out the trys and catches and some other bits and pieces that i dont think ud need its the bare bones but it might help or at least give u an idea. have used this code before to do something similar.

  • Using a Bind Variable in the FROM part of a SQL Statement?

    Hello Everyone,
    I have a problem, I am trying to run an SQL statement. However I need the FROM part of the SQL statement to be a bind variable. This is because the end user will need to select between 2 database views.
    I have tried this:
    select CON_ID from :P23_DB_NAME where CON_LEGACY_ID=:P23_CONLEG_NO
    I had no luck. The error i got was,
    "+Query cannot be parsed within the Builder. If you believe your query is
    syntactically correct, check the ''generic columns'' checkbox below the
    region source to proceed without parsing.
    ORA-00903: invalid table name+"
    Which makes sence, but now I am a bit stuck.
    Does anyone have any ideas as to get around this problem?
    Thanks in Advance.
    -N.S.N.O.

    The example I gave you is quite simple. You need to take some time to study it to see where you need be carefull what you put where. Now, your example of course doesn't work becaues you have several errors. This will work for you:
    DECLARE
       x   VARCHAR2 (4000);
    BEGIN
       x := x || 'SELECT CON_ID FROM ';
       x := x || :p23_db_name;
       x := x || ' WHERE CON_LEGACY_ID = ' || :p23_conleg_no;
       RETURN (x);
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Error when generating the SQL statement while running the Query

    Hello SDN Mates,
    Am using three cubes in one infoset and build a query on that. Intially it was running fine, but now am getting error generating the SQL statement. Can you please throw some light on this. Your idea would be highly appreciated.
    Thanks and Regards
    Arun S

    Hi Arun
    is there any change in the objects (Check also the consistency of infoobject ) included in infoset, just make sure those are active, open the query in designer and check if no error/warning message are present
    Thanks
    Tripple k

Maybe you are looking for

  • Analysis Office vs Webi report ---Bex query Data mismatch

    I have one Bex query. I insterted the query in Analysis office for Microsoft edition, and its pulling 985 records, but when i inserted the bex query in Webi report its pulling only 27 records. Any body faced similar problem, explain the solution..? U

  • Need to send an email to 3,000 receipients how do i do this using mail?

    I am a small business and we have about 3,000 email contacts on our books. Occasionally we like to send them an email to show offers etc. Can anyone let me know the best way i could do this? at the moment my broadband supplier only allows me to send

  • Error ALC-WKS-007-043

    I am continuing the discussion started in Tito Kraer, "Form Guide Conversions" #6, 19 Dec 2007 7:31 am, since the subject has really changed. I had posted that I needed a simpler process than I had, like . . . display an xdp form in WS, enter data, s

  • Where did my podcasts go?  The new version erased ones marked to keep!

    The new version of iTunes just wiped out months of collected podcasts, even though it is still set to keep them all?  Where did they go?  How can I redownload them all if they are no longer available?  What did you break Apple?!

  • Wireless Bridge error with AIR-BR1310G-E-K9,cannot associate: No response

    Hi Guys, I have to do a wireless bridge with 2 AIR-BR1310G-E-K9. I configure 1 AP root bridge and 1 AP non-root bridge, with the same SSID. But on the AP non-root bridge, the interface dot11 radio don't change it state to up and give this error: %DOT