Querry assistance in sql

SELECT
CASE WHEN e.EA_STATUS IN ('E4', 'U4', 'P5', '02', '03', '04') and t.TRANS_GROUP IN ('3500', '9100')
THEN 1 -- PROJECT
WHEN e.EA_STATUS NOT IN ('E4', 'U4', 'P5', '02', '03', '04') and t.TRANS_GROUP IN ('3500')
THEN 2 -- NON PROJECT
ELSE 0 -- UNKNOWN
END AS EXPENDITURE_GROUP_SK
FROM dbo.STG_FMTMPROD_V_EA_STATUS AS e
inner join dbo.STG_FMTMPROD_V_TRANS_GROUP as t
on e.STATUS = t.STATUS
This is a querry I am working on.Do you know how I can convert the 0,1, and 2 to be treturned as string so I can have the project , non-project and unknown  aa my option rather than the numbers.
Thanks.

What exactly did you try? The query suggested by Prashanth should work just fine and return the column as varchar. 
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles

Similar Messages

  • How to connect to DB in repository assistant using SQL*net

    Hi all,
    We are in RAC enviroment. When I try to connecting to oracle DB in repository assistant (the page that asks for SYS account), I check the SQL*net, and enter the net service name (absolutly also enter the SYS and SYS psw field), but the 'next' button is grey out.
    according to installation guide, in a RAC environment, do not type the host name, port number and oracle service name. But in my case, I have to enter all these fields to enable the 'next' button.
    any idea of how to fix it?
    thanks

    I forget to say that I can connect to the repository browser using SQL*net. So I suppose that net service name is correct.
    thanks for any suggestion.

  • Unable to excute querry in PL/SQL developer.

    Hi all,
    i typed a querry called * select * from sgva_doc * from PL/SQL DEVELOPER commnad window.
    It has got 2900 records.
    But it is getting hanged .
    the below queery works fine
    select "column_name" from sgva_doc
    CAN ANY ONE HELP IN SOLVING THIS.

    user9276312 wrote:
    Hi all,
    i typed a querry called * select * from sgva_doc * from PL/SQL DEVELOPER commnad window.
    It has got 2900 records.
    But it is getting hanged .
    the below queery works fine
    select "column_name" from sgva_doc
    CAN ANY ONE HELP IN SOLVING THIS.PLease read these two threads,
    How to post a SQL tuning request
    HOW TO: Post a SQL statement tuning request - template posting
    And,
    When your query takes too long
    When your query takes too long ...
    HTH
    Aman....

  • Need assistance in SQL query (10 years since I did SQL)

    Hi Guys,
    I've been trying to remove some SQL rust. I haven't done SQL in a while.
    Here are the tables (%=int, $ = varcchar)
    RESULT
    % RESULT_ID----$ RC--------------% YEAR_ID----% PERIOD_ID--% CONTRACT_NO----%Value
    20841---------------1439---------------83---------------37---------------010427102---------------1
    20842---------------1439---------------83---------------41---------------010427102---------------2
    20843---------------1439---------------84---------------37---------------010427102---------------3
    20844---------------1439---------------84---------------41---------------010427102---------------4
    20845---------------1439---------------83---------------34---------------010427102---------------5
    YEARS
    YEAR_ID-------YEAR_DESC
    83---------------2010 - 2011
    84---------------2011 - 2012
    PERIOD
    PERIOD_ID-----PERIOD_DESC
    34---------------14          
    37---------------02
    41---------------03
    What I want is to get the last period of each year in table RESULT. (I'll work the rest of the WHERE Statement myself, because I omitted a lot of info/columns for simplicity reasons)
    Note that I cannot rely on the Period ID, because chronological order is not respected.
    In the above scenario I should GET
    % RESULT_ID----$ RC--------% YEAR_ID-------% PERIOD_ID------% CONTRACT_NO-----%Value
    20844---------------1439---------------84---------------41---------------010427102---------------4
    20845---------------1439---------------83---------------34---------------010427102---------------5
    I have the following but it only returns values if The year Has the last Period !
    SELECT DISTINCT RESULT.RESULT_ID, RESULT.RC, RESULT.PERIOD_ID, RESULT.YEAR_ID, RESULT.CONTRACT_NO, YEARS.YEAR_DESC
    FROM RESULT, YEARS
    WHERE RESULT.YEAR_ID = YEARS.YEAR_ID AND -- This is my problem I want last period for each year.
    RESULT.PERIOD_ID = (SELECT PERIOD_ID FROM PERIOD WHERE CAST(PERIOD_DESC AS INT) = (Select MAX(CAST(PERIOD_DESC AS INT)) from period)) ---I think this works fine i'm able to get last period
    ORDER BY YEARS.YEAR_DESC;
    Edited by: 935079 on May 17, 2012 11:32 AM
    formatting add space not tabs
    Edited by: 935079 on May 17, 2012 11:35 AM

    Hi,
    935079 wrote:
    When I state "latest" it means the GREATEST PERIOD_DESC For each YEAR_ID.I see. In that case, you need to join the result and period tables in the sub-query.
    I should have added that EACH CONTRACT_NO has to have a latest period for each year_id (In the above example I only one distinct contract_no)So you don't want one row of output for each distinct year_id; you want an output row for each distinct combination of contract_no and year_id. So where I originally used year_id (in the PARTITION BY clause) you'll want to both year_id and contract_no.
    I think you want something like this:
    WITH     got_r_num     AS
         SELECT  r.*          -- or list the columns you want
         ,     ROW_NUMBER () OVER ( PARTITION BY  r.year_id
                                   ,                    r.contract_no
                                   ORDER BY          p.period_id     DESC     NULLS LAST
                           ) AS r_num
         FROM    result  r
         JOIN     period     p  ON     r.period_id     = p.period_id
    SELECT     *     -- or list all columns except r_num
    FROM     got_r_num
    WHERE     r_num     = 1
    ;>
    There are a lot of things I don't understand in your query I will have to learn
    "ROW_NUMBER ()"
    "OVER"
    "PARTITION BY"
    "NULLS LAST"
    I have no idea what these do. Thanks, Now I have some reading to do :-)ROW_NUMBER is an analytic function. You can find out more about it in the SQL language manual
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions156.htm#sthref1471
    Analytic functions were new in Oracle 8.1. That version was released more than 10 years ago, but you might not have had the most recent version of Oracle at that time, so it's quite reasonable that ROW_NUMBER is new to you.
    Analytic functions are extremely useful, but, I admit, the syntax ("... OVER (analytic_clasue)") is frightening at first. When reading about ROW_NUMBER, make sure you also follow the link to "Analytic Functions"
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions004.htm#i81407

  • SQL question: group by horizontally

    Hi,
    I'm having trouble figuring out a way to display the result of a join in the following tabular format. Can someone please assist?
    SQL> select * from tab1;
    GNAME SNO
    ABC 5
    DEF 2
    ABC 3
    SQL> select * from tab2;
    GNAME SNO
    ABC 10
    XYZ 5
    DEF 15
    My current output using a UNION ALL:
    SQL> select gname, count(*) sno1 from tab1 group by gname
    2 union all
    3 select gname, count(*) sno2 from tab2 group by gname;
    GNAME SNO1
    ABC 2
    DEF 1
    ABC 1
    DEF 1
    XYZ 1
    The output I'm expecting:
    GNAME SNO1          SNO2
    ABC 2 1
    DEF 1 1
    XYZ 0 1
    Thanks in advance.

    szsl wrote:
    My current output using a UNION ALL:
    SQL> select gname, count(*) sno1 from tab1 group by gname
    2 union all
    3 select gname, count(*) sno2 from tab2 group by gname;you need this to identify all distinct gnames.
    with tab1 as (
    select 'ABC' as gname, 5 as sno from dual union all
    select 'DEF' as gname, 2 as sno from dual union all
    select 'ABC' as gname, 3 as sno from dual
    ), tab2 as (
    select 'ABC' as gname, 10 as sno from dual union all
    select 'XYZ' as gname, 5 as sno from dual union all
    select 'DEF' as gname, 15 as sno from dual
    select a.gname, sum( case when tab1.gname is not null then 1 else 0 end) as cnt_1,
    sum( case when tab2.gname is not null then 1 else 0 end) as cnt_2
    from (
      select distinct gname from (select gname from tab1 union all select gname from tab2)
    ) a
    left join tab1 on tab1.gname = a.gname
    left join tab2 on tab2.gname = a.gname
    group by a.gname
    order by a.gname
    ;output:
    GNAME CNT_1 CNT_2
    ABC       2     2
    DEF       1     1
    XYZ       0     1

  • SQL-02100: Unable to open message file (SQL-02113)

    Hi,
    We use Oracle 8.1.7 on HP-UX and got today quite a lot of error :
    SQL-02100: Unable to open message file (SQL-02113)
    What could be the problem?
    From what I found in the internet :
    SQL-02100 Out of memory (i.e., could not allocate)
    Cause: SQLLIB was unable to allocate enough memory to execute the program.
    Action: Allocate more memory to the user session, then rerun the program. If the error persists, call Oracle Customer Support for assistance.
    SQL-02113 Unable to open message file
    Cause: SQLLIB was unable to find or open the SQLLIB message file, SQL*.MSB.
    Action: Check that this file exists in the MESG directory and that it is readable.
    But I dont know much detail about that. Anyone can suggest what should be checked?
    I compared the .../rdbms/mesg folder with other 8.1.7 installation and it is the same (number of files, permissions).
    Please help.
    Thanks

    Check if your ORACLE_HOME environment variable is set correctly, if not set it and try again.
    Regards,
    PP

  • Help with sql extract

    I need assistance on sql extract for time frame between July 2009 to current date but
    Time needs to be just for 7AM.
    select * FROM table
    where system_time > TO_DATE('07/01/2009 07:00:00', 'MM/DD/YYYY HH24:MI:SS')
    BUT the time must be = 7AM.
    THANKS!

    Time needs to be just for 7AM.as is 07:00 & not 07:01 or 07:02, etc?
    where system_time = TO_DATE('07/01/2009 07:00:00', 'MM/DD/YYYY HH24:MI:SS')
    or
    where system_time BETWEEN TO_DATE('07/01/2009 07:00:00', 'MM/DD/YYYY HH24:MI:SS') and TO_DATE('07/01/2009 07:59:59', 'MM/DD/YYYY HH24:MI:SS')

  • Sql trace (st05)

    hi friends
    .pls tell in detail how to evaluate  the performance of one select querry by using sql trace.( pls tell all traces )

    Kumar,
      SQL Trace
    SQL trace(ST05) provides the developer with the ability to analyse database select statements. Simply execute ST05
    to turn on SQL trace, then execute the statement/program you want to analyse. Now turn off SQL trace using ST05
    and click on list trace to view the details.
    You can also perform traces on other items such as authorisation objects.
    Authorisation trace analysis 1. Open two sessions
    2. Execute transaction ST01 in one of the sessions
    3. Select the authorisation checkbox, note the other traces
    you can perform (SQL, RFC, Table Buffer etc)
    4. Click the 'Trace On' button
    5. Within your other session execte the transaction/report
    you want to trace or get the user in question to do it
    6. Return to the session where you turned the trace on and
    click on 'Trace Off' otherwise it will continue to record
    all athorisation checks
    7. Click on the 'Analysis' button
    8. Enter appropriate data into selection screen such as
    Username, type of trace records (i.e. Authorization check)
    9. Click on the Execute button.
    10. Report displaying trace results will now be displayed
    http://www.sapdevelopment.co.uk/perform/perform_sqltrace.htm
    Some useful transaction related to this are ..
    ST01 SAP system trace
    ST02 Buffer statistics.
    ST03 Workload analysis.
    ST04 Database performance analysis.
    ST05 SQL trace .
    ST06 Operating system monitor ...
    From the recorded SQL trace you can deduce:
    · Which SQL statements your application carries out
    · Which values the system uses for specific database accesses and changes
    · How the system translates ABAP OPEN SQL commands (such as
    SELECT) into standard SQL commands
    · Where your application positions COMMIT statements
    · Where your application makes repeated database accesses
    · What database accesses or changes occur in the update section of your
    application
    Look at the below links, you will get the idea
    http://help.sap.com/saphelp_erp2005/helpdata/en/d1/801f89454211d189710000e8322d00/content.htm
    http://www.sapbrain.com/TOOLS/SQLTRACE/SQL_TRACE.html
    Don't forget to reward if useful...

  • NET8의 LOGGING과 TRACE 관련 PARAMETER에 대한 Q & A

    제품 : SQL*NET
    작성날짜 : 2002-05-07
    NET8의 LOGGING과 TRACE 관련 PARAMETER에 대한 Q & A
    =================================================
    PURPOSE
    Net8을 이용하면서 발생하는 문제를 추적 하기위해 oracle의 configuration
    file에 들어갈 수 있는 parameter와 logging과 tracing을 하는 방법에 대해
    질의/응답을 통해 알아 보도록 한다.
    Explanation
    1) NET8에서 trace를 사용하는 이유와 어떤 component들에 trace를 할 수 있나?
    Trace의 특징은 네트워크을 수행하게 될때 network event들을 기술한다
    즉 trace와 관련된 일련의 문장들이 자세하게 생성된다.
    "Tracing"의 운영으로 log파일에 제공되어 있는 것 보다 NET8의 component들의
    내부적인 정보를 보다 많이 얻을 수 있다.
    이러한 정보는 에러의 결과로 인하여 발생하는 동일한 event들로 파일들에
    결과가 생성되어 이를 이용하여 문제의 원인을 판단할 수 있다.
    주의 : trace의 기능을 이용하는 경우 충분한 disk space와 system performance의
    현격한 저하를 가져올 수 있다 즉 trace의 기능은 반드시 필요할
    경우에만 사용할 것을 권한다.
    << trace의 기능을 이용하여 trace를 할 수 있는 component들 >>
    * Network listener
    * Net8 components on the client and server
    * Connection Manager
    * Oracle Names Server
    * Oracle Names Control Utility
    * TNSPING utility
    2) 어떤 parameter들을 설정하면 trace 기능을 이용할 수 있는가 ?
    tracing을 하기 위해서는 특정 trace parameter들을 설정함으로써 가능하며
    아래에 주어진 방법들과 또는 utility들중 하나를 선택하여 설정함으로써
    사용할 수 있다.
    * Component Configuration Files
    * Component Control Utilities
    * Oracle Trace
    component의 configuration 파일을 이용하여 traceing parameter를 설정하려면
    1.component의 configuration 파일에 다음의 traceing parameter를 설정한다.
    - SQLNET.ORA for client or server, LISTENER.ORA for listener:
    TRACE_LEVEL_<CLIENT/LISTENER/SERVER>=(0/4/10/16)
    TRACE_DIRECTORY_<CLIENT/LISTENER/SERVER>=<directory name>
    LOG_DIRECTORY_<CLIENT/LISTENER/SERVER>=<directory name>
    2.만일 component들이 수행중인 동안 configuration 파일의 수정이 있었다면
    병경된 parameter들을 사용하기 위해 component들을 다시 시작하여야 한다.
    component control utility들을 이용하여 trace parameter들을 설정하려면
    1. listener의 경우, Listener Control Utility(lsnrctl)에서 TRACE 명령어를
    이용하여 listener가 수행중인 동안에도 trace level을 설정할 수 있다.
    EX)
         RC80:/mnt3/rctest80> lsnrctl
         LSNRCTL for SVR4: Version 8.0.4.0.0 - Production on 01-SEP-98 15:16:52
         (c) Copyright 1997 Oracle Corporation. All rights reserved.
         Welcome to LSNRCTL, type "help" for information.
         LSNRCTL> trace admin
         Connecting to (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))
         Opened trace file: /mnt4/coe/app/oracle/product/8.0.4/network/trace/
    lsnr_coe.trc
         The command completed successfully
         LSNRCTL> trace off
         Connecting to (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))
         The command completed successfully
         LSNRCTL> exit
         RC80:/mnt3/rctest80>
    2. Oracle Names의 경우, Names Control Utility(namesctl)에서 TRACE_LEVEL
    명령어를 이용하여 Oracle Names가 수행중인 동안에도 trace level을
    설정할 수 있다.
    주의 : Connection Manager의 경우, trace level은 configuration 파일인 CMAN.ORA
    에서만 설정할 수 있다.
    Oracle Enterprose manager(이하 OEM)에 있는 Oracle Trace는 trace parameter들을
    설정하고 GUI를 통해 trace data의 형태를 볼수 있도록 하는 tracing tool이다.
    3) trace된 data를 해석할 수 있는 다른 utility들이 있다면 ?
    Trace Assistant를 사용하면 사용자의 *.trc 파일 (SQL*Net v2의 형식에 의해
    생성된) 또는 *.txt (Orace Trace 과 TRCFMT에 의해 생성된 출력물)을 통해
    trac된 정보를 해석할 수 있다.
    이 유틸리티 네트워크의 문제들로 인해 발생하는 문제점들을 진단하고
    해결하는 데 보다 많은 정보를 제공하여 사용자의 이해를 돕는다.
    * the source and destination of trace files
    * the flow of packets between network nodes
    * which component of Net8 is failing
    * pertinent error codes
    다음에 주어진 명령어를 수행하므로써 Trace Assistant 실행할 수 있다.
    trcasst [options] <filename>
    Trace Assistant Text Formatting Options
    -o Displays connectivity and Two Task Common (TTC) information.
    After the -o the following options may be used:
    c (for summary connectivity information)
    d (for detailed connectivity information)
    u (for summary TTC information)
    t (for detailed TTC information)
    q (displays SQL commands enhancing summary TTC information)
    -p Oracle Internal Use Only
    -s Displays statistical information
    -e Enables display of error information After the -e, zero
    or one error decoding level may follow:
    0 or nothing : translates the NS error numbers dumped from the
    nserror function plus lists all other errors
    1 : displays only the NS error translation from the nserror function
    2 : displays error numbers without translation
    만일 option들이 제공되지 않는다면 기본적으로 -odt -e -s가 지정되어 자세한
    connectivity, Two-Task Common, 에러 level 0 그리고 통계정보들이 tracing 된다.
    4) SQL*Net v2 tracing과 어떻게 다른가 ?
    Net8 tracing에서는 이전 버전인 SQL*NET V2에서 제공 되는 모든 option을
    포함하고 있고 Oracle Trace의 기능이 추가되었다.
    이것은 Oracle Trace Repository를 OEM 콘솔을 통하여 사용자의 trace 정보를
    관리할 수 있도록 허용한다.
    5) *.cdf와 *.dat은 어떤 파일 인가 ?
    *.cdf 와 *.dat 파일들은 Oracle Trace에 의해 생성되는 파일들로서 이 파일들을
    읽기 위해서는 반드시 trcfmt utility를 이용해야만 한다.
    trcfmt는 binary (*.dat와 *.cdf의 확장자) 파일내에 있는 data를
    일반 text(.txt의 확장자)로 정보를 추출한다. 이 tool을 사용하기 위해서는
    다음의 명령어를 이용하면 된다.
    trcfmt collection.cdf
    주의 : .cdf와 .dat파일이 존재하는 디렉토리가 아닌 곳에서 이 tool을 이용
         한다면 path가 포함되야 한다. 만일 하나의 .cdf 와 .dat 파일들내에
         여러 프로세스들의 tracing정보가 수집된다면 그것들은 process_id.txt의
    이름과 함께 파일이 추출될 것이다.
    6) trac관련 configuration은 어떤 것이 있으며 설정할 수 있는 parameter는
    무엇이 있는가 ?
    ==========================================================================
    || SQLNET.ORA Parameters ||
    ==========================================================================
    DAEMON.TRACE_DIRECTORY
    Purpose: Controls the destination directory of the Oracle
    Enterprise Manager daemon trace file
    Default Value: $ORACLE_HOME/network/trace
    Description
    Available Oracle Enterprise Manager Installation Guide
    Example: DAEMON.TRACE_DIRECTORY=/oracle/traces
    DAEMON.TRACE_LEVEL
    Purpose: Turns tracing on/off to a certain specified level for
    the Oracle Enterprise Manager daemon.
    Default Value: 0 or OFF
    * 0 or OFF - No trace output
    * 4 or USER - User trace information
    Available Values
    * 10 or ADMIN - Administration trace information
    * 16 or SUPPORT - WorldWide Customer Support trace
    information
    Description
    Available Oracle Enterprise Manager Installation Guide
    Example: DAEMON.TRACE_LEVEL=10
    DAEMON.TRACE_MASK
    Purpose: Specifies that only the Oracle Enterprise Manager daemon
    trace entries are logged into the trace file.
    Default Value: $ORACLE_HOME/network/trace
    Description
    Available Oracle Enterprise Manager Installation Guide
    Example: DAEMON.TRACE_MASK=(106)
    LOG_DIRECTORY_CLIENT
    Purpose: Controls the directory for where the log file is written
    Default Value: Current directory where executable is started from.
    Example: LOG_DIRECTORY_CLIENT=/oracle/network/trace
    LOG_DIRECTORY_SERVER
    Purpose: Controls the directory for where the log file is written
    Default Value: Current directory where executable is started from.
    Valid in File: SQLNET.ORA
    Example: LOG_DIRECTORY_SERVER=/oracle/network/trace
    LOG_FILE_CLIENT
    Purpose: Controls the log output filename for an Oracle client.
    Default Value: SQLNET.LOG
    Example: LOG_FILE_CLIENT=client
    LOG_FILE_SERVER
    Purpose: Controls the log output filename for an Oracle server.
    Default Value: SQLNET.LOG
    Example: LOG_FILE_SERVER=svr
    NAMESCTL.TRACE_LEVEL
    Purpose: Indicates the level at which the NAMESCTL program should
    be traced.
    Default Value: OFF
    Values: OFF, USER, or ADMIN
    Example: NAMESCTL.TRACE_LEVEL=ADMIN
    NAMESCTL.TRACE_FILE
    Purpose: Indicates the file in which the NAMESCTL trace output is
    placed.
    Default Value: namesctl_PID.cdf and namesctl_PID.dat
    Example: NAMESCTL.TRACE_FILE=NMSCTL
    NAMESCTL.TRACE_DIRECTORY
    Purpose: Indicates the directory where trace output from the NAMESCTL
    utility is placed.
    Default
    Value: $ORACLE_HOME/network/trace
    Example: NAMESCTL.TRACE_DIRECTORY=/ORACLE/TRACE
    NAMESCTL.TRACE_UNIQUE
    Indicates whether a process identifier is appended to the
    Purpose: name of each trace file generated, so that several can
    coexist.
    Default
    Value: OFF
    Values: OFF or ON
    Example: NAMESCTL.TRACE_UNIQUE = ON
    TNSPING.TRACE_DIRECTORY
    Purpose: Control the destination directory of the trace file
    Default Value: $ORACLE_HOME/network/trace
    Example: TNSPING.TRACE_DIRECTORY=/oracle/traces
    TNSPING.TRACE_LEVEL
    Purpose: Turns tracing on/off to a certain specified level
    Default Value: 0 or OFF
    * 0 or OFF - No trace output
    * 4 or USER - User trace information
    Available Values
    * 10 or ADMIN - Administration trace information
    * 16 or SUPPORT - WorldWide Customer Support trace
    information
    Example: TNSPING.TRACE_LEVEL=10
    TRACE_DIRECTORY_CLIENT
    Purpose: Control the destination directory of the trace file
    Default Value: $ORACLE_HOME/network/trace
    Example: TRACE_DIRECTORY_CLIENT=/oracle/traces
    TRACE_DIRECTORY_SERVER
    Purpose: Control the destination directory of the trace file
    Default Value: $ORACLE_HOME/network/trace
    Example: TRACE_DIRECTORY_SERVER=/oracle/traces
    TRACE_FILE_CLIENT
    Purpose: Controls the name of the client trace file
    Default Value: SQLNET.CDF and SQLNET.DAT
    Example: TRACE_FILE_CLIENT=cli
    TRACE_FILE_SERVER
    Purpose: Controls the name of the server trace file
    Default Value: SVR_PID.CDF and SVR_PID.DAT
    Example: TRACE_FILE_SERVER=svr
    TRACE_LEVEL_CLIENT
    Purpose: Turns tracing on/off to a certain specified level
    Default Value: 0 or OFF
    * 0 or OFF - No trace output
    * 4 or USER - User trace information
    Available Values
    * 10 or ADMIN - Administration trace information
    * 16 or SUPPORT - WorldWide Customer Support trace
    information
    Example: TRACE_LEVEL_CLIENT=10
    TRACE_LEVEL_SERVER
    Purpose: Turns tracing on/off to a certain specified level
    Default Value: 0 or OFF
    * 0 or OFF - No trace output
    * 4 or USER - User trace information
    Available Values
    * 10 or ADMIN - Administration trace information
    * 16 or SUPPORT - WorldWide Customer Support trace
    information
    Example: TRACE_LEVEL_SERVER=10
    TRACE_UNIQUE_CLIENT
    Used to make each client trace file have a unique name to
    Purpose: prevent each trace file from being overwritten with the next
    occurrence of the client. The PID is attached to the end of
    the filename.
    Default
    Value: OFF
    Example: TRACE_UNIQUE_CLIENT=ON
    USE_CMAN
    If the session is in an Enhanced Discovery Network with a
    Purpose: Names Server, this parameter forces all sessions to go
    through a Connection Manager to get to the server.
    Default
    Value: FALSE
    Values: TRUE or FALSE
    Example: USE_CMAN=TRUE
    ==========================================================================
    || LISTENER.ORA Parameters ||
    ==========================================================================
    LOG_DIRECTORY_listener_name
    Purpose: Controls the directory for where the log file is written
    Default Value: Current directory where executable is started from.
    Example: LOG_DIRECTORY_LISTENER=/oracle/traces
    LOG_FILE_listener_name
    Purpose: Specifies the filename where the log information is
    written
    Default Value: listener_name.log
    Example: LOG_FILE_LISTENER=lsnr
    TRACE_DIRECTORY_listener_name
    Purpose: Control the destination directory of the trace file
    Default Value: $ORACLE_HOME/network/trace
    Example: TRACE_DIRECTORY_LISTENER=/oracle/traces
    TRACE_FILE_listener_name
    Purpose: Controls the name of the listener trace file
    Default Value: LISTENER_NAME.CDF and LISTENER_NAME.DAT
    Example: TRACE_FILE_LISTENER=lsnr
    TRACE_LEVEL_listener_name
    Purpose: Turns tracing on/off to a certain specified level
    Default Value: 0 or OFF
    * 0 or OFF - No trace output
    * 4 or USER - User trace information
    Available Values
    * 10 or ADMIN - Administration trace information
    * 16 - WorldWide Customer Support trace information
    Example: TRACE_LEVEL_LISTENER=10
    ==========================================================================
    || NAMES.ORA Parameters ||
    ==========================================================================
    NAMES.TRACE_DIRECTORY
    Purpose: Indicates the name of the directory to which trace files
    from a Names Server trace session are written.
    Default
    Value: platform specific
    Example: names.trace_directory = complete_directory_name
    NAMES.TRACE_FILE
    Purpose: Indicates the name of the output file from a Names Server
    trace session. The filename extension is always.trc
    Default
    Value: names
    Example: names.trace_file = filename
    NAMES.TRACE_LEVEL
    Purpose: Indicates the level at which the Names Server is to be
    traced.
    Default Value: OFF
    Example: names.trace_level = OFF
    NAMES.TRACE_UNIQUE
    indicates whether each trace file has a unique name, allowing
    Purpose: multiple trace files to coexist. If the value is set to ON, a
    process identifier is appended to the name of each trace file
    generated.
    Default
    Value: OFF
    Example: names.trace_unique = ON
    names.trace_file = names_05.trc
    ==========================================================================
    CMAN.ORA Parameters
    ==========================================================================
    TRACING
    Default
    Value: NO
    Example: TRACING = NO
    References
    7) listener.log 파일에 loggin정보를 남기지 않게 하는 방법이 있나요 ?
    고객이 개발하여 사용중인 application에서 NET8을 이용하여 접속하거나 접속을
    종료하는 경우 listener.log에 이와 관련된 정보가 남으며, 수 많흔 사용자가
    접속을 하게되므로서 급속하게 listener.log 파일이 커져 file system이 꽉
    차거나 데이터베이스가 hang이 되는 결과를 초래하는 경우가 있다.
    고객들은 listener.log에 write할수 있는 메세지의 양에 제한을 두기를 원하는
    경우가 있으나 이러한 기능은 제공되지 않는다. 하지만 listener의 logging은
    on 또는 off를 할 수는 있다.
    Net8에서는 listener.ora에 "LOGGING_(the listener name)=off"를 설정하게 되면
    listener의 logging을 멈출 수 있다.
    ** SQL*NET 2.3.x 에서도 이 parameter가 유효한가요 ? **
    물론 사용이 가능합니다. NET8에서 사용하는 것과 동일하게 parameter를
    listener.ora에 설정함으로서 가능합니다.
    EX)
    LOGGING_LISTENER=OFF
    이 parameter는 listener의 전체 logging을 disable하는 parameter로 일부만
    여과하여 logging할 수 있는 기능은 아니다.
    이 parameter는 NET8에 알려진 parameter로 SQL*NET 2.3.x manuals에 나와
    있지는 않지만 정상적으로 사용할 수 있다.
    Reference Ducumment
    ---------------------

  • NET8의 LOGGING AND TRACE관련 PARAMETER에 대한 Q & A

    제품 : SQL*NET
    작성날짜 : 1999-07-30
    NET8의 LOGGING AND TRACE관련 PARAMETER에 대한 Q & A
    ==================================================
    PURPOSE
    NET8의 LOGGING AND TRACE관련 PARAMETER에 대해 알아 보도록한다
    Explanation
    1. NET8에서 trace를 왜 사용하고 어떤 component들에 trace를 할 수 있나요 ?
    Trace의 특징은 네트워크을 수행하게 될때 network event들을 기술한다
    즉 trace와 관련된 일련의 문장들이 자세하게 생성된다.
    "Tracing"의 운영으로 log파일에 제공되어 있는 것 보다 NET8의 component들의
    내부적인 정보를 보다 많이 얻을 수 있다.
    이러한 정보는 에러의 결과로 인하여 발생하는 동일한 event들로 파일들에
    결과가 생성되어 이를 이용하여 문제의 원인을 판단할 수 있다.
    주의 : trace의 기능을 이용하는 경우 충분한 disk space와 system
    performance의 현격한 저하를 가져올 수 있다.
    즉 trace의 기능은 반드시 필요할 경우에만 사용할 것을 권한다.
    Example
    Reference Ducumment
    << trace의 기능을 이용하여 trace를 할수 있는 component들 >>
    * Network listener
    * Net8 components on the client and server
    * Connection Manager
    * Oracle Names Server
    * Oracle Names Control Utility
    * TNSPING utility
    2. 어떤 parameter들을 설정하면 trace 기능을 이용할 수 있는가 ?
    tracing을 하기 위해서는 특정 trace parameter들을 설정함으로써 가능하며
    아래에 주어진 방법들과 또는 utility들중 하나를 선택하여 설정함으로써
    사용할 수 있다.
    * Component Configuration Files
    * Component Control Utilities
    * Oracle Trace
    component의 configuration 파일을 이용하여 traceing parameter를 설정하려면
    1) component의 configuration 파일에 다음의 traceing parameter를 설정한다.
    - SQLNET.ORA for client or server, LISTENER.ORA for listener:
    TRACE_LEVEL_<CLIENT/LISTENER/SERVER>=(0/4/10/16)
    TRACE_DIRECTORY_<CLIENT/LISTENER/SERVER>=<directory name>
    LOG_DIRECTORY_<CLIENT/LISTENER/SERVER>=<directory name>
    2) 만일 component들이 수행중인 동안 configuration 파일의 수정이 있었다면
    변경된 parameter들을 사용하기 위해 component들을 다시 시작하여야 한다.
    component control utility들을 이용하여 trace parameter들을 설정하려면
    1) listener의 경우, Listener Control Utility(lsnrctl)에서 TRACE 명령어를
    이용하여 listener가 수행중인 동안에도 trace level을 설정할 수 있다.
    EX)
    RC80:/mnt3/rctest80> lsnrctl
    LSNRCTL for SVR4: Version 8.0.4.0.0 - Production on 01-SEP-98 15:16:52
    (c) Copyright 1997 Oracle Corporation. All rights reserved.
    Welcome to LSNRCTL, type "help" for information.
    LSNRCTL> trace admin
    Connecting to (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))
    Opened trace file: /mnt4/coe/app/oracle/product/8.0.4/network/trace/
    lsnr_coe.trc
    The command completed successfully
    LSNRCTL> trace off
    Connecting to (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))
    The command completed successfully
    LSNRCTL> exit
    RC80:/mnt3/rctest80>
    2) Oracle Names의 경우, Names Control Utility(namesctl)에서 TRACE_LEVEL
    명령어를 이용하여 Oracle Names가 수행중인 동안에도 trace level을
    설정할 수 있다.
    주의 : Connection Manager의 경우, trace level은 configuration 파일인
    CMAN.ORA 에서만 설정할 수 있다.
    Oracle Enterprose manager(이하 OEM)에 있는 Oracle Trace는 trace parameter
    들을 설정하고 GUI를 통해 trace data의 형태를 볼수 있도록 하는 tracing tool
    이다.
    3. Trace된 data를 해석할 수 있는 다른 utility들이 있다면 ?
    Trace Assistant를 사용하면 사용자의 *.trc 파일 (SQL*Net v2의 형식에 의해
    생성된) 또는 *.txt (Orace Trace 과 TRCFMT에 의해 생성된 출력물)을 통해
    trac된 정보를 해석할 수 있다.
    이 유틸리티 네트워크의 문제들로 인해 발생하는 문제점들을 진단하고
    해결하는 데 보다 많은 정보를 제공하여 사용자의 이해를 돕는다.
    * the source and destination of trace files
    * the flow of packets between network nodes
    * which component of Net8 is failing
    * pertinent error codes
    다음에 주어진 명령어를 수행하므로써 Trace Assistant 실행할 수 있다.
    trcasst [options] <filename>
    Trace Assistant Text Formatting Options
    -o Displays connectivity and Two Task Common (TTC) information.
    After the -o the following options may be used:
    c (for summary connectivity information)
    d (for detailed connectivity information)
    u (for summary TTC information)
    t (for detailed TTC information)
    q (displays SQL commands enhancing summary TTC
    information)
    -p Oracle Internal Use Only
    -s Displays statistical information
    -e Enables display of error information After the -e, zero
    or one error decoding level may follow:
    0 or nothing (translates the NS error numbers dumped
    from the nserror function plus lists all
    other errors)
    1 (displays only the NS error translation from
    the nserror function)
    2 (displays error numbers without translation)
    만일 option들이 제공되지 않는다면 기본적으로 -odt -e -s가 지정되어 자세한
    connectivity, Two-Task Common, 에러 level 0 그리고 통계정보들이 tracing
    된다.
    4. SQL*Net v2 tracing과 어떻게 다른가 ?
    Net8 tracing에서는 이전 버전인 SQL*NET V2에서 제공 되는 모든 option을
    포함하고 있고 Oracle Trace의 기능이 추가되었다.
    이것은 Oracle Trace Repository를 OEM 콘솔을 통하여 사용자의 trace 정보를
    관리할 수 있도록 허용한다.
    5. *.cdf와 *.dat은 어떤 파일 인가 ?
    *.cdf 와 *.dat 파일들은 Oracle Trace에 의해 생성되는 파일들로서 이 파일들을
    읽기 위해서는 반드시 trcfmt utility를 이용해야만 한다.
    trcfmt는 binary (*.dat와 *.cdf의 확장자) 파일내에 있는 data를 일반text
    (.txt의 확장자)로 정보를 추출한다. 이 tool을 사용하기 위해서는 다음의
    명령어를 이용하면 된다.
    $ trcfmt collection.cdf
    주의 : .cdf와 .dat파일이 존재하는 디렉토리가 아닌 곳에서 이 tool을 이용
    한다면 path가 포함되야 한다. 만일 하나의 .cdf 와 .dat 파일들내에
    여러 프로세스들의 traceing정보가 수집된다면 그것들은 process_id.txt
    의 이름과 함께 파일이 추출될 것이다.
    6. trac관련 configuration은 어떤 것이 있으며 설정할 수 있는 parameter는
    무엇이 있는가 ?
    ==========================================================================
    || SQLNET.ORA Parameters ||
    ==========================================================================
    DAEMON.TRACE_DIRECTORY
    Purpose: Controls the destination directory of the Oracle
    Enterprise Manager daemon trace file
    Default Value: $ORACLE_HOME/network/trace
    Description
    Available Oracle Enterprise Manager Installation Guide
    Example: DAEMON.TRACE_DIRECTORY=/oracle/traces
    DAEMON.TRACE_LEVEL
    Purpose: Turns tracing on/off to a certain specified level for
    the Oracle Enterprise Manager daemon.
    Default Value: 0 or OFF
    * 0 or OFF - No trace output
    * 4 or USER - User trace information
    Available Values
    * 10 or ADMIN - Administration trace information
    * 16 or SUPPORT - WorldWide Customer Support trace
    information
    Description
    Available Oracle Enterprise Manager Installation Guide
    Example: DAEMON.TRACE_LEVEL=10
    DAEMON.TRACE_MASK
    Purpose: Specifies that only the Oracle Enterprise Manager daemon
    trace entries are logged into the trace file.
    Default Value: $ORACLE_HOME/network/trace
    Description
    Available Oracle Enterprise Manager Installation Guide
    Example: DAEMON.TRACE_MASK=(106)
    LOG_DIRECTORY_CLIENT
    Purpose: Controls the directory for where the log file is written
    Default Value: Current directory where executable is started from.
    Example: LOG_DIRECTORY_CLIENT=/oracle/network/trace
    LOG_DIRECTORY_SERVER
    Purpose: Controls the directory for where the log file is written
    Default Value: Current directory where executable is started from.
    Valid in File: SQLNET.ORA
    Example: LOG_DIRECTORY_SERVER=/oracle/network/trace
    LOG_FILE_CLIENT
    Purpose: Controls the log output filename for an Oracle client.
    Default Value: SQLNET.LOG
    Example: LOG_FILE_CLIENT=client
    LOG_FILE_SERVER
    Purpose: Controls the log output filename for an Oracle server.
    Default Value: SQLNET.LOG
    Example: LOG_FILE_SERVER=svr
    NAMESCTL.TRACE_LEVEL
    Purpose: Indicates the level at which the NAMESCTL program should
    be traced.
    Default Value: OFF
    Values: OFF, USER, or ADMIN
    Example: NAMESCTL.TRACE_LEVEL=ADMIN
    NAMESCTL.TRACE_FILE
    Purpose: Indicates the file in which the NAMESCTL trace output is
    placed.
    Default Value: namesctl_PID.cdf and namesctl_PID.dat
    Example: NAMESCTL.TRACE_FILE=NMSCTL
    NAMESCTL.TRACE_DIRECTORY
    Purpose: Indicates the directory where trace output from the NAMESCTL
    utility is placed.
    Default
    Value: $ORACLE_HOME/network/trace
    Example: NAMESCTL.TRACE_DIRECTORY=/ORACLE/TRACE
    NAMESCTL.TRACE_UNIQUE
    Indicates whether a process identifier is appended to the
    Purpose: name of each trace file generated, so that several can
    coexist.
    Default
    Value: OFF
    Values: OFF or ON
    Example: NAMESCTL.TRACE_UNIQUE = ON
    TNSPING.TRACE_DIRECTORY
    Purpose: Control the destination directory of the trace file
    Default Value: $ORACLE_HOME/network/trace
    Example: TNSPING.TRACE_DIRECTORY=/oracle/traces
    TNSPING.TRACE_LEVEL
    Purpose: Turns tracing on/off to a certain specified level
    Default Value: 0 or OFF
    * 0 or OFF - No trace output
    * 4 or USER - User trace information
    Available Values
    * 10 or ADMIN - Administration trace information
    * 16 or SUPPORT - WorldWide Customer Support trace
    information
    Example: TNSPING.TRACE_LEVEL=10
    TRACE_DIRECTORY_CLIENT
    Purpose: Control the destination directory of the trace file
    Default Value: $ORACLE_HOME/network/trace
    Example: TRACE_DIRECTORY_CLIENT=/oracle/traces
    TRACE_DIRECTORY_SERVER
    Purpose: Control the destination directory of the trace file
    Default Value: $ORACLE_HOME/network/trace
    Example: TRACE_DIRECTORY_SERVER=/oracle/traces
    TRACE_FILE_CLIENT
    Purpose: Controls the name of the client trace file
    Default Value: SQLNET.CDF and SQLNET.DAT
    Example: TRACE_FILE_CLIENT=cli
    TRACE_FILE_SERVER
    Purpose: Controls the name of the server trace file
    Default Value: SVR_PID.CDF and SVR_PID.DAT
    Example: TRACE_FILE_SERVER=svr
    TRACE_LEVEL_CLIENT
    Purpose: Turns tracing on/off to a certain specified level
    Default Value: 0 or OFF
    * 0 or OFF - No trace output
    * 4 or USER - User trace information
    Available Values
    * 10 or ADMIN - Administration trace information
    * 16 or SUPPORT - WorldWide Customer Support trace
    information
    Example: TRACE_LEVEL_CLIENT=10
    TRACE_LEVEL_SERVER
    Purpose: Turns tracing on/off to a certain specified level
    Default Value: 0 or OFF
    * 0 or OFF - No trace output
    * 4 or USER - User trace information
    Available Values
    * 10 or ADMIN - Administration trace information
    * 16 or SUPPORT - WorldWide Customer Support trace
    information
    Example: TRACE_LEVEL_SERVER=10
    TRACE_UNIQUE_CLIENT
    Used to make each client trace file have a unique name to
    Purpose: prevent each trace file from being overwritten with the next
    occurrence of the client. The PID is attached to the end of
    the filename.
    Default
    Value: OFF
    Example: TRACE_UNIQUE_CLIENT=ON
    USE_CMAN
    If the session is in an Enhanced Discovery Network with a
    Purpose: Names Server, this parameter forces all sessions to go
    through a Connection Manager to get to the server.
    Default
    Value: FALSE
    Values: TRUE or FALSE
    Example: USE_CMAN=TRUE
    ==========================================================================
    || LISTENER.ORA Parameters ||
    ==========================================================================
    LOG_DIRECTORY_listener_name
    Purpose: Controls the directory for where the log file is written
    Default Value: Current directory where executable is started from.
    Example: LOG_DIRECTORY_LISTENER=/oracle/traces
    LOG_FILE_listener_name
    Purpose: Specifies the filename where the log information is
    written
    Default Value: listener_name.log
    Example: LOG_FILE_LISTENER=lsnr
    TRACE_DIRECTORY_listener_name
    Purpose: Control the destination directory of the trace file
    Default Value: $ORACLE_HOME/network/trace
    Example: TRACE_DIRECTORY_LISTENER=/oracle/traces
    TRACE_FILE_listener_name
    Purpose: Controls the name of the listener trace file
    Default Value: LISTENER_NAME.CDF and LISTENER_NAME.DAT
    Example: TRACE_FILE_LISTENER=lsnr
    TRACE_LEVEL_listener_name
    Purpose: Turns tracing on/off to a certain specified level
    Default Value: 0 or OFF
    * 0 or OFF - No trace output
    * 4 or USER - User trace information
    Available Values
    * 10 or ADMIN - Administration trace information
    * 16 - WorldWide Customer Support trace information
    Example: TRACE_LEVEL_LISTENER=10
    ==========================================================================
    || NAMES.ORA Parameters ||
    ==========================================================================
    NAMES.TRACE_DIRECTORY
    Purpose: Indicates the name of the directory to which trace files
    from a Names Server trace session are written.
    Default
    Value: platform specific
    Example: names.trace_directory = complete_directory_name
    NAMES.TRACE_FILE
    Purpose: Indicates the name of the output file from a Names Server
    trace session. The filename extension is always.trc
    Default
    Value: names
    Example: names.trace_file = filename
    NAMES.TRACE_LEVEL
    Purpose: Indicates the level at which the Names Server is to be
    traced.
    Default Value: OFF
    Example: names.trace_level = OFF
    NAMES.TRACE_UNIQUE
    indicates whether each trace file has a unique name, allowing
    Purpose: multiple trace files to coexist. If the value is set to ON, a
    process identifier is appended to the name of each trace file
    generated.
    Default
    Value: OFF
    Example: names.trace_unique = ON
    names.trace_file = names_05.trc
    ==========================================================================
    CMAN.ORA Parameters
    ==========================================================================
    TRACING
    Default
    Value: NO
    Example: TRACING = NO
    References
    7. listener.log 파일에 loggin정보를 남기지 않게 하는 방법이 있나요 ?
    고객이 개발하여 사용중인 application에서 NET8을 이용하여 접속하거나 접속을
    종료하는 경우 listener.log에 이와 관련된 정보가 남으며, 수 많은 사용자가
    접속을 하게 되므로서 급속하게 listener.log 파일이 커져 $ORACLE_HOME이 있는
    file system이 꽉 차서 데이터베이스가 hang이 되는 결과를 초래하는 경우가 있다.
    고객들은 listener.log에 write할수 있는 메세지의 양에 제한을 두기를 원하는
    경우가 있으나 이러한 기능은 제공되지 않는다. 하지만 listener의 logging은
    ON 또는 OFF는 설정을 통해서 가능하다.
    Net8에서는 listener.ora에 "LOGGING_(the listener name)=off"를 설정하게
    되면 listener의 logging을 멈출 수 있다.
    물론 설정후 listener stop후 재기동을 하셔야 변경된 paramerter에 의해
    이 기능이 enable됩니다.
    참고 : SQL*NET 2.3.x 에서도 이 parameter가 유효한가요 ?
    물론 사용이 가능합니다. NET8에서 사용하는 것과 동일하게 parameter를
    listener.ora에 설정함으로서 가능합니다.
    EX)
    LOGGING_LISTENER=OFF
    이 parameter는 listener의 전체 logging을 disable하는 parameter로 일부만
    여과하여 logging할 수 있는 기능은 아니다.
    이 parameter는 NET8에 알려진 parameter로 SQL*NET 2.3.x manuals에 나와
    있지는 않지만 정상적으로 사용할 수 있다.

  • I canu00B4t use different Databases

    Hi ,
    i need help !
    I´m using CR XI and MS SQL Server 2005.  I use  ODBC(RDO) to read data from the server.
    when i define the SQL command myself with the database assistant / adding a command the command looks like this:
    SELECT  field_list
    FROM   Table1  T1
    INNER JOIN Table2 T2 ON T1.ID = T2.ID
    This command is useable for different databases.
    When i select the needed tables with the database assistant,  the SQL command looks like this:
    SELECT  field_list
    FROM   "DatabasName"."dbo"."Table1" "Table1"
    INNER JOIN "DatabasName"."dbo"."Table2" "Table2" ON "Table1"."ID"="Table2"."ID"
    in this sample, the databasename is also a part of the SQL command therfore i can´t use the report with an other database.
    What can i do to suppress the databasename in the command ?  I need the second way because i have to give some parameters and formulas with the calling program to select the data.
    thanks forward

    Klaus,
    When CR writes the SQL for you it uses the 4 part, fully qualified table name. Can't turn that part off.
    You can, however, add parameters to a SQL Command without any problems. Just add the parameter to the SQL and to the Parameter List pane of the Command window.
    For Example...
    SELECT field_list
    FROM Table1 T1
    INNER JOIN Table2 T2 ON T1.ID = T2.ID
    WHERE T1.ID BETWEEN '{?FirstParameter}' AND '{?LastParameter}'
    They work just like SQL Variables, except that you don't have to DECLARE them in the SQL itself... that and there is no @ symbol...
    HTH,
    Jason

  • How to turn a tablespace offline when...

    Dear All,
    I need assistance;
    Which SQL statement can I use to open an oracle 8i database when the 'users' tablespace is in offline mode.

    First you say that users is offline. Then you say that that the system tablespace
    is not available. There is a VERY BIG difference between the two.
    Also, in Oracle "tablespace offline" means that a tablespace has been taken offline
    -- the Oracle command is ALTER TABLESPACE OFFLINE.
    But you now assert that the datafile has been "lost" {*whatever* that is supposed to
    mean !!}. BIG Difference again between offline and "lost" if lost means "not available".

  • Oracle and J2EE EJB

    Hi all,
    I am novice in the develpment of applications using EJB's. I have created the table and inserted the records in the oracle database using the J2EE where by the J2EE creates the table autometically. The application is working fine. But my main concern is that I am not able to access any records of this table when I give "select * from SportscarBeanTable" querry in the sql prompt of the oracle for which I get "no such table". But if I give the querry "Select table_name from user_tables", the table created by me is displayed. Can anybody clarify my doubt. Any help will be greatly appreciated.
    deepak

    Hi,
    Yes it is listing the table. The table is created by the J2EE server in the oracle database. Can u please specify the schema under which the J2EE server creates the tables in the oracle database.
    Thank you,
    deepak

  • File open error from oracle directory

    Hi
    I am testing 11g new feature for oracle secure file on my winxp system. Using the same example from Arup Nanda's writeup. it is giving me the following error, what could be the reason, need your experts assistance.
    SQL> conn checkup/checkup
    Connected.
    SQL> create directory SECFILE as 'c:\oracle';
    Directory created.
    Elapsed: 00:00:00.04
    SQL> grant all on directory secfile to public;
    Grant succeeded.
    Elapsed: 00:00:00.00
    SQL> declare
      2  l_size number;
      3  l_file_ptr bfile;
      4  l_blob blob;
      5  begin
      6  l_file_ptr := bfilename('SECFILE','contract.pdf');
      7  dbms_lob.fileopen(l_file_ptr);
      8  l_size := dbms_lob.getlength(l_file_ptr);
      9  insert into contracts_sec
    10  (
    11  contract_id,
    12  contract_name,
    13  file_size,
    14  orig_file
    15  )
    16  values
    17  (
    18  1,
    19  'Contract :'||1,
    20  null,
    21  empty_blob()
    22  )
    23  returning orig_file into l_blob;
    24  dbms_lob.loadfromfile(l_blob, l_file_ptr, l_size);
    25  commit;
    26  dbms_lob.close(l_file_ptr);
    27  end;
    28  /
    declare
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    The system cannot find the file specified.
    ORA-06512: at "SYS.DBMS_LOB", line 635
    ORA-06512: at line 7
    Elapsed: 00:00:00.01
    SQL>The OS directory SECFILE is already available under 'c:\oracle' and the .pdf file is available under 'c:oracle\secfile'
    Rgds
    Suman

    Hi
    The OS directory SECFILE is already available under 'c:\oracle' and the .pdf file is available under 'c:oracle\secfile'Why its under 'c:oracle\secfile'? It should be under 'c:oracle\' ...SECFILE is the name of the directory in Oracle not on OS. So your pdf should be at 'c:oracle\'.
    Regards

  • Content of Variable

    Hi Expert,
    I want to see content of variable , but no result by
    "dbms_output.put_line" when exec procedure.
    CREATE OR REPLACE PROCEDURE ms_alert_custbr (p_altcd varchar2) IS
    v_altcomp msaltinval.ms_alt_comp%type;
    v_altinval msaltinval.ms_alt_inval%type;
    v_altstf msaltctc.ms_alt_stf%type;
    v_mailadd varchar2(100);
    v_emailadd varchar2(32767);
    v_smail1 varchar2(50) := '/usr/local/bin/sendEmail -f [email protected] -t ';
    v_smail2 varchar2(85) := ' -u "SendEmail Test" -s 123.123.123.123:25 -m "test" -a /u03/oradata/msdev/tempfile/';
    v_fname varchar2(26) := v_altcomp || '_custbr.xls' ;
    v_smcmd varchar2(32767) ;
    CURSOR c_altinval IS
    SELECT ms_alt_comp,ms_alt_inval
    FROM msaltinval
    WHERE ms_alt_cd = p_altcd ;
    CURSOR c_altctc IS
    SELECT ms_alt_stf
    FROM msaltctc
    WHERE ms_alt_cd = p_altcd and
    ms_alt_comp = v_altcomp ;
    BEGIN
    OPEN c_altinval;
    LOOP
    FETCH c_altinval INTO v_altcomp,v_altinval ;
    ms_alert_custbr_crexls(v_altcomp,v_altinval);
    v_emailadd := NULL;
    OPEN c_altctc ;
    LOOP
    FETCH c_altctc INTO v_altstf ;
    SELECT ms_email_add
    INTO v_mailadd
    FROM msstaff
    WHERE ms_staff_cd = v_altstf ;
    v_emailadd := v_emailadd || ',' || v_mailadd ;
    EXIT WHEN c_altctc%NOTFOUND;
    END LOOP ;
    CLOSE c_altctc ;
    dbms_output.put_line(v_emailadd);
    v_smcmd := v_smail1 || v_emailadd || v_smail2 || v_fname ;
    dbms_output.put_line(v_smcmd);
    Host_Command (p_command => v_smcmd) ;
    EXIT WHEN c_altinval%NOTFOUND;
    END LOOP;
    CLOSE c_altinval;
    END ms_alert_custbr ;
    boris

    > Besides, above procedure is ok or not ? somewhere need to improve ?
    Most definitely not okay.
    By coding a nested cursor fetch loop you are trying to re-invent an SQL join (a nested loop join to be specific) in PL/SQL. The SQL engine is very well capable of doing that without any outside assistance.
    SQL is by far superior in this regard. Join the tables in SQL. Do not code manual joins in PL/SQL.
    When fetching data in PL/SQL, consider using bulk collect to increase loop performance by reducing context switches from the PL/SQL engine to the SQL engine.
    This code suffers from a typical (and very wrong) approach to databases that consider the database a bit bucket. The database is nothing but a file cabinet of sorts for the persistent storage of rows. SQL is then used as I/O routines to read and write records. Why treat the database as a flat file?
    This approach stems from the 80's when we used COBOL and dealt with sequential files like ISAM. It has no place in the 21st century when dealing with the modern database.
    Something that I seem to be repeating on a daily basis here in this forum:
    1. Maximise SQL.
    2. Minimise PL/SQL (or Java or Delphi or VB or C or C# or whatever)
    SQL is the fastest and most powerful language to crunch database data. Use it to its full capability.

Maybe you are looking for

  • IMac 27" Boot issue

    I have a late '09 iMac 27" Quad Core i5. Almost every time I go to boot, I hear the hard drive spin up and then nothing, just a black screen. No beeps, just black and near silence. it does this about 95% of the time. Here's the kicker, if I take RAM

  • Flash, Adobe Air, Time Machine, Safari not  working with Snow Leopard

    Really need some help with this. Did an archive and install of Leopard then installed Snow Leopard. No problems yet. 90% of Video sites would not work. Uninstalled and reinstalled Flash. Uninstalled ShockWave, could not reinstall with 10.6.1. Attempt

  • Seeburger BIC problem

    Hello experts, I'm facing a nasty Seeburger BIC problem in my receiver adapter when converting from XML to EDI. The error is: - SEEBURGER BICXIADAPTER.MODULE Message could not be forwarded from the Module (CallBicXIRa) to the JCA adapter. Adapter Fra

  • Substitution variables by executing a SQL statement

    If there is a "&text" in a SQL Statement, then SQLDEV automatically interprets this as an "substitution variable" and pops-up a box for entering the values of the variable(s) or takes the value of the "define myvariable myvalue;" statement. How can I

  • How manuplate data on multiple tables in the oracle resource adapter

    Hi all, I have a requirement to write an resource adapter for oracle. But the key point is that, the user creation has to add entries in several tables and same goes with updation and getting the results. Please help me with the code snippet, if any