Dynamic sql versus static sql in a loop

I have a loop that loops around 10 million times.Inside the loop I have a insert statement . To build this insert statement wondering if a) I should use Dynamic sql using bind variables or b) static sql.
I am aware that static sql is always faster than dynamic sql(using bind variable)....but wanted to get some opinion
Please help.

mmm some solution could be to write the same insert with decode/case statement and put there the conditions that you want.
maybe something like this:
SQL> ed
Wrote file afiedt.buf
  1  begin
  2    for i in 1..10 loop
  3      insert into t1 (col1,col2,col3)
  4        values (i,
  5                decode (mod (i,2),0,i,null),
  6                decode (mod (i,3),0,i,null));
  7    end loop;
  8* end;
SQL> /
PL/SQL procedure successfully completed.
SQL> select * from t1;
      COL1       COL2       COL3
         1
         2          2
         3                     3
         4          4
         5
         6          6          6
         7
         8          8
         9                     9
        10         10
10 rows selected.
SQL> truncate table t1;
Table truncated.
SQL> insert into t1 (col1,col2,col3)
  2    select rownum,
  3           decode (mod (rownum,2),0,rownum,null),
  4           decode (mod (rownum,3),0,rownum,null)
  5    from dual
  6  connect by rownum <=10;
10 rows created.
SQL> select * from t1;
      COL1       COL2       COL3
         1
         2          2
         3                     3
         4          4
         5
         6          6          6
         7
         8          8
         9                     9
        10         10
10 rows selected.forgot that you are not using anymore the loop :)
Message was edited by:
Delfino Nunez

