ADO inserting extra T-SQL text

According to the documentation for the Execute Method of the ADO Connection Object: 
CommandText
A String value that contains the SQL statement, stored procedure, a URL, or provider-specific text to execute. Optionally, table names can be used but only if the provider is SQL aware. For example if a table
name of "Customers" is used, ADO will automatically prepend the standard SQL Select syntax to form and pass "SELECT * FROM Customers" as a Transact-SQL statement to the provider.
Now when I invoke a stored procedure in the text as "EXECUTE usp_MyStoredProc @Param1  = " & someVal (this is classic ASP), I get an error on occasion that makes no sense in relation to the text.  Upon reviewing the submitted SQL
in the SQL Server Profiler I see "select * from EXECUTE usp_MyStoredProc @Param1  =  0" (for example from the above).  So why does ADO arbitrarily prepend the extra command portion in this instance?  Can I turn this off?
 I am using the SQL Server Native Client provider and I am randomly seeing this on my SQL Server 2005, 2008 and 20012 instances.  No rhyme or reason as to when it decides to this.
Your insight is most welcome on this issue.

Sky13 wrote:
... and you can cut and past. Impressive.Everybody relax, you're so excitable you lost your E there (paste / past) :)
I'm still not sure I follow what capturing the SQL Text is going to do for you.
You have an application that is misbehaving and putting in data you say shouldn't be allowed. How is capturing the SQL Text going to help you identify where in the application that SQL is coming from? Seems like it would be just as simple to search the code for the table name in question for all insert statements (or API's that allow insert into the table in question).
If on the other hand you put a check in the trigger that raises an application error when the condition is hit (you can't use a check constraint referencing sysdate, not with your Oracle version, and even in version 11 it's not straight forward to do) and apply that to a test environment, you can run the application or have others run it for you and it will become pretty evident in a hurry which portion of the application is abusing your data, since the application will (should) stop working.
I don't see the value of adding a potentially damaging trigger in to a production environment (that's been my impression of what you plan on doing with this, please correct me if I'm mistaken).
Cheers,