Similar Messages

  • Creating static sql from dynamic sql

    HI ,
    I have a dynamic sql and  I have to convert it into a static sql .
    this query is somehow having a special case which states that if the values of one parameter @bounce_type is D then it appends some more conditions(column conditions) on this query .
    I want to know a way to convert this kind of SQL to a static sql .
    I want a static code for the code where the condition is as mentioned below
    for the where clause where @bounce_type='D'
    if @bounce_type is not null and @bounce_type = 'D'
    begin
    print @bounce_type
    set @WhereClause = @WhereClause + ' and per.event_type_id=4 and per.aspen_action_detail_id not in
    (select
    aspen_action_detail_id
    from
    program.email_response pers with (readuncommitted)
    inner join action.action ac with(nolock,readuncommitted) on
    pers.action_id = ac.action_id
    where
    pers.dealer_id in( ' + cast(@dealer_did as varchar(10)) + ' ) and
    pers.aspen_action_dt between ''' + convert(varchar(10),@from_date,101)+''' ' + 'and ''' + convert(varchar(10),@to_date,101) + ''' and
    pers.program_type_id in (4,5) and
    pers.event_type_id=1 and
    pers.is_enabled=1) and aa.program_group<>''Unknown'''
    I was able to convert almost all of the code but the code mentioned above.

    Perhaps this one
    if @bounce_type is not null and @bounce_type = 'D' 
    begin
    print @bounce_type
    SELECT * FROM tbl WHERE ... and per.event_type_id=4 and per.aspen_action_detail_id not in
    (select
    aspen_action_detail_id
    from 
    program.email_response pers with (readuncommitted)
    inner join action.action ac with(nolock,readuncommitted) on
    pers.action_id = ac.action_id  
    where 
    pers.dealer_id in(  cast(@dealer_did as varchar(10)))  and 
    pers.aspen_action_dt between  convert(varchar(10),@from_date,101) and 
    convert(varchar(10),@to_date,101)  and 
    pers.program_type_id in (4,5)
    and
    pers.event_type_id=1
    and
    pers.is_enabled=1) and aa.program_group<>'Unknown' 
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Dynamic SQL and PL/SQL Gateway

    This question is kind of out of curiosity...I had created a procedure that used some dynamic sql (execute immediate), and was trying to use it on pl/sql gateway. I kept getting page not found errors until I removed the execute immediate statement, and reverted to using static sql statements.
    I am just curious, is dynamic sql not supported at all with pl/sql gateway?
    Thanks
    Kevin

    > Relax damorgan, no need to be condescending. Of course I read the docs ..
    Well, you're one of the few that actually read the docs.. And one of many that lacked to state any real technical details for forum members to understand the actual problem, the actual error, and what the environment is that this is happening in.
    Remember that you came to this forum for forum members to help you. In order for us to do that, you need to help us understand
    - your problem
    - your environment
    - what you have tried
    What PL/SQL Gateway do you refer to? Thus is an old term for an old product - today in Oracle there are two "gateways" into the PL/SQL engine via HTTP. Via Apache/mod_plsql and via the internal Java servlet web engine called EPG inside Oracle.
    As for what the "Gateway" access to the PL/SQL engine via HTTP.. whether it supports EXECUTE IMMEDIATE or not is like asking if a car "supports" soft drinks or not (just because a human that may consume soft drinks acts as the driver of the car). Not sensible or relevant at all.
    mod_plsql creates an Oracle session to the database instance, and executes a PL/SQL procedure in the database. This is no different from any other client connection to Oracle. Oracle has no clue that the client is mod_plsql and not TOAD or Java or VB or PHP or Perl or whatever else.
    So how can this support or not support the EXECUTE IMMEDIATE command? Does PL/SQL support EXECUTE IMMEDIATE? Well duh...
    Why do you get a generic 404? Because the PL/SQL call made by mod_plsql failed with an unhandled exception. mod_plsql gets that exception and now what? Was a valid HTP buffer created for it to stream to the web browser? If the buffer perhaps partially completed? All that mod_plsql knows is that it asked for a HTP buffer via that PL/SQL call and it got an exception in return.
    A 404 HTTP error is the only reasonable and logical response for it to pass to the web browser in this case.
    PS. to see why mod_plsql fail, refer to the access_log and error_log of that Apache httpd server

  • Dynamic table pulled from SQL database, Need to Search

    My table results are not static, they are pulled into a
    dynamic table from a SQL database. Each table displays 10 records
    with an option at the bottom to display additional records
    (next/previous), for my query. I also have an option set up to
    allow users to click for a detail view of a record in the table. If
    the table data was static, I would be able to set up a search
    option and a results page for it, but I'm dealing with dynamic data
    on an .ASP page. I'd like to set up a search box to limit the
    records displayed in the table. I haven't found any code samples
    that are designed for dynamic data.
    Here is a copy of the code from my table.

    Hi,
    I think the code on this URL will get you the solution
    http://www.asp.happycodings.com/Array/code3.html
    Cheers,
    ~Maneet

  • Dynamic SQL within a SQL Query ?

    is there any possibility to do like this ?
    SELECT table_name, XXXXXXXX('SELECT Count(*) FROM '||table_name) tot_rows
      FROM dba_tables
    WHERE owner = 'SCOTT';or any other trick to run dynamic SQL within the SQL Query?
    Hoping....that it should be.
    Regards,
    Orapdev

    One small disadvantage: it is executing 202 SQL statements: 3 "user SQL statements" (the one above and the 2 "select count(*)..."), and 199 internal ones ...How did you get to those numbers?
    I just traced this statement and found completely different results:
    TKPROF: Release 10.2.0.3.0 - Production on Tue Jul 10 12:12:10 2007
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Trace file: diesl10r2_ora_5440.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    declare  cursor NlsParamsCursor is    SELECT * FROM
      nls_session_parameters;begin  SELECT Nvl(Lengthb(Chr(65536)),
      Nvl(Lengthb(Chr(256)), 1))    INTO :CharLength FROM dual;  for NlsRecord in
      NlsParamsCursor loop    if NlsRecord.parameter = 'NLS_DATE_LANGUAGE' then  
         :NlsDateLanguage := NlsRecord.value;    elsif NlsRecord.parameter =
      'NLS_DATE_FORMAT' then      :NlsDateFormat := NlsRecord.value;    elsif
      NlsRecord.parameter = 'NLS_NUMERIC_CHARACTERS' then     
      :NlsNumericCharacters := NlsRecord.value;    elsif NlsRecord.parameter =
      'NLS_TIMESTAMP_FORMAT' then      :NlsTimeStampFormat := NlsRecord.value;   
      elsif NlsRecord.parameter = 'NLS_TIMESTAMP_TZ_FORMAT' then     
      :NlsTimeStampTZFormat := NlsRecord.value;    end if;  end loop;end;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.00          0          0          0           1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 50 
    SELECT NVL(LENGTHB(CHR(65536)), NVL(LENGTHB(CHR(256)), 1))
    FROM
    DUAL
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.01       0.00          0          0          0           0
    Fetch        1      0.00       0.00          0          0          0           1
    total        3      0.01       0.00          0          0          0           1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 50     (recursive depth: 1)
    Rows     Row Source Operation
          1  FAST DUAL  (cr=0 pr=0 pw=0 time=7 us)
    SELECT *
    FROM
    NLS_SESSION_PARAMETERS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          0          0          0          17
    total        3      0.00       0.00          0          0          0          17
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 50     (recursive depth: 1)
    Rows     Row Source Operation
         17  FIXED TABLE FULL X$NLS_PARAMETERS (cr=0 pr=0 pw=0 time=124 us)
    select PARAMETER,VALUE
    from
    nls_session_parameters where PARAMETER in('NLS_NUMERIC_CHARACTERS',
      'NLS_DATE_FORMAT','NLS_CURRENCY')
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          0          0          0           3
    total        3      0.00       0.00          0          0          0           3
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 50 
    Rows     Row Source Operation
          3  FIXED TABLE FULL X$NLS_PARAMETERS (cr=0 pr=0 pw=0 time=57 us)
    select to_char(9,'9C')
    from
    dual
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          0          0          0           1
    total        3      0.00       0.00          0          0          0           1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 50 
    Rows     Row Source Operation
          1  FAST DUAL  (cr=0 pr=0 pw=0 time=2 us)
    SELECT table_name,
           DBMS_XMLGEN.getxmltype ('select count(*) c from ' || table_name).EXTRACT
                                                                    ('//text').getstringval
                                                                          () tot
      FROM dba_tables
    WHERE table_name IN ('EMP', 'DEPT') AND owner = 'SCOTT'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.01       0.02          0         48          0           2
    total        3      0.01       0.02          0         48          0           2
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 50 
    Rows     Row Source Operation
          2  HASH JOIN  (cr=42 pr=0 pw=0 time=2952 us)
          2   MERGE JOIN CARTESIAN (cr=42 pr=0 pw=0 time=1206 us)
          2    NESTED LOOPS OUTER (cr=42 pr=0 pw=0 time=478 us)
          2     NESTED LOOPS OUTER (cr=36 pr=0 pw=0 time=421 us)
          2      NESTED LOOPS OUTER (cr=30 pr=0 pw=0 time=379 us)
          2       NESTED LOOPS OUTER (cr=30 pr=0 pw=0 time=365 us)
          2        NESTED LOOPS  (cr=22 pr=0 pw=0 time=312 us)
          2         NESTED LOOPS  (cr=16 pr=0 pw=0 time=272 us)
          2          NESTED LOOPS  (cr=8 pr=0 pw=0 time=172 us)
          1           TABLE ACCESS BY INDEX ROWID USER$ (cr=2 pr=0 pw=0 time=56 us)
          1            INDEX UNIQUE SCAN I_USER1 (cr=1 pr=0 pw=0 time=30 us)(object id 44)
          2           INLIST ITERATOR  (cr=6 pr=0 pw=0 time=111 us)
          2            TABLE ACCESS BY INDEX ROWID OBJ$ (cr=6 pr=0 pw=0 time=87 us)
          2             INDEX RANGE SCAN I_OBJ2 (cr=4 pr=0 pw=0 time=54 us)(object id 37)
          2          TABLE ACCESS CLUSTER TAB$ (cr=8 pr=0 pw=0 time=98 us)
          2           INDEX UNIQUE SCAN I_OBJ# (cr=4 pr=0 pw=0 time=26 us)(object id 3)
          2         TABLE ACCESS CLUSTER TS$ (cr=6 pr=0 pw=0 time=39 us)
          2          INDEX UNIQUE SCAN I_TS# (cr=2 pr=0 pw=0 time=13 us)(object id 7)
          2        TABLE ACCESS CLUSTER SEG$ (cr=8 pr=0 pw=0 time=37 us)
          2         INDEX UNIQUE SCAN I_FILE#_BLOCK# (cr=4 pr=0 pw=0 time=21 us)(object id 9)
          0       INDEX UNIQUE SCAN I_OBJ1 (cr=0 pr=0 pw=0 time=4 us)(object id 36)
          2      TABLE ACCESS BY INDEX ROWID OBJ$ (cr=6 pr=0 pw=0 time=33 us)
          2       INDEX UNIQUE SCAN I_OBJ1 (cr=4 pr=0 pw=0 time=23 us)(object id 36)
          2     TABLE ACCESS CLUSTER USER$ (cr=6 pr=0 pw=0 time=28 us)
          2      INDEX UNIQUE SCAN I_USER# (cr=2 pr=0 pw=0 time=12 us)(object id 11)
          2    BUFFER SORT (cr=0 pr=0 pw=0 time=716 us)
          1     FIXED TABLE FULL X$KSPPI (cr=0 pr=0 pw=0 time=661 us)
       1436   FIXED TABLE FULL X$KSPPCV (cr=0 pr=0 pw=0 time=1449 us)
    select count(*) c
    from
    EMP
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.00       0.00          0          1          0           1
    total        4      0.00       0.00          0          1          0           1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 50     (recursive depth: 1)
    Rows     Row Source Operation
          1  SORT AGGREGATE (cr=1 pr=0 pw=0 time=96 us)
         14   INDEX FULL SCAN EMP_IDX (cr=1 pr=0 pw=0 time=46 us)(object id 61191)
    select metadata
    from
    kopm$  where name='DB_FDO'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          0          2          0           1
    total        3      0.00       0.00          0          2          0           1
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS   (recursive depth: 1)
    Rows     Row Source Operation
          1  TABLE ACCESS BY INDEX ROWID KOPM$ (cr=2 pr=0 pw=0 time=42 us)
          1   INDEX UNIQUE SCAN I_KOPM1 (cr=1 pr=0 pw=0 time=22 us)(object id 365)
    select count(*) c
    from
    DEPT
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.00       0.00          0          1          0           1
    total        4      0.00       0.00          0          1          0           1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 50     (recursive depth: 1)
    ALTER SESSION SET sql_trace=FALSE
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 0
    Parsing user id: 50 
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        5      0.00       0.00          0          0          0           0
    Execute      5      0.00       0.00          0          0          0           1
    Fetch        3      0.01       0.02          0         48          0           6
    total       13      0.01       0.03          0         48          0           7
    Misses in library cache during parse: 0
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        5      0.00       0.00          0          0          0           0
    Execute      5      0.01       0.00          0          0          0           0
    Fetch        7      0.00       0.00          0          4          0          21
    total       17      0.01       0.00          0          4          0          21
    Misses in library cache during parse: 0
        9  user  SQL statements in session.
        1  internal SQL statements in session.
       10  SQL statements in session.
    Trace file: diesl10r2_ora_5440.trc
    Trace file compatibility: 10.01.00
    Sort options: default
           1  session in tracefile.
           9  user  SQL statements in trace file.
           1  internal SQL statements in trace file.
          10  SQL statements in trace file.
          10  unique SQL statements in trace file.
         132  lines in trace file.
           0  elapsed seconds in trace file.I only see a ratio of 1:9 for user- to internal SQL statements?
    michaels>  select * from v$version
    BANNER                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production                         
    CORE     10.2.0.3.0     Production                                     
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production        
    NLSRTL Version 10.2.0.3.0 - Production  

  • Dynamic PIVOT in T-SQL or somewhere else?

    In a
    recent thread on dynamic SQL, the issue of dynamic PIVOT came up.
    Dynamic PIVOT can be implemented in T-SQL with dynamic SQL:
    Pivots with Dynamic Columns in SQL Server 2005
    http://sqlhints.com/2014/03/18/dynamic-pivot-in-sql-server/
    http://stackoverflow.com/questions/10404348/sql-server-dynamic-pivot-query
    http://www.sqlusa.com/bestpractices2005/dynamicpivot/
    Alternatives:
    1. Enhancement by MS to the current static PIVOT which has limited use since it is not data-driven
    2. Use SSRS which has built-in dynamic columns
    3. Use client app
    What is your opinion? Is it OK to use dynamic SQL for dynamic PIVOT?
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

    solution elsewhere, for instance with Tablix in SSRS. Pivoting a result set in C# should not be too difficult
    But I could do it much faster in T-SQL with dynamic SQL. 
    If your shop has a reporting system like SSRS and the request is for permanent report, then by all means, SSRS is the choice with built-in dynamic columns.
    C#? I used to know C/C++. So that is not a choice for me. On the other hand, if you are competent in C#, then it may be a better choice, or it may not.
    I'm not sure why people tend to shy away from dynamic SQL, for me, I've never had any problems or issues. Is there any specific reason for this?
    Maybe the multiple single quotes like '''' in concatenation of the dynamic SQL string? When one looks at the following example, it is easy to see that dynamic SQL adds a new level of complexity to static SQL. Yet, the complexity pays off with incredible
    dynamic SQL programming power.
    BLOG: Building Dynamic SQL In a Stored Procedure
    Code example from the blog:
    /* This stored procedure builds dynamic SQL and executes
    using sp_executesql */
    Create Procedure sp_EmployeeSelect
    /* Input Parameters */
    @EmployeeName NVarchar(100),
    @Department NVarchar(50),
    @Designation NVarchar(50),
    @StartDate DateTime,
    @EndDate DateTime,
    @Salary Decimal(10,2)
    AS
    Set NoCount ON
    /* Variable Declaration */
    Declare @SQLQuery AS NVarchar(4000)
    Declare @ParamDefinition AS NVarchar(2000)
    /* Build the Transact-SQL String with the input parameters */
    Set @SQLQuery = 'Select * From tblEmployees where (1=1) '
    /* check for the condition and build the WHERE clause accordingly */
    If @EmployeeName Is Not Null
    Set @SQLQuery = @SQLQuery + ' And (EmployeeName = @EmployeeName)'
    If @Department Is Not Null
    Set @SQLQuery = @SQLQuery + ' And (Department = @Department)'
    If @Designation Is Not Null
    Set @SQLQuery = @SQLQuery + ' And (Designation = @Designation)'
    If @Salary Is Not Null
    Set @SQLQuery = @SQLQuery + ' And (Salary >= @Salary)'
    If (@StartDate Is Not Null) AND (@EndDate Is Not Null)
    Set @SQLQuery = @SQLQuery + ' And (JoiningDate
    BETWEEN @StartDate AND @EndDate)'
    /* Specify Parameter Format for all input parameters included
    in the stmt */
    Set @ParamDefinition = ' @EmployeeName NVarchar(100),
    @Department NVarchar(50),
    @Designation NVarchar(50),
    @StartDate DateTime,
    @EndDate DateTime,
    @Salary Decimal(10,2)'
    /* Execute the Transact-SQL String with all parameter value's
    Using sp_executesql Command */
    Execute sp_Executesql @SQLQuery,
    @ParamDefinition,
    @EmployeeName,
    @Department,
    @Designation,
    @StartDate,
    @EndDate,
    @Salary
    If @@ERROR <> 0 GoTo ErrorHandler
    Set NoCount OFF
    Return(0)
    ErrorHandler:
    Return(@@ERROR)
    GO
    LINK:
    http://www.codeproject.com/Articles/20815/Building-Dynamic-SQL-In-a-Stored-Procedure
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Static sql connections

    Hi,
    I've got a stateless session EJB and a SqlSomeTask class:
    class SqlSomeTask{
    private static Connection conn;
    public static void openConnection() throws SQLException{
    Context ctx;
    DataSource ds;
    try{
    ctx = new InitialContext();
    ds = (DataSource)ctx.lookup("java:/MSSQLDS");
    if (null == connection)
    conn = ds.getConnection();
    else
    if(conn.isClosed()) {
    conn = ds.getConnection();
    return conn;
    }catch(Exception e) {
    throw new Exception(e.getMessage());
    public static void closeConnection()throws SGException{
    try{
    if (null != connection){
    if (!conn.isClosed()) {
    conn.close();
    }catch(Exception e){
    throw new Exception(e.getMessage());
    Inside my EJB I've written this:
    public class SessionFacadeBean implements SessionBean {
    public Object invoke(String sessionID, IDTO dto) throws SGException {
    SqlSomeTask.openConnection();
    SqlSome.save(dto); /*For example*/
    SqlSomeTask.closeConnection();
    I have a doubt regarding the behaviour of static connection: if JBOSS server is running and a user invoque the EJB and open the static connection and at the same time another user request EJB and invoke the EJB: will another static connection open for this new request or the connection is the same that the previous user opened and it will be reopened? I mean, if connection is static, then is a class variable and it's not saved in the heap but in the method area in the JVM, a new connection isn't opened for each EJB invocation because it's static, is it?
    Since every time a user invoke a stateless EJB, one instance of that EJB is created (new thread) and then destoyed, one instance of SqlSomeTask is created. Nevertheless, SqlSomeTask connection attribute is static so it's the same for every invocation.
    Thanks

    I finally solved my own problem. The SQLJ compiler creates a .ser file that is used on the DB side to customize and build the packages needed so that the SQL is static. Using straight JDBC creates dynamic calls.
    At this point I'm worried because I've not had one question answered regarding SQLJ, and it appears that nobody is using it. So, I'm looking in other directions if I can.

  • How can I load a .xlsx File into a SQL Server Table using a Foreach Loop Container in SSIS?

    I know I've REALLY struggled with this before. I just don't understand why this has to be soooooo difficult.
    I can very easily do a straight Data Pump of a .xlsX File into a SQL Server Table using a normal Excel Connection and a normal Excel Source...simply converting Unicode to DT_STR and then using an OLE DB Destination of the SQL Server Table.
    If I want to make the SSIS Package a little more flexible by allowing multiple .xlsX spreadsheets to be pumped in by using a Foreach Loop Container, the whole SSIS Package seems to go to hell in a hand basket. I simply do the following...
    Put the Data Flow Task within the Foreach Loop Container
    Add the Variable Mapping Variable User::FilePath that I defined as a Variable and a string within the FOreach Loop Container
    I change the Excel Connection and its Expression to be ExcelFilePath ==> @[User::FilePath]
    I then try and change the Excel Source and its Data Access Mode to Table Name or view name variable and provide the Variable Name User::FilePath
    And that's when I run into trouble...
    Exception from HRESULT: 0xC02020E8
    Error at Data Flow Task [Excel Source [56]]:SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occured. Error code: 0x80004005.
    Error at Data Flow Task [Excel Source [56]]: Opening a rowset for "...(the EXACT Path and .xlsx File Name)...". Check that the object exists in the database. (And I know it's there!!!)
    I don't understand by adding a Foreach Loop Container to try and make this as efficient as possible has caused such an error unless I'm overlooking something. I have even tried delaying my validations and that doesn't seem to help.
    I have looked hard in Google and even YouTube to try and find a solution for this but for the life of me I cannot seem to find anything on pumping a .xlsX file into SQL Server using a Foreach Loop Container.
    Can ANYONE please help me out here? I'm at the end of my rope trying to get this to work. I think the last time I was in this quandry, trying to pump a .xlsX File into a SQL Server Table using a Foreach Loop Container in SSIS, I actually wrote a C# Script
    to write the contents of the .xlsX File into a .csv File and then Actually used the .csv File to pump the data into a SQL Server Table.
    Thanks for your review and am hoping and praying for a reply and solution.

    Hi ITBobbyP,
    If I understand correctly, you want to load data from multiple sheets in an .xlsx file into a SQL Server table.
    If in this scenario, please refer to the following tips:
    The Foreach Loop container should be configured as shown below:
    Enumerator: Foreach ADO.NET Schema Rowset Enumerator
    Connection String: The OLE DB Connection String for the excel file.
    Schema: Tables.
    In the Variable Mapping, map the variable to Sheet_Name, and change the Index from 0 to 2.
    The connection string for Excel Connection Manager is the original one, we needn’t make any change.
    Change Table Name or View name to the variable Sheet_Name.
    If you want to load data from multiple sheets in multiple .xlsx files into a SQL Server table, please refer to following thread:
    http://stackoverflow.com/questions/7411741/how-to-loop-through-excel-files-and-load-them-into-a-database-using-ssis-package
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Dynamic SQL without using SQL

    I have a variable that contains a formula, eg.
    V_FORMULA varchar2(200) := '5 * 50 + 200';
    I want to assign the result of the formula into another variable, without using a DB call with SQL.
    eg.
    V_RESULT number;
    V_RESULT := DBMS_surprise_package(V_FORMULA);
    I want V_RESULT to be 450 after the statement is executed.
    Is that possible?? Is there such a package in PLSQL?
    I think the Forms NAME_IN package did something similar.

    970779 wrote:
    I guess I'll just have to rewrite it using execute immediate with bind variables to stop the shared pool getting filled up with thousands of these statements, since none of you have a non-db solution.Write your own if the expressions are simple enough...
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    l_formula varchar2(200) := '5 * 50 + 200';
      3    l_result  number := 0;
      4    tok       varchar2(100);
      5    op        varchar2(100);
      6    function get_token(str in out varchar2) return varchar2 is
      7    begin
      8      tok := trim(regexp_substr(str,'^[0-9]+|[^0-9]+'));
      9      str := trim(regexp_replace(str,'^([0-9]+|[^0-9]+)'));
    10      return tok;
    11    end;
    12  begin
    13    loop
    14      tok := get_token(l_formula);
    15      exit when tok is null;
    16      if tok in ('*','+','-','/') then
    17        op := tok;
    18      else
    19        case op when '*' then l_result := l_result * to_number(tok);
    20                when '+' then l_result := l_result + to_number(tok);
    21                when '-' then l_result := l_result - to_number(tok);
    22                when '/' then l_result := l_result / to_number(tok);
    23        else l_result := to_number(tok);
    24        end case;
    25      end if;
    26    end loop;
    27    dbms_output.put_line(l_result);
    28* end;
    SQL> /
    450
    PL/SQL procedure successfully completed.:D

  • SQL Subscription field shows * only with Dynamic Text Label in SQL query

    We are using Hyperion Analyzer 7.2.x for showing budget and actual data. I have to show this financial data based on the security e.g. person in IT can see only IT dept. data. Hence I want to use dynamic text label <<userid>> for the security based on the person logging in to Analyzer.
    But when I use dynamic text label <<userid>> in the SQL query in SQL Spreadsheet, SQL Subscription field shows * only selection option. Does anyone have idea how to solve this problem?
    Thanks in advance for your help.
    -SV

    Hi
    Okay i know this is a bit crazy way.....but i think this is the solution for your issue.
    Create a report without the where clause (<<useris>>) then add a filter (sql subscription) then you can find all the values that are there in the SQL field (try to increase the query limit it is set to 250 as default) then edit the spreadsheet and add the where clause (<<userid>>).
    This will help you having the filter and the dynamic text label. I think there is an issue when you try to filter it with a where clause.
    Hope it helps.
    CK

  • Dynamically open/execute a .sql file

    Is it possible to dynamically open a .sql file?
    Specifically, if the user's input will determine which file to open, how can I open the corresponding file?
    For example, if the user's options are 1, 2, 3, 4, 5 and their selection will determine whether to open file1.sql, file2.sql, file3.sql, file4.sql, or file5.sql, how do I open the correct file?
    Let me know if additional information is needed.
    Thanks!

    Can you take a step back and explain exactly what you're trying to accomplish here?
    Are you trying to give users some sort of menu-based system in SQL*Plus that will execute scripts? Will those scripts be on the user's machine? Or on the server?
    If this is your goal, you are generally better served using a shell script on a central server to present the menu, process the choice, and invoke SQL*Plus or putting some sort of thin web-based GUI on top of the scripts.
    Justin

  • Binding parameters to dynamic VO with PL/SQL API call with no where clause

    Hi all,
    I am required to change exisiting queries to queries with "bind" parameters. Some of our VOs are dynamic and with PL/SQL api calls like below:
    String stmtStr = "selectXXX_API_UTILS.chk_urg_since_last_prg("
    + projectId + "," + PPCId + ",'XYZ_TASKS'," + taskId+ ")"
    +" from dual ";
    ViewObject tmpVO = transaction.createViewObjectFromQueryStmt(stmtStr);
    In this regard, I am unsure how to bind the PPCId and taskId parameters to the VO. setWhereClauseParams() would not work here as there is now where clause.
    Thanks in advance,
    Srini

    In case of preparedStatement, we mention bind parameters to be passed using "?". Then we pass paramters sequencially.
    But in the your case following is enough:
    int projectId = 100 ; (hardcoding values for example)
    int taskId = 500 ;
    String stmtStr = "selectXXX_API_UTILS.chk_urg_since_last_prg("
    + projectId + "," + PPCId + ",'XYZ_TASKS'," + taskId+ ")"
    +" from dual ";
    -Anand

  • Creating Crystal Reports Dynamically from an incoming SQL query

    Hi,
    I have a requirement where a sql query will be entered by the user in a text box and in the back end java code, i have to create a crystal report dynamically based on that sql query and show it in the crystalviewer object.
    For example if the user writes "select x,y from xtable ", i should be able to create a report with 2 fields, and if the user says "select x,y,z from xtable" then i should be able create and show a report with 3 fileds...thsi report creation should be done in the click event.
    Is this possible in java? I have found something similar in .NET... pls have a look at this 
    http://vb.net-informations.com/crystal-report/dynamic_crystal_report_from_sql_query_string.htm
    Thanks,
    Preethi

    Hi Preethi,
    Can you please share the steps with me? I am also looking for dynamic SQL being applied to the crystal report.
    Thank you so much for your help in advance.
    Regards,
    Janakiram D.

  • Oracle SQL and PL/SQL interview questions.

    Can anyone forward me all Oracle SQL and PL/SQL Interview questions and answers asap.
    Many Thanks.
    Bba

    Dear Pal
    I not sure all the all answers are correct. I got one mail couple yrs back. I am just sharing mail contents. Kindly keep question and compare answers.
    1 Which is more faster - IN or EXISTS?
    EXISTS is more faster than IN because EXISTS returns a Boolean value whereas IN returns a value.
    2 Which datatype is used for storing graphics and images?
    LONG RAW data type is used for storing BLOB's (binary large objects).
    3 When do you use WHERE clause and when do you use HAVING clause?
    HAVING clause is used when you want to specify a condition for a group function and it is written after GROUP BY clause. The WHERE clause is used when you want to specify a condition for columns, single row functions except group functions and it is written before GROUP BY clause if it is used.
    4 What WHERE CURRENT OF clause does in a cursor?
    LOOPSELECT num_credits INTO v_numcredits FROM classesWHERE dept=123 and course=101;UPDATE studentsSET current_credits=current_credits+v_numcreditsWHERE CURRENT OF X;END LOOPCOMMIT;END;
    5 What should be the return type for a cursor variable.Can we use a scalar data type as return type?
    The return type for a cursor must be a record type.It can be declared explicitly as a user-defined or %ROWTYPE can be used. eg TYPE t_studentsref IS REF CURSOR RETURN students%ROWTYPE
    6 What is use of a cursor variable? How it is defined?
    A cursor variable is associated with different statements at run time, which can hold different values at run time. Static cursors can only be associated with one run time query. A cursor variable is reference type (like a pointer in C).Declaring a cursor variable:TYPE type_name IS REF CURSOR RETURN return_type type_name is the name of the reference type,return_type is a record type indicating the types of the select list that will eventually be returned by the cursor variable.
    7 What is the purpose of a cluster?
    Oracle does not allow a user to specifically locate tables, since that is a part of the function of the RDBMS. However, for the purpose of increasing performance, oracle allows a developer to create a CLUSTER. A CLUSTER provides a means for storing data from different tables together for faster retrieval than if the table placement were left to the RDBMS.
    8 What is the maximum buffer size that can be specified using the DBMS_OUTPUT.ENABLE function?
    1,000,00
    9 What is syntax for dropping a procedure and a function .Are these operations possible?
    Drop Procedure procedure_nameDrop Function function_name
    10 What is OCI. What are its uses?
    Oracle Call Interface is a method of accesing database from a 3GL program. Uses--No precompiler is required,PL/SQL blocks are executed like other DML statements. The OCI library provides· -functions to parse SQL statemets· -bind input variables· -bind output variables· -execute statements· -fetch the results
    11 What is difference between UNIQUE and PRIMARY KEY constraints?
    A table can have only one PRIMARY KEY whereas there can be any number of UNIQUE keys. The columns that compose PK are automatically define NOT NULL, whereas a column that compose a UNIQUE is not automatically defined to be mandatory must also specify the column is NOT NULL.
    12 What is difference between SUBSTR and INSTR?
    SUBSTR returns a specified portion of a string eg SUBSTR('BCDEF',4) output BCDEINSTR provides character position in which a pattern is found in a string. eg INSTR('ABC-DC-F','-',2) output 7 (2nd occurence of '-')
    13 What is difference between SQL and SQL*PLUS?
    SQL*PLUS is a command line tool where as SQL and PL/SQL language interface and reporting tool. Its a command line tool that allows user to type SQL commands to be executed directly against an Oracle database. SQL is a language used to query the relational database(DML,DCL,DDL). SQL*PLUS commands are used to format query result, Set options, Edit SQL commands and PL/SQL.
    14 What is difference between Rename and Alias?
    Rename is a permanent name given to a table or column whereas Alias is a temporary name given to a table or column which do not exist once the SQL statement is executed.
    15 What is difference between a formal and an actual parameter?
    The variables declared in the procedure and which are passed, as arguments are called actual, the parameters in the procedure declaration. Actual parameters contain the values that are passed to a procedure and receive results. Formal parameters are the placeholders for the values of actual parameters
    16 What is an UTL_FILE.What are different procedures and functions associated with it?
    UTL_FILE is a package that adds the ability to read and write to operating system files. Procedures associated with it are FCLOSE, FCLOSE_ALL and 5 procedures to output data to a file PUT, PUT_LINE, NEW_LINE, PUTF, FFLUSH.PUT, FFLUSH.PUT_LINE,FFLUSH.NEW_LINE. Functions associated with it are FOPEN, ISOPEN.
    17 What is a view ?
    A view is stored procedure based on one or more tables, it’s a virtual table.
    18 What is a pseudo column. Give some examples?
    It is a column that is not an actual column in the table.eg USER, UID, SYSDATE, ROWNUM, ROWID, NULL, AND LEVEL.
    19 What is a OUTER JOIN?
    Outer Join--Its a join condition used where you can query all the rows of one of the tables in the join condition even though they don’t satisfy the join condition.
    20 What is a cursor?
    Oracle uses work area to execute SQL statements and store processing information PL/SQL construct called a cursor lets you name a work area and access its stored information A cursor is a mechanism used to fetch more than one row in a Pl/SQl block.
    21 What is a cursor for loop?
    Cursor For Loop is a loop where oracle implicitly declares a loop variable, the loop index that of the same record type as the cursor's record.
    22 What are various privileges that a user can grant to another user?
    · SELECT· CONNECT· RESOURCES
    23 What are various constraints used in SQL?
    · NULL· NOT NULL· CHECK· DEFAULT
    24 What are ORACLE PRECOMPILERS?
    Using ORACLE PRECOMPILERS, SQL statements and PL/SQL blocks can be contained inside 3GL programs written in C,C++,COBOL,PASCAL, FORTRAN,PL/1 AND ADA.The Precompilers are known as Pro*C,Pro*Cobol,...This form of PL/SQL is known as embedded pl/sql,the language in which pl/sql is embedded is known as the host language. The prcompiler translates the embedded SQL and pl/sql ststements into calls to the precompiler runtime library.The output must be compiled and linked with this library to creater an executable.
    25 What are different Oracle database objects?
    · TABLES· VIEWS· INDEXES· SYNONYMS· SEQUENCES· TABLESPACES etc
    26 What are different modes of parameters used in functions and procedures?
    · IN· OUT· INOUT
    27 What are cursor attributes?
    · %ROWCOUNT· %NOTFOUND· %FOUND· %ISOPEN
    28 What a SELECT FOR UPDATE cursor represent. [ANSWER]SELECT......FROM......FOR......UPDATE[OF column-reference][NOWAIT] The processing done in a fetch loop modifies the rows that have been retrieved by the cursor. A convenient way of modifying the rows is done by a method with two parts: the FOR UPDATE clause in the cursor declaration, WHERE CURRENT OF CLAUSE in an UPDATE or declaration statement.
    29 There is a string 120000 12 0 .125 , how you will find the position of the decimal place?
    INSTR('120000 12 0 .125',1,'.')output 13
    30 There is a % sign in one field of a column. What will be the query to find it?
    '' Should be used before '%'.
    31 Suppose a customer table is having different columns like customer no, payments.What will be the query to select top three max payments?
    SELECT customer_no, payments from customer C1
    WHERE 3<=(SELECT COUNT(*) from customer C2
    WHERE C1.payment <= C2.payment)
    32 minvalue.sql Select the Nth lowest value from a table
    select level, min('col_name') from my_table where level = '&n' connect by prior ('col_name') <
    'col_name')
    group by level;
    Example:
    Given a table called emp with the following columns:
    -- id number
    -- name varchar2(20)
    -- sal number
    -- For the second lowest salary:
    -- select level, min(sal) from emp
    -- where level=2
    -- connect by prior sal < sal
    -- group by level
    33 maxvalue.sql Select the Nth Highest value from a table
    select level, max('col_name') from my_table where level = '&n' connect by prior ('col_name') >
    'col_name')
    group by level;
    Example:
    Given a table called emp with the following columns:
    -- id number
    -- name varchar2(20)
    -- sal number
    -- For the second highest salary:
    -- select level, max(sal) from emp
    -- where level=2
    -- connect by prior sal > sal
    -- group by level
    34 How you will avoid your query from using indexes?
    SELECT * FROM emp
    Where emp_no+' '=12345;
    i.e you have to concatenate the column name with space within codes in the where condition.
    SELECT /*+ FULL(a) */ ename, emp_no from emp
    where emp_no=1234;
    i.e using HINTS
    35 How you will avoid duplicating records in a query?
    By using DISTINCT
    36 How you were passing cursor variables in PL/SQL 2.2?
    In PL/SQL 2.2 cursor variables cannot be declared in a package.This is because the storage for a cursor variable has to be allocated using Pro*C or OCI with version 2.2, the only means of passing a cursor variable to a PL/SQL block is via bind variable or a procedure parameter.
    37 How you open and close a cursor variable.Why it is required?
    OPEN cursor variable FOR SELECT...Statement
    CLOSE cursor variable In order to associate a cursor variable with a particular SELECT statement OPEN syntax is used. In order to free the resources used for the query CLOSE statement is used.
    38 How will you delete duplicating rows from a base table?
    delete from table_name where rowid not in (select max(rowid) from table group by duplicate_values_field_name); or
    delete duplicate_values_field_name dv from table_name ta where rowid <(select min(rowid) from table_name tb where ta.dv=tb.dv);
    39 How do you find the numbert of rows in a Table ?
    A bad answer is count them (SELECT COUNT(*) FROM table_name)
    A good answer is :-
    'By generating SQL to ANALYZE TABLE table_name COUNT STATISTICS by querying Oracle System Catalogues (e.g. USER_TABLES or ALL_TABLES).
    The best answer is to refer to the utility which Oracle released which makes it unnecessary to do ANALYZE TABLE for each Table individually.
    40 Find out nth highest salary from emp table
    SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal);
    For Eg:-
    Enter value for n: 2
    SAL
    3700
    41 Display the records between two range?
    select rownum, empno, ename from emp where rowid in (select rowid from emp where rownum <=&upto minus select rowid from emp where rownum<&Start);
    42 Display the number value in Words?
    SQL> select sal, (to_char(to_date(sal,'j'), 'jsp'))
    from emp;
    the output like,
    SAL (TO_CHAR(TO_DATE(SAL,'J'),'JSP'))
    800 eight hundred
    1600 one thousand six hundred
    1250 one thousand two hundred fifty
    If you want to add some text like, Rs. Three Thousand only.
    SQL> select sal "Salary ",
    (' Rs. '|| (to_char(to_date(sal,'j'), 'Jsp'))|| ' only.'))
    "Sal in Words" from emp
    Salary Sal in Words
    800 Rs. Eight Hundred only.
    1600 Rs. One Thousand Six Hundred only.
    1250 Rs. One Thousand Two Hundred Fifty only.
    43 Display Odd/ Even number of records
    Odd number of records:
    select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp);
    Output:-
    1
    3
    5
    Even number of records:
    select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)
    Output:-
    2
    4
    6
    44 Difference between procedure and function.
    Functions are named PL/SQL blocks that return a value and can be called with arguments procedure a named block that can be called with parameter. A procedure all is a PL/SQL statement by itself, while a Function call is called as part of an expression.
    45 Difference between NO DATA FOUND and %NOTFOUND
    NO DATA FOUND is an exception raised only for the SELECT....INTO statements when the where clause of the querydoes not match any rows. When the where clause of the explicit cursor does not match any rows the %NOTFOUND attribute is set to TRUE instead.
    46 Difference between database triggers and form triggers?
    Data base trigger(DBT) fires when a DML operation is performed on a data base table. Form trigger(FT) Fires when user presses a key or navigates between fields on the screen
    Can be row level or statement level No distinction between row level and statement level.
    Can manipulate data stored in Oracle tables via SQL Can manipulate data in Oracle tables as well as variables in forms.
    Can be fired from any session executing the triggering DML statements. Can be fired only from the form that define the trigger.
    Can cause other database triggers to fire.Can cause other database triggers to fire, but not other form triggers.
    47 Difference between an implicit & an explicit cursor.
    PL/SQL declares a cursor implicitly for all SQL data manipulation statements, including quries that return only one row. However,queries that return more than one row you must declare an explicit cursor or use a cursor FOR loop.
    Explicit cursor is a cursor in which the cursor name is explicitly assigned to a SELECT statement via the CURSOR...IS statement. An implicit cursor is used for all SQL statements Declare, Open, Fetch, Close. An explicit cursors are used to process multirow SELECT statements An implicit cursor is used to process INSERT, UPDATE, DELETE and single row SELECT. .INTO statements.
    48 Can you use a commit statement within a database trigger?
    No.
    49 Can the default values be assigned to actual parameters?
    Yes
    50 Can cursor variables be stored in PL/SQL tables.If yes how. If not why?
    No, a cursor variable points a row which cannot be stored in a two-dimensional PL/SQL table.
    51 Can a primary key contain more than one columns?
    Yes
    52 Can a function take OUT parameters. If not why?
    No. A function has to return a value,an OUT parameter cannot return a value.
    53 What are various joins used while writing SUBQUERIES?
    Self join-Its a join foreign key of a table references the same table. Outer Join--Its a join condition used where One can query all the rows of one of the tables in the join condition even though they don't satisfy the join condition.
    Equi-join--Its a join condition that retrieves rows from one or more tables in which one or more columns in one table are equal to one or more columns in the second table.
    54 Differentiate between TRUNCATE and DELETE
    TRUNCATE deletes much faster than DELETE
    TRUNCATE
    DELETE
    It is a DDL statement It is a DML statement
    It is a one way trip,cannot ROLLBACK One can Rollback
    Doesn't have selective features (where clause) Has
    Doesn't fire database triggers Does
    It requires disabling of referential constraints. Does not require
    1 What is PL/SQL ?
    PL/SQL is a procedural language that has both interactive SQL and procedural programming language constructs such as iteration, conditional branching.
    2 Write the order of precedence for validation of a column in a table ?
    I. done using Database triggers.
    ii. done using Integarity Constraints.
    I & ii.
    Exception :
    3 Where the Pre_defined_exceptions are stored ?
    In the standard package.
    Procedures, Functions & Packages ;
    4 What are % TYPE and % ROWTYPE ? What are the advantages of using these over datatypes?
    % TYPE provides the data type of a variable or a database column to that variable.
    % ROWTYPE provides the record type that represents a entire row of a table or view or columns selected in the cursor.
    The advantages are : I. Need not know about variable's data type
    ii. If the database definition of a column in a table changes, the data type of a variable changes accordingly.
    5 What will happen after commit statement ?
    Cursor C1 is
    Select empno,
    ename from emp;
    Begin
    open C1; loop
    Fetch C1 into
    eno.ename;
    Exit When
    C1 %notfound;-----
    commit;
    end loop;
    end;
    The cursor having query as SELECT .... FOR UPDATE gets closed after COMMIT/ROLLBACK.
    The cursor having query as SELECT.... does not get closed even after COMMIT/ROLLBACK.
    6 What is the basic structure of PL/SQL ?
    PL/SQL uses block structure as its basic structure. Anonymous blocks or nested blocks can be used in PL/SQL.
    7 What is Raise_application_error ?
    Raise_application_error is a procedure of package DBMS_STANDARD which allows to issue an user_defined error messages from stored sub-program or database trigger.
    8 What is Pragma EXECPTION_INIT ? Explain the usage ?
    The PRAGMA EXECPTION_INIT tells the complier to associate an exception with an oracle error. To get an error message of a specific oracle error.
    e.g. PRAGMA EXCEPTION_INIT (exception name, oracle error number)
    9 What is PL/SQL table ?
    Objects of type TABLE are called "PL/SQL tables", which are modeled as (but not the same as) database tables, PL/SQL tables use a primary PL/SQL tables can have one column and a primary key.
    Cursors
    10 What is Overloading of procedures ?
    The Same procedure name is repeated with parameters of different datatypes and parameters in different positions, varying number of parameters is called overloading of procedures.
    e.g. DBMS_OUTPUT put_line
    What is a package ? What are the advantages of packages ?
    11 What is difference between a PROCEDURE & FUNCTION ?
    A FUNCTION is always returns a value using the return statement.
    A PROCEDURE may return one or more values through parameters or may not return at all.
    12 What is difference between a Cursor declared in a procedure and Cursor declared in a package specification ?
    A cursor declared in a package specification is global and can be accessed by other procedures or procedures in a package.
    A cursor declared in a procedure is local to the procedure that can not be accessed by other procedures.
    13 What is difference between % ROWTYPE and TYPE RECORD ?
    % ROWTYPE is to be used whenever query returns a entire row of a table or view.
    TYPE rec RECORD is to be used whenever query returns columns of different
    table or views and variables.
    E.g. TYPE r_emp is RECORD (eno emp.empno% type,ename emp ename %type
    e_rec emp% ROWTYPE
    cursor c1 is select empno,deptno from emp;
    e_rec c1 %ROWTYPE.
    14 What is an Exception ? What are types of Exception ?
    Exception is the error handling part of PL/SQL block. The types are Predefined and user defined. Some of Predefined exceptions are.
    CURSOR_ALREADY_OPEN
    DUP_VAL_ON_INDEX
    NO_DATA_FOUND
    TOO_MANY_ROWS
    INVALID_CURSOR
    INVALID_NUMBER
    LOGON_DENIED
    NOT_LOGGED_ON
    PROGRAM-ERROR
    STORAGE_ERROR
    TIMEOUT_ON_RESOURCE
    VALUE_ERROR
    ZERO_DIVIDE
    OTHERS.
    15 What is a stored procedure ?
    A stored procedure is a sequence of statements that perform specific function.
    16 What is a database trigger ? Name some usages of database trigger ?
    Database trigger is stored PL/SQL program unit associated with a specific database table. Usages are Audit data modifications, Log events transparently, Enforce complex business rules Derive column values automatically, Implement complex security authorizations. Maintain replicate tables.
    17 What is a cursor for loop ?
    Cursor for loop implicitly declares %ROWTYPE as loop index,opens a cursor, fetches rows of values from active set into fields in the record and closes
    when all the records have been processed.
    eg. FOR emp_rec IN C1 LOOP
    salary_total := salary_total +emp_rec sal;
    END LOOP;
    18 What is a cursor ? Why Cursor is required ?
    Cursor is a named private SQL area from where information can be accessed. Cursors are required to process rows individually for queries returning multiple rows.
    19 What happens if a procedure that updates a column of table X is called in a database trigger of the same table ?
    Mutation of table occurs.
    20 What are two virtual tables available during database trigger execution ?
    The table columns are referred as OLD.column_name and NEW.column_name.
    For triggers related to INSERT only NEW.column_name values only available.
    For triggers related to UPDATE only OLD.column_name NEW.column_name values only available.
    For triggers related to DELETE only OLD.column_name values only available.
    21 What are two parts of package ?
    The two parts of package are PACKAGE SPECIFICATION & PACKAGE BODY.
    Package Specification contains declarations that are global to the packages and local to the schema.
    Package Body contains actual procedures and local declaration of the procedures and cursor declarations.
    22 What are the two parts of a procedure ?
    Procedure Specification and Procedure Body.
    23 What are the return values of functions SQLCODE and SQLERRM ?
    SQLCODE returns the latest code of the error that has occurred.
    SQLERRM returns the relevant error message of the SQLCODE.
    24 What are the PL/SQL Statements used in cursor processing ?
    DECLARE CURSOR cursor name, OPEN cursor name, FETCH cursor name INTO or Record types, CLOSE cursor name.
    25 What are the modes of parameters that can be passed to a procedure ?
    IN,OUT,IN-OUT parameters.
    26 What are the datatypes a available in PL/SQL ?
    Some scalar data types such as NUMBER, VARCHAR2, DATE, CHAR, LONG, BOOLEAN.
    Some composite data types such as RECORD & TABLE.
    27 What are the cursor attributes used in PL/SQL ?
    %ISOPEN - to check whether cursor is open or not
    % ROWCOUNT - number of rows fetched/updated/deleted.
    % FOUND - to check whether cursor has fetched any row. True if rows are fetched.
    % NOT FOUND - to check whether cursor has fetched any row. True if no rows are featched.
    These attributes are proceeded with SQL for Implicit Cursors and with Cursor name for Explicit Cursors.
    28 What are the components of a PL/SQL Block ?
    Declarative part, Executable part and Exception part.
    Datatypes PL/SQL
    29 What are the components of a PL/SQL block ?
    A set of related declarations and procedural statements is called block.
    30 What are advantages fo Stored Procedures /
    Extensibility,Modularity, Reusability, Maintainability and one time compilation.
    1 What is PL/SQL ?
    PL/SQL is a procedural language that has both interactive SQL and procedural programming language constructs such as iteration, conditional branching.
    2 Write the order of precedence for validation of a column in a table ?
    I. done using Database triggers.
    ii. done using Integarity Constraints.
    I & ii.
    Exception :
    3 Where the Pre_defined_exceptions are stored ?
    In the standard package.
    Procedures, Functions & Packages ;
    4 What are % TYPE and % ROWTYPE ? What are the advantages of using these over datatypes?
    % TYPE provides the data type of a variable or a database column to that variable.
    % ROWTYPE provides the record type that represents a entire row of a table or view or columns selected in the cursor.
    The advantages are : I. Need not know about variable's data type
    ii. If the database definition of a column in a table changes, the data type of a variable changes accordingly.
    5 What will happen after commit statement ?
    Cursor C1 is
    Select empno,
    ename from emp;
    Begin
    open C1; loop
    Fetch C1 into
    eno.ename;
    Exit When
    C1 %notfound;-----
    commit;
    end loop;
    end;
    The cursor having query as SELECT .... FOR UPDATE gets closed after COMMIT/ROLLBACK.
    The cursor having query as SELECT.... does not get closed even after COMMIT/ROLLBACK.
    6 What is the basic structure of PL/SQL ?
    PL/SQL uses block structure as its basic structure. Anonymous blocks or nested blocks can be used in PL/SQL.
    7 What is Raise_application_error ?
    Raise_application_error is a procedure of package DBMS_STANDARD which allows to issue an user_defined error messages from stored sub-program or database trigger.
    8 What is Pragma EXECPTION_INIT ? Explain the usage ?
    The PRAGMA EXECPTION_INIT tells the complier to associate an exception with an oracle error. To get an error message of a specific oracle error.
    e.g. PRAGMA EXCEPTION_INIT (exception name, oracle error number)
    9 What is PL/SQL table ?
    Objects of type TABLE are called "PL/SQL tables", which are modeled as (but not the same as) database tables, PL/SQL tables use a primary PL/SQL tables can have one column and a primary key.
    Cursors
    10 What is Overloading of procedures ?
    The Same procedure name is repeated with parameters of different datatypes and parameters in different positions, varying number of parameters is called overloading of procedures.
    e.g. DBMS_OUTPUT put_line
    What is a package ? What are the advantages of packages ?
    11 What is difference between a PROCEDURE & FUNCTION ?
    A FUNCTION is always returns a value using the return statement.
    A PROCEDURE may return one or more values through parameters or may not return at all.
    12 What is difference between a Cursor declared in a procedure and Cursor declared in a package specification ?
    A cursor declared in a package specification is global and can be accessed by other procedures or procedures in a package.
    A cursor declared in a procedure is local to the procedure that can not be accessed by other procedures.
    13 What is difference between % ROWTYPE and TYPE RECORD ?
    % ROWTYPE is to be used whenever query returns a entire row of a table or view.
    TYPE rec RECORD is to be used whenever query returns columns of different
    table or views and variables.
    E.g. TYPE r_emp is RECORD (eno emp.empno% type,ename emp ename %type
    e_rec emp% ROWTYPE
    cursor c1 is select empno,deptno from emp;
    e_rec c1 %ROWTYPE.
    14 What is an Exception ? What are types of Exception ?
    Exception is the error handling part of PL/SQL block. The types are Predefined and user defined. Some of Predefined exceptions are.
    CURSOR_ALREADY_OPEN
    DUP_VAL_ON_INDEX
    NO_DATA_FOUND
    TOO_MANY_ROWS
    INVALID_CURSOR
    INVALID_NUMBER
    LOGON_DENIED
    NOT_LOGGED_ON
    PROGRAM-ERROR
    STORAGE_ERROR
    TIMEOUT_ON_RESOURCE
    VALUE_ERROR
    ZERO_DIVIDE
    OTHERS.
    15 What is a stored procedure ?
    A stored procedure is a sequence of statements that perform specific function.
    16 What is a database trigger ? Name some usages of database trigger ?
    Database trigger is stored PL/SQL program unit associated with a specific database table. Usages are Audit data modifications, Log events transparently, Enforce complex business rules Derive column values automatically, Implement complex security authorizations. Maintain replicate tables.
    17 What is a cursor for loop ?
    Cursor for loop implicitly declares %ROWTYPE as loop index,opens a cursor, fetches rows of values from active set into fields in the record and closes
    when all the records have been processed.
    eg. FOR emp_rec IN C1 LOOP
    salary_total := salary_total +emp_rec sal;
    END LOOP;
    18 What is a cursor ? Why Cursor is required ?
    Cursor is a named private SQL area from where information can be accessed. Cursors are required to process rows individually for queries returning multiple rows.
    19 What happens if a procedure that updates a column of table X is called in a database trigger of the same table ?
    Mutation of table occurs.
    20 What are two virtual tables available during database trigger execution ?
    The table columns are referred as OLD.column_name and NEW.column_name.
    For triggers related to INSERT only NEW.column_name values only available.
    For triggers related to UPDATE only OLD.column_name NEW.column_name values only available.
    For triggers related to DELETE only OLD.column_name values only available.
    21 What are two parts of package ?
    The two parts of package are PACKAGE SPECIFICATION & PACKAGE BODY.
    Package Specification contains declarations that are global to the packages and local to the schema.
    Package Body contains actual procedures and local declaration of the procedures and cursor declarations.
    22 What are the two parts of a procedure ?
    Procedure Specification and Procedure Body.
    23 What are the return values of functions SQLCODE and SQLERRM ?
    SQLCODE returns the latest code of the error that has occurred.
    SQLERRM returns the relevant error message of the SQLCODE.
    24 What are the PL/SQL Statements used in cursor processing ?
    DECLARE CURSOR cursor name, OPEN cursor name, FETCH cursor name INTO or Record types, CLOSE cursor name.
    25 What are the modes of parameters that can be passed to a procedure ?
    IN,OUT,IN-OUT parameters.
    26 What are the datatypes a available in PL/SQL ?
    Some scalar data types such as NUMBER, VARCHAR2, DATE, CHAR, LONG, BOOLEAN.
    Some composite data types such as RECORD & TABLE.
    27 What are the cursor attributes used in PL/SQL ?
    %ISOPEN - to check whether cursor is open or not
    % ROWCOUNT - number of rows fetched/updated/deleted.
    % FOUND - to check whether cursor has fetched any row. True if rows are fetched.
    % NOT FOUND - to check whether cursor has fetched any row. True if no rows are featched.
    These attributes are proceeded with SQL for Implicit Cursors and with Cursor name for Explicit Cursors.
    28 What are the components of a PL/SQL Block ?
    Declarative part, Executable part and Exception part.
    Datatypes PL/SQL
    29 What are the components of a PL/SQL block ?
    A set of related declarations and procedural statements is called block.
    30 What are advantages fo Stored Procedures /
    Extensibility,Modularity, Reusability, Maintainability and one time compilation.
    31 Name the tables where characteristics of Package, procedure and functions are stored ?
    User_objects, User_Source and User_error.
    32 Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database Trigger ? Why ?
    It is not possible. As triggers are defined for each table, if you use COMMIT of ROLLBACK in a trigger, it affects logical transaction processing.
    33 How packaged procedures and functions are called from the following?
    a. Stored procedure or anonymous block
    b. an application program such a PRC C, PRO COBOL
    c. SQL *PLUS
    a. PACKAGE NAME.PROCEDURE NAME (parameters);
    variable := PACKAGE NAME.FUNCTION NAME (arguments);
    EXEC SQL EXECUTE
    b.
    BEGIN
    PACKAGE NAME.PROCEDURE NAME (parameters)
    variable := PACKAGE NAME.FUNCTION NAME (arguments);
    END;
    END EXEC;
    c. EXECUTE PACKAGE NAME.PROCEDURE if the procedures does not have any
    out/in-out parameters. A function can not be called.
    34 How many types of database triggers can be specified on a table ? What are they ?
    Insert Update Delete
    Before Row o.k. o.k. o.k.
    After Row o.k. o.k. o.k.
    Before Statement o.k. o.k. o.k.
    After Statement o.k. o.k. o.k.
    If FOR EACH ROW clause is specified, then the trigger for each Row affected by the statement.
    If WHEN clause is specified, the trigger fires according to the returned Boolean value.
    35 Give the structure of the procedure ?
    PROCEDURE name (parameter list.....)
    is
    local variable declarations
    BEGIN
    Executable statements.
    Exception.
    exception handlers
    end;
    36 Give the structure of the function ?
    FUNCTION name (argument list .....) Return datatype is
    local variable declarations
    Begin
    executable statements
    Exception
    execution handlers
    End;
    37 Explain the usage of WHERE CURRENT OF clause in cursors ?
    WHERE CURRENT OF clause in an UPDATE,DELETE statement refers to the latest row fetched from a cursor.
    Database Triggers
    38 Explain the two type of Cursors ?
    There are two types of cursors, Implicit Cursor and Explicit Cursor.
    PL/SQL uses Implicit Cursors for queries.
    User defined cursors are called Explicit Cursors. They can be declared and used.
    39 Explain how procedures and functions are called in a PL/SQL block ?
    Function is called as part of an expression.
    sal := calculate_sal ('a822');
    procedure is called as a PL/SQL statement
    calculate_bonus ('A822');
    Programmatic Constructs
    Last Update: September 06, 2004
    1 What are the different types of PL/SQL program units that can be defined and stored in ORACLE database ?
    Procedures and Functions,Packages and Database Triggers.
    2 What are the differences between Database Trigger and Integrity constraints ?
    A declarative integrity constraint is a statement about the database that is always true. A constraint applies to existing data in the table and any statement that manipulates the table.
    A trigger does not apply to data loaded before the definition of the trigger, therefore, it does not guarantee all data in a table conforms to the rules established by an associated trigger.
    A trigger can be used to enforce transitional constraints where as a declarative integrity constraint cannot be used.
    3 What is difference between Procedures and Functions ?
    A Function returns a value to the caller where as a Procedure does not.
    4 What is Database Trigger ?
    A Database Trigger is procedure (set of SQL and PL/SQL statements) that is automatically executed as a result of an insert in,update to, or delete from a table.
    5 What is a Procedure ?
    A Procedure consist of a set of SQL and PL/SQL statements that are grouped together as a unit to solve a specific problem or perform a set of related tasks.
    6 What is a Package ?
    A Package is a collection of related procedures, functions, variables and other package constructs together as a unit in the database.
    7 What are the uses of Database Trigger ?
    Database triggers can be used to automatic data generation, audit data modifications, enforce complex Integrity constraints, and customize complex security authorizations.
    8 What are the advantages of having a Package ?
    Increased functionality (for example,global package variables can be declared and used by any proecdure in the package) and performance (for example all objects of the package are parsed compiled, and loaded into memory once)
    1 With which function of summary item is the compute at options required?
    percentage of total functions.
    2 Why is it preferable to create a fewer no. of queries in the data model?
    Because for each query, report has to open a separate cursor and has to rebind, execute and fetch data.
    3 Why is a Where clause faster than a group filter or a format trigger?
    Because, in a where clause the condition is applied during data retrieval than after retrieving the data.
    4 Which parameter can be used to set read level consistency across multiple queries?
    Read only.
    5 Which of the two views should objects according to possession?
    view by structure.
    6 Which of the above methods is the faster method?
    performing the calculation in the query is faster.
    7 Where is the external query executed at the client or the server?
    At the server.
    8 Where is a procedure return in an external pl/sql library executed at the client or at the server?
    At the client.
    9 When do you use data parameter type?
    When the value of a data parameter being passed to a called product is always the name of the record group defined in the current form. Data parameters are used to pass data to produts invoked with the run_product built-in subprogram.
    10 When a form is invoked with call_form, Does oracle forms issues a save point?
    Yes
    11 What are the important difference between property clause and visual attributes?
    Named visual attributes differ only font, color & pattern attributes, property clauses can contain this and any other properties. You can change the appearance of objects at run time by changing the named visual attributes programmatically , property clause assignments cannot be changed programmatically. When an object is inheriting from both a property clause and named visual attribute, the named visual attribute settings take precedence, and any visual attribute properties in the class are ignored.
    12 What use of command line parameter cmd file?
    It is a command line argument that allows you to specify a file that contain a set of arguments for r20run.
    13 What is WHEN-Database-record trigger?
    Fires when oracle forms first marks a record as an insert or an update. The trigger fires as soon as oracle forms determines through validation that the record should be processed by the next post or commit as an insert or update. c generally occurs only when the operators modifies the first item in the record, and after the operator attempts to navigate out of the item.
    14 What is use of term?
    The term file which key is correspond to which oracle report functions.
    15 What is trigger associated with the timer?
    When-timer-expired.
    16 What is the use of transactional triggers?
    Using transactional triggers we can control or modify the default functionality of the oracle forms.
    17 What is the use of place holder column?
    A placeholder column is used to hold calculated values at a specified place rather than allowing is to appear in the actual row where it has to appear.
    18 What is the use of image_zoom built-in?
    To manipulate images in image items.
    19 What is the use of hidden column?
    A hidden column is used to when a column has to embed into boilerplate text.
    20 What is the use of break group?
    A break group is used to display one record for one group ones. While multiple related records in other group can be displayed.
    21 What is the remove on exit property?
    For a modelless window, it determines whether oracle forms hides the window automatically when the operators navigates to an item in the another window.
    22 What is the purpose of the product order option in the column property sheet?
    To specify the order of individual group evaluation in a cross products.
    23 What is the maximum no of chars the parameter can store?
    The maximum no of chars the parameter can store is only valid for char parameters, which can be upto 64K. No parameters default to 23Bytes and Date parameter default to 7Bytes.
    24 What is the main diff. bet. Reports 2.0 & Reports 2.5?
    Report 2.5 is object oriented.
    25 What is the frame & repeating frame?
    A frame is a holder for a group of fields. A repeating frame is used to display a set of records when the no. of records that are to displayed is not known before.
    26 What is the difference between OLE Server & Ole Container?
    An Ole server application creates ole Objects that are embedded or linked in ole Containers ex. Ole servers are ms_word & ms_excel. OLE containers provide a place to store, display and manipulate objects that are created by ole server applications. Ex. oracle forms is an example of an ole Container.
    27 What is the difference between object embedding & linking in Oracle forms?
    In Oracle forms, Embedded objects become part of the form module, and linked objects are references from a form module to a linked source file.
    28 What is the difference between boiler plat images and image items?
    Boiler plate Images are static images (Either vector or bit map) that you import from the file system or database to use a graphical elements in your form, such as company logos and maps. Image items are special types of interface controls that store and display either vector or bitmap images. Like other items that store values, image items can be either base table items(items that relate directly to database columns) or control items. The definition of an image item is stored as part of the form module FMB and FMX files, but no image file is actually associated with an image item until the item is populate at run time.
    29 What is the difference between $$DATE$$ & $$DBDATE$$ $$DBDATE$$ retrieves the current database date $$date$$ retrieves the current operating system date.
    30 What is the diff. when Flex mode is mode on and when it is off?
    When flex mode is on, reports automatically resizes the parent when the child is resized.
    31 What is the diff. when confine mode is on and when it is off?
    When confine mode is on, an object cannot be moved outside its parent in the layout.
    32 What is the diff. bet. setting up of parameters in reports 2.0 reports 2.5?
    LOVs can be attached to parameters in the reports 2.5 parameter form.
    33 What is the advantage of the library?
    Libraries provide a convenient means of storing client-side program units and sharing them among multiple applications. Once you create a library, you can attach it to any other form, menu, or library modules. When you can call library program units from triggers menu items commands and user named routine, you write in the modules to which you have attach the library. When a library attaches another library, program units in the first library can reference program units in the attached library. Library support dynamic loading-that is library program units are loaded into an application only when needed. This can significantly reduce the run-time memory requirements of applications.
    34 What is term?
    The term is terminal definition file that describes the terminal form which you are using r20run.
    35 What is system.coordination_operation?
    It represents the coordination causing event that occur on the master block in master-detail relation.
    36 What is synchronize?
    It is a terminal screen with the internal state of the form. It updates the screen display to reflect the information that oracle forms has in its internal representation of the screen.
    37 What is strip sources generate options?
    Removes the source code from the library file and generates a library files that contains only pcode. The resulting file can be used for final deployment, but can not be subsequently edited in the designer. ex. f45gen module=old_lib.pll userid=scott/tiger strip_source YES output_file
    38 What is relation between the window and canvas views?
    Canvas views are the back ground objects on which you place the interface items (Text items), check boxes, radio groups etc.,) and boilerplate objects (boxes, lines, images etc.,) that operators interact with us they run your form . Each canvas views displayed in a window.
    39 What is pop list?
    The pop list style list item appears initially as a single field (similar to a text item field). When the operator selects the list icon, a list of available choices appears.
    40 What is new_form built-in?
    When one form invokes another form by executing new_form oracle form exits the first form and releases its memory before loading the new form calling new form completely replace the first with the second. If there are changes pending in the first form, the operator will be prompted to save them before the new form is loaded.
    41 What is lexical reference? How can it be created?
    Lexical reference is place_holder for text that can be embedded in a sql statements. A lexical reference can be created using & before the column or parameter name.
    42 What is forms_DDL?
    Issues dynamic Sql statements at run time, including server side pl/SQl and DDL
    43 What is difference between open_form and call_form?
    when one form invokes another form by executing open_form the first form remains displayed, and operators can navigate between the forms as desired. when one form invokes another form by executing call_form, the called form is modal with respect to the calling form. That is, any windows that belong to the calling form are disabled, and operators cannot navigate to them until they first exit the called form.
    44 What is bind reference and how can it be created?
    Bind reference are used to replace the single value in sql, pl/sql statements a bind reference can be created using a (:) before a column or a parameter name.
    45 What is an user exit used for?
    A way in which to pass control (and possibly arguments ) form Oracle report to another Oracle products of 3 GL and then return control ( and ) back to Oracle reports.
    46 What is an OLE?
    Object Linking & Embedding provides you with the capability to integrate objects from many Ms-Windows applications into a single compound document creating integrated applications enables you to use the features form .
    47 What is an object group?
    An object group is a container for a group of objects; you define an object group when you want to package related objects, so that you copy or reference them in other modules.
    48 What is an anchoring object & what is its use?
    An anchoring object is a print condition object which used to explicitly or implicitly anchor other objects to itself.
    49 What is a User_exit?
    Calls the user exit named in the user_exit_string. Invokes a 3Gl program by name which has been properly linked into your current oracle forms executable.
    50 What is a timer?
    Timer is an "internal time clock" that you can programmatically create to perform an action each time the timer expires.
    51 What is a Text_io Package?
    It allows you to read and write information to a file in the file system.
    52 What is a text list?
    The text list style list item appears as a rectangular box which displays the fixed number of values. When the text list contains values that can not be displayed, a vertical scroll bar appears, allowing the operator to view and select undisplayed values.
    53 What is a property clause?
    A property clause is a named object that contains a list of properties and their settings. Once you create a property clause you can base other object on it. An object based on a property can inherit the setting of any property in the clause that makes sense for that object.
    54 What is a physical page ? & What is a logical page ?
    A physical page is a size of a page. That is output by the printer. The logical page is the size of one page of the actual report as seen in the Previewer.
    55 What is a library?
    A library is a collection of subprograms including user named procedures, functions and packages.
    56 What is a difference between pre-select and pre-query?
    Fires during the execute query and count query processing after oracle forms constructs the select statement to be issued, but before the statement is actually issued. The pre-query trigger fires just before oracle forms issues the select statement to the database after the operator as define the example records by entering the query criteria in enter query mode. Pre-query trigger fires before pre-select trigger.
    57 What is a combo box?
    A combo box style list item combines the features found in list and text item. Unlike the pop list or the text list style list items, the combo box style list item will both display fixed values and accept one operator entered value.
    58 What does the term panel refer to with regard to pages?
    A panel is the no. of physical pages needed to print one logical page.
    59 What are visual attributes?
    Visual attributes are the font, color, pattern proprieties that you set for form and menu objects that appear in your application interface.
    60 What are three panes that appear in the run time pl/sql interpreter?
    1.Source pane. 2. interpreter pane. 3. Navigator pane.
    Regards
    B RANGARAJAN

  • How to comment my SQL in PL/SQL so that the comment carries to AWR?

    Is there anything about using comments as in /* some comment */ in a SQL statement in a PL SQL procedure and expecting that to be carried thru to AWR?
    Right now it seems my comments are not visible in the AWR history. I'm wondering if they are compiled out when they are in PL/SQL blocks or not?
    Is there a way to preserve them such that they remain without using dynamic sql?

    steffi wrote:
    Is there anything about using comments as in /* some comment */ in a SQL statement in a PL SQL procedure and expecting that to be carried thru to AWR?Comments are stripped from (static) SQL code written in PL/SQL, unless that comment is a CBO hint.
    It is a "+Good Thing+" as it reduces the memory footprint of the cursor in the shared pool. It also ensures a greater potential degree of cursor sharing as the very same SQL statement with different comments will wind up as a single re-usable cursor.
    Why exactly do you want to see comments in SQL cursors in AWR reports? This is just a high level overview - not sure what enlightenment SQL comments will bring.

Maybe you are looking for

  • Iview calling R/3 transaction with double click to call url

    Hello, I have create a bespoke transaction that displays EH&S incidents, the user has the option to double a line which calls a web dynpro and displays in a new window. (FM CALL_BROWSER is used to open the URL) This functionality works in R/3, if a u

  • What are the little ticks to the left of a song?

    I just went through my whole library ticking the boxes of songs I thought would sync to my iPod Touch but when I went to sync it's selecting random songs (I told it too). Is there no way to have a selection of songs that I choose when synced?

  • Stop and Start BI Publisher 12c OEM

    How to stop and start BI Publisher which is installed in 12c OEM. OMS is running on OEL 64 bit. I need a help in doing this step by step commands. Wherever i read it says Stop BI Publisher using weblogic Administration console which I don't have an i

  • Dragging sprites from a window to another???

    Hello, How can I drag moveable sprites from a window (miaw) to another? I have two layered windows. I want to drag a sprite from the window on bottom to the window on top (miaw). The problem is that the sprite stays behind the target window... - Stef

  • Unable to connect to network iphone update server

    I have an Iphone 4 that has been slow for a couple of days , today it started to open app different apps ( click on one and another opened) so i decided to restore and update it . Was running 4.3 . It never updated , has locked in recovery mode . whe