Similar Messages

  • How to get triggering sql text in a statement trigger

    hi,
    I need to get sql text that run on the table in statement trigger on that table. I will log sql statements that run on table for a few weeks. I search for it, there is a ORA_SQL_TEXT function but this function is working on event triggers not statement or for each row triggers.
    is there any other way to achive that ?

    You can use AUDIT
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_4007.htm#i2115972
    >
    Auditing Queries on a Table: Example To choose auditing for every SQL statement that queries the employees table in the schema hr, issue the following statement:
    AUDIT SELECT
    ON hr.employees;
    To choose auditing for every statement that successfully queries the employees table in the schema hr, issue the following statement:
    AUDIT SELECT
    ON hr.employees
    WHENEVER SUCCESSFUL;
    To choose auditing for every statement that queries the employees table in the schema hr and results in an Oracle Database error, issue the following statement:
    AUDIT SELECT
    ON hr.employees
    WHENEVER NOT SUCCESSFUL;
    Auditing Inserts and Updates on a Table: Example To choose auditing for every statement that inserts or updates a row in the customers table in the schema oe, issue the following statement:
    AUDIT INSERT, UPDATE
    ON oe.customers;

  • Unicode literals lost in SQL text

    I am using SQL Developer 1.0.0.15.57, Build MAIN 15.57, on Winodws XP SP2, against a 10g db. I have already found that I need to set the environment variable
    ORA_NCHAR_LITERAL_REPLACE to TRUE on clients issuing SQL text containing Unicode (e.g. an OracleClient Command object in VB.NET), to prevent the Unicode characters from being transposed to the database character set. However, setting this environment variable does not address the exact same issue in SQL Developer. I have hunted for a setting in SQL Developer itself, but to no avail. Does anyone know how, or if it is not possible, to address this issue in SQL Developer?
    Thanks very much in advance for any assistance.
    David

    Your table appears to have 5 columns not 5 rows.
    Your statement does not provide a column list, so your value list must contain an entry for each column in the table, which is why you're getting the exception.
    When finally created your statement should read:
    insert into users (Name,address,city,state,zip) values ('John Doe','123 anystreet','sometown','ab','12345')
    Dave

  • IF statement inserts extra line.

    I am having problems with IF statements inserting extra lines;
    POH_VENDOR_NAME<?if:POH_PO_NUM != ''?>(POH_PO_NUM)<?end if?>
    Returns:
    Consolidated Supplies
    (1085)
    Instead of:
    Consolidated Supplies (1085)
    I have tried using CHOOSE but get the same results. Any help appreciated.
    Thanks
    Carl.

    Hi Carl,
    Hope your development is going ok. Not sure why the choose wouldn't work with @inline, if the IF statement did. What I would suggest instead is using a series of IF statements. So <?if@inline:x=1?> and the opposite <?if@inline:x!=1?>
    Its a bit of a pain, but I can't think of any other way to get around this.
    Regards,
    Cj

  • Error upon inserting data in sql Database using stream analytics job: Datatye error conversion

    I have a data passed into the Event Hubs, queried by stream analytic job inserting it into sql database. Upon running the job, it becomes idle a few seconds after since it has an error:
    Message: Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64.
    Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64. Exception message at level [1], exception number [0], parent exception number [0]: Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64.
    The data type in one of my field(IsHistorical) is Boolean with a value of false. The data type of the column in the sql table where this is to be inserted is of type bit. In this case, it seems that stream analytics could not convert the value "false"
    into a bit data type when inserting in sql table.
    I'm wondering if you already have encountered this problem. Could you help me resolve this problem?
    Thank you.

    Azure Stream Analytics does not have Boolean type. On input we will convert JSON Boolean value to bigint.
    Here is the list of supported types and conversions:
    https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx 
    You  can fix this erro by changing column type from bit to int in SQL table schema.

  • Error when insert data in Sql Server table(DateTime data type)

    Hello all,
    I have created a database link in oracle 11g to SQL Server 2008 using Sqlserver gateway for oracle,Oracle run on Linux and SQL Server run on Windows platform.
    I have queried a table and it fetches rows from the target table.
    I am using this syntax for insert a row in Sql Server table.
    Insert into Prod@sqlserver (NUMITEMCODE, NUMPREOPENSTOCK, NUMQNTY, NUMNEWOPENSTOCK, DATPRODDATE , TXTCOMPANYCODE, "bolstatus", NUMRESQNTY )
    Values (1118 , 1390.0 , 100.0 ,1490 , '2012-06-23 12:37:58.000','SFP' ,0 , 0 );
    but it give me error on DATPRODDATE,The data type of DATPRODDATE column in Sql Server is DATETIME.
    My Question is how can i pass the date values in INSERT statement for Sql Server DateTime data type.
    Regards

    Just as with Oracle, you have to specify the date using the to_date() function or use the native date format for the target database (if you can figure out what that is). This is good practice anyway and a good habit to get into.

  • Error while inserting data in SQL Server.

    Hi',
    I am using SOA 11.1.1.5
    I am inserting data using DB adapter in MS SQL Server. Some times I get below error.
    Error Message: {http://schemas.oracle.com/bpel/extension}bindingFault
    Fault ID     rrr/xxx!1.1*soa_313bd437-7bb9-41c6-a719-d1775b9afc4b/xx/4115908-BpInv0-BpSeq1.6-4
    Fault Time     Dec 24, 2012 8:02:09 AM
    Non Recoverable System Fault :
    <bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [InsertIntoStagingxx.Stagingxx]. Caused by java.sql.BatchUpdateException: String or binary data would be truncated.. Please see the logs for the full DBAdapter logging output prior to this exception. This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value "-8152" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary></part><part name="detail"><detail>String or binary data would be truncated.</detail></part><part name="code"><code>8152</code></part></bindingFault></bpelFault>
    Please advice.
    Thanks
    Yatan

    Hi Yatan,
    This should be due to data issues. And the error message is due to data truncation issues.
    Please check your payload that you are trying to insert into the SQL server table.
    One or more fields might have a data that is exceeding its defined length with respect to the table definitions.
    Problem with using SQL server is that while inserting, you will not be pointed towards which field or column is causing the error.
    You have to take the pain of searching through the entire payload to find the problem causing ones.
    Thanks,
    Deepak.

  • How to set alert mail contain SQL text activities

    How to set alert mail contain SQL text activities.
    In "Notification Templates" topic have no Available Tags about sql text. Can I send mail alert with SQL text?

    it should be text/plain, for a complete list refer
    http://www.freeformatter.com/mime-types-list.html
    Regards.

  • Inserting line in a Text file using java

    Hi,
    I am working on a project in which the some data is required to be stored in a text file. I have lines of data in the file and I read 1 line at a time. So now I need to insert some lines of text in between. How to do this ??
    Now i'm using a temporary file and then after creating the data I replace the original file with the new one. But want to know is there any better way to do that same..?!?!

    Ok.. If I maintain a data in XML format, is it
    possible to insert a node. I'm using Xerces and DOM
    api for handling xml data.
    As a file, XML is just a text file so you insert as you would any file.
    Once parsed to a DOM model then sure you can insert nodes. Just look at the Javadoc for XML Document, Element, Node etc.

  • ORA-13786: missing SQL text of statement object - Unable to profile a sql_id in oracle 11g -

    11.2.0.3.5 / 2 node rac on rhel-6 / 64-bit
    I would like to a profile a sql_id since its following 4 plans and one of them is the optimal.
    But im unable to do it as it throwing ORA-13786.
    Steps I followed :
    {code}
    SET SERVEROUTPUT ON
    -- Tuning task created for specific a statement from the AWR.
    DECLARE
      l_sql_tune_task_id  VARCHAR2(100);
    BEGIN
      l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task (
                              begin_snap  => 29676,
                              end_snap    => 29707,
                              sql_id      => 'fjndcnvzkjkb5',
                              scope       => DBMS_SQLTUNE.scope_comprehensive,
                              time_limit  => 60,
                              task_name   => '420tavt57dxkx_tuning_task',
                              description => 'Tuning task for statement 420tavt57dxkx in AWR.');
      DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
    END;
    EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'fjndcnvzkjkb5_CFO_tuning_task');
    SET LONG 10000;
    SET PAGESIZE 1000
    SET LINESIZE 200
    SELECT DBMS_SQLTUNE.report_tuning_task('420tavt57dxkx_tuning_task') AS recommendations FROM dual;
    SET PAGESIZE 24
    SQL>  execute dbms_sqltune.accept_sql_profile(task_name =>'420tavt57dxkx_tuning_task_task', replace => TRUE,force_match  => TRUE);
    BEGIN dbms_sqltune.accept_sql_profile(task_name =>420tavt57dxkx_tuning_task', replace => TRUE,force_match  => TRUE); END;
    ERROR at line 1:
    ORA-13786: missing SQL text of statement object "1" for tuning task "420tavt57dxkx_tuning_task"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 16442
    ORA-06512: at "SYS.PRVT_SQLPROF_INFRA", line 31
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 7544
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 7568
    ORA-06512: at line 1
    {code}
    Can somebody help me out on this?

    Hi Experts,
    i too getting this error while attaching the tuning task to the sql profiler, below are the details, appreciate any help on this.
    SQL> SQL> VAR profile_name VARCHAR2(30);
    SQL> BEGIN
       :profile_name := DBMS_SQLTUNE.ACCEPT_SQL_PROFILE(task_name => 'sql_tuning_task');
    END;
    /  2    3    4
    BEGIN
    ERROR at line 1:
    ORA-13786: missing SQL text of statement object "1" for tuning task "sql_tuning_task"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 16442
    ORA-06512: at "SYS.PRVT_SQLPROF_INFRA", line 31
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 7544
    ORA-06512: at line 2
    SQL> select banner from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production

  • Regarding inserting a field or text in template cell

    Hi Experts,
    Please let me know how to insert a field or text in the Cell in template.
    I created  template
    C1     1     14                             20.00     MM     8.00     CM     4.00   CM 4.00     CM                CM
    i have 14 lines and 3 columns in it
    i need to insert the feilds and text in it.
    Please let me know ,how to proceed.
    Thanks in advance.
    regards
    Vishnu

    Hi,
    To insert the text and field value inside the template you need to add insert the text inside the tempate node.
    assign the text or field into the text and then decide the position of the ext in the templete in output condition tab or text.
    insert the row and column number in the this to filed where you want to display the text.
    for e.g if field needs to displayed in the 2nd row and 3rd column then mention line = 2 and column = 3 in the output tab of the text.

  • How can I stop the oracle XSLT processor from inserting extra whitespace in HTML?

    How can I stop the oracle XSLT processor from inserting extra whitespace in HTML?

    Use <xsl:output mode="html" indent="no"/> as a top-level element child of your <xsl:stylesheet> element.

  • How to populate SQL Text in auditing table?

    Hi,
    Only modifying the 'AUDIT_TRAIL' .ora parameter is enough to popoulate SQL text?
    Plz reply,if you have any concerns.
    Thanks,

    Hi,
    >>I gone through few documents to enable SQL_TEXT in audit table,it says Changing the . ora parameter to 'DB_EXTENDED' is enough to populate SQL text.
    That's right. The exact SQL statement executed by the user and the bind variables used with the SQL are collected in the audit trail when the initialization parameter AUDIT_TRAIL is set to DB_EXTENDED. The DB or TRUE value will not populate the SQLTEXT and SQLBIND columns of the AUD$ table.
    Cheers
    Legatti

  • FULL SQL TEXT를 찾는 방법

    FULL SQL TEXT를 찾는 방법
    PURPOSE
    전통적으로 특정 process가 실행하고 있는 SQL을 살펴보기 위해 V$SQL / V$SQL_TEXT 등의 view가 사용됩니다. 다만, varchar2 datatype이므로 full SQL을 볼 수 없다는 제한이 있습니다.
    10g 부터는 SQL_FULLTEXT 라는 CLOB 형태의 컬럼을 통해 1000 byte 가 넘는 SQL text도 열람할 수 있게 되었습니다.
    CONTENTS
    1. test에 사용할 SQL text
    2. 전통적 방법으로 접근
    3. 새로운 방법으로 접근
    4. 요약
    1. 다음과 같은 TEST 목적의 query가 있습니다. 영문캐릭터만 사용하여 SELECT 부터 DUAL까지 1125 글자이므로, 1125 bytes 입니다.
    select /* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa */ * from dual;
    이 query를 SCOTT 으로 수행해봅니다.
    2. 전통적 방법으로 접근
    새로운 SESSION을 열어 다음과 같이, SCOTT 으로 접속된 SESSION의 sid 및 serial# 를 확인합니다.
    (1) USERNAME을 통해 sid 및 serial# 를 확인
    select b.sid, b.serial#, b.username
    from v$session b where b.username ='SCOTT';
    SID SERIAL# USERNAME
    309 1198 SCOTT
    (2) 확인된 정보를 통해, SQL TEXT를 확인합니다.
    VARCHAR2(1000)에 저장된 DATA 이므로, 다음과 같이 FULL SQL은 확보하지 못했습니다.
    set linesize 50
    column sql_fulltext format a60 word_wrap
    break on sql_text skip 1
    select s.username username, s.osuser, s.program, a.sql_text SQL
    from v$sql a, v$session s
    where s.sid = 309 and s.serial# = 1198
    and a.address = s.sql_address and a.hash_value = s.sql_hash_value;
    USERNAME
    OSUSER
    PROGRAM
    SQL
    SCOTT
    oracle
    [email protected] (TNS V1-V3)
    select /* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    USERNAME
    OSUSER
    PROGRAM
    SQL
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    USERNAME
    OSUSER
    PROGRAM
    SQL
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    USERNAME
    OSUSER
    PROGRAM
    SQL
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    USERNAME
    OSUSER
    PROGRAM
    SQL
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    3. 새로운 방법으로 접근
    새로운 SESSION을 열어 다음과 같이, SCOTT 으로 접속된 SESSION의 sid 및 serial# 를 확인합니다.
    (1) USERNAME을 통해 sid 및 serial# 를 확인
    select s.username username, s.osuser, s.program, a.sql_text SQL
    from v$sql a, v$session s
    where s.sid = 309 and s.serial# = 1198
    and a.address = s.sql_address and a.hash_value = s.sql_hash_value;
    SID SERIAL# USERNAME
    309 1198 SCOTT
    (2) 확인된 정보를 통해, SQL TEXT를 확인합니다.
    VARCHAR2(1000)에 저장된 DATA 이므로, CLOB datatype인 SQL_FULLTEXT 컬럼에 접근하였으므로 full SQL text를 확보할 수 있습니다.
    set linesize 50
    column sql_fulltext format a60 word_wrap
    break on sql_text skip 1
    select
    replace(translate(a.sql_fulltext,'0123456789','999999999'),'9','')
    SQL_FULLTEXT
    from v$sql a, v$session s
    where
    s.sid = 309 and s.serial# = 1198
    and a.address = s.sql_address and a.hash_value = s.sql_hash_value
    and a.sql_text like '%aaaaaaaaaaa%'
    group by replace(translate(a.sql_fulltext,'0123456789','999999999'),'9','');
    set linesize 50
    column sql_fulltext format a60 word_wrap
    break on sql_text skip 1
    SQL_FULLTEXT
    select /*
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    SQL_FULLTEXT
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    SQL_FULLTEXT
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    */ * from dual
    4. 요약
    10g 이상 버젼에서는, 다음과 같은 형태의 query를 응용함으로서 FULL SQL TEXT를 확보할 수 있습니다.
    select
    replace(translate(sql_fulltext,'0123456789','999999999'),'9','')
    SQL_FULLTEXT
    from v$sql
    where sql_text like '%<찾고자_하는_SQL_KEYWORD>%'
    group by replace(translate(sql_fulltext,'0123456789','999999999'),'9','')
    NOTE
    혹시라도 SQL TEXT가 4000 BYTE 이상 저장되어 있는 경우라면, ORA-22835 가 발생합니다. (VARCHAR2 형태로 출력되는 과정에서 최대 4000 BYTE 라는 제한조건이 발생됩니다) 이 경우, 다음과 같이 4000 byte만 읽도록 DBMS_LOB.SUBSTR()을 설정해줄 수 있습니다.
    *** BEFORE
    replace(translate(sql_fulltext,'0123456789','999999999'),'9','')
    *** AFTER
    replace(translate(dbms_lob.substr(a.sql_fulltext,4000,1),'0123456789','999999999'),'9','')
    만약 4000 BYTE 이상의 SQL text 가 모두 필요, java/proc/developer 등의 CLOB 처리가 가능한 3rd part tool를 사용해주시거나, 필요한 APP를 작성해주셔야 합니다.
    References
    Note 437304.1

    스크립트의 RMAN 구동 후 돌려 주시는 구문 중에 $db_bk_sql 호출하여 백업을 받으시는데 채널 할당하는 부분에 format 구문을 넣어서 각 채널에서 저장하는 위치을 다르게 잡아 줄 수 있습니다. 대신 쓰시는 backup database 구문에서 format 관련된 부분을 빼 주셔야 합니다...
    예로
    ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT '/disk1/backups/%U';
    뒤으 %U는 구분을 해 주기위해서 쓴 구문이구요... 위 구문과 같은 형식으로 채널 할당을 조절해 주시면 원하시는 대로 백업을 나누어서 할 수 있을 겁니다...
    추가적으로 더 다양한 형식으로 컨트롤을 할 수 있지만 그런 부분들은 백업 정책 및 기타 고려 사항을 참고해서 구성을 하셔야 입맛에 맞게 조절할 수 있으리라 봅니다.
    글 수정:
    명품 관

  • HOW TO INSERT DATA INTO SQL SERVER FROM MS ACCESS TABLE??

    NEED TO INSERT DATA INTO SQL SERVER FROM MS ACCESS TABLE.

    this is another method
    http://www.mssqltips.com/sqlservertip/2484/import-data-from-microsoft-access-to-sql-server/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • How do i repair or recover data from a corrupt USB external hard drive that does not show up on my Mac desktop or disk utility

    How do i repair or recover data from a corrupt USB external hard drive that does not show up on my Mac desktop or disk utility? Last night i was using my external hard drive, for some reason the folder just closed and i couldn't find it on my desktop

  • Help with purchase order detail

    Hello Experts, I am currently trying to get information on a purchase order, but not having any luck.  I need to find the PO Number, and PO Approval Date.  I cannot find either of these.  I have tried using BBP_PD_PO_GETDETAIL, but have no luck with

  • Trouble with in app purchases

    I am trying to make a purchase within an app game, and everytime I try to make it go through, the purchase cannot be completed. I checked for internet connection, it is connected. I turned it off and cam back but the purchase will not go through. I k

  • Exception while calling a BDC from webdynpro

    Hi All, I am getting an exception 'Exception condition "CNTL_ERROR" raised' while calling a BDC from the WD application, though i am calling the transaction in background mode. The statment which was throwing the exception was a create object stateme

  • UDF - FILE LOOKUP.

    Hi , I have a simple Question. Can we access the file on FTP Server(Inside the same network)  using UDF in Message Mapping i.e sort of FILE LOOKUP. If anyone can point me to correct direction Regards PS