dbms_output. Enable (buffer_size = >; NULL)
HelloI'm reviewing the PL/SQL Packages of documents and reference Types
11g Release 1 (11.1).
B28419-03
There is a section that says:
...
Type SET SERVEROUTPUT ON in SQL * Plus has the effect of the call
DBMS_OUTPUT. ACTIVATE (buffer_size = > NULL);
no limit on the output.
...
When I test using an anonymous block, buffer_size, NULL produces no output.
set serveroutput on
begin
dbms_output.put_line('Foo');
end;
/
Product output as expected.begin
dbms_output.enable(buffer_size => NULL);
dbms_output.put_line('Foo');
end;
/
Produces no output.Not what I expected. Can someone explain what I am doing wrong?
All Poodles are dogs, but not all dogs are poodles. SET SERVEROUTPUT ON does more than DBMS_OUTPUT. ACTIVATE (buffer_size-online NULL); She:
(a) dbms_output allows session
(b) reads and displays the contents of the dbms_output buffer after the execution of each statement
While DBMS_OUTPUT. ACTIVATE (buffer_size-online NULL); allows dbms_output just for the session.
SY.
Tags: Database
Similar Questions
-
11g: dbms_output.disable / dbms_output.enable loses messages
The documentation says:
--------
DISABLE the procedure
This procedure disables the calls to
PUT
,PUT_LINE
,NEW_LINE
,GET_LINE
, andGET_LINES
and empty the remaining information buffer.As with the ACTIVATE procedure, it is unnecessary to call this procedure if you use the
SERVEROUTPUT
option to SQL * more.--------
I have a PL/SQL A script, which uses the dbms_output to generate another script B (coil dbms_output in a file).
However the script calls a PL/SQL C package, which uses the dbms_output to log error/warning/debug messages.
This comes into conflict with the generation of the script the script B.
So I tried to wrap the invocation of the C PL/SQL package with dbms_output.disable / dbms_output.enable.
However, as well as documented above DISABLE "...". purges the remaining information buffer. »
But here are without flush for dbms_output .
I can not easily rewrite a legacy code to replace the generation of script B via dbms_output.
Is there a way to bypass?
Best regards
Frank
You can save your lines of DBMS before disabling the DBMS. as in:
https://Doganay.WordPress.com/2016/02/11/DBMS-output-save-lines-before-disable/
-
How to enable allow null in a col.
Hello
I have 40 to 50 tables where I have the column name "Timestamp", type of this collar is 'Raw' and computer does not allow null.
(1) I want to do allow null, how can it be done in a simple way for all tables.
(2) and if I want to remove the neck of all tables, how I can do so simple that I liked.
Yours sincerelyMaybe this example might help.
SQL> create table sample_table1 2 (tab_col1 varchar2(40) not null, 3 tab_col2 number, 4 tab_col3 date, 5 timestamp raw(16) not null, 6 error_col varchar2(1)); Table created SQL> SQL> create table sample_table2 2 (tab_col1 varchar2(40) not null, 3 tab_col2 number, 4 tab_col3 date, 5 timestamp raw(16) not null, 6 error_col varchar2(1)); Table created SQL> SQL> create table sample_table3 2 (tab_col1 varchar2(40) not null, 3 tab_col2 number, 4 tab_col3 date, 5 timestamp raw(16) not null, 6 error_col varchar2(1)); Table created SQL> describe sample_table1; Name Type Nullable Default Comments --------- ------------ -------- ------- -------- TAB_COL1 VARCHAR2(40) TAB_COL2 NUMBER Y TAB_COL3 DATE Y TIMESTAMP RAW(16) ERROR_COL VARCHAR2(1) Y SQL> describe sample_table2; Name Type Nullable Default Comments --------- ------------ -------- ------- -------- TAB_COL1 VARCHAR2(40) TAB_COL2 NUMBER Y TAB_COL3 DATE Y TIMESTAMP RAW(16) ERROR_COL VARCHAR2(1) Y SQL> describe sample_table3; Name Type Nullable Default Comments --------- ------------ -------- ------- -------- TAB_COL1 VARCHAR2(40) TAB_COL2 NUMBER Y TAB_COL3 DATE Y TIMESTAMP RAW(16) ERROR_COL VARCHAR2(1) Y
This code change column not null to null.
SQL> declare 2 -- Local variables here 3 i integer; 4 begin 5 -- Test statements here 6 for i in ( select owner, table_name, column_name 7 from all_tab_columns 8 where owner = 'WTOLENTINO' 9 and column_name = 'TIMESTAMP') loop 10 execute immediate 'alter table '||i.owner||'.'||i.table_name|| 11 ' modify '||i.column_name||' null'; 12 end loop; 13 end; 14 / PL/SQL procedure successfully completed
This code removes the ERROR_COL column.
SQL> declare 2 -- Local variables here 3 i integer; 4 begin 5 -- Test statements here 6 for i in ( select owner, table_name, column_name 7 from all_tab_columns 8 where owner = 'WTOLENTINO' 9 and column_name = 'ERROR_COL') loop 10 execute immediate 'alter table '||i.owner||'.'||i.table_name|| 11 ' drop column '||i.column_name; 12 end loop; 13 end; 14 / PL/SQL procedure successfully completed
SQL> describe sample_table1; Name Type Nullable Default Comments --------- ------------ -------- ------- -------- TAB_COL1 VARCHAR2(40) TAB_COL2 NUMBER Y TAB_COL3 DATE Y TIMESTAMP RAW(16) Y SQL> describe sample_table2; Name Type Nullable Default Comments --------- ------------ -------- ------- -------- TAB_COL1 VARCHAR2(40) TAB_COL2 NUMBER Y TAB_COL3 DATE Y TIMESTAMP RAW(16) Y SQL> describe sample_table3; Name Type Nullable Default Comments --------- ------------ -------- ------- -------- TAB_COL1 VARCHAR2(40) TAB_COL2 NUMBER Y TAB_COL3 DATE Y TIMESTAMP RAW(16) Y SQL>
-
Hierarchical Querey: duplicate branches and values returned when no shouldn't exist.
All,
It is a follow-up question for a discussion earlier on the problems with the DBMS_XMLGEN.newContextFromHierarchy function. I use hierarchical queries to build a purchase order (PO) in an XML document. The process uses 2 hierarchical queries, built IN. header information and the other relies details of the PO line. The detail line query is performed on a table that contains the row data of the PO with an underlying hierarchical structure (sample data are included below). When I run the query on the data, it returns in double branches and leaves (values). It seems to be that pass through the same branch several times and return the results. According to Oracle, this shouldn't be the case, however, in my research on what I see it's a pretty common question that appears, but I have yet to find a solid solution to the problem. The image below of the Oracle documentation and watch the sequence of path for these queries:
Can I use "Select Distinct" to work around this problem. It works on smaller POs, where the number of lines of all is small. However, as the number of PO lines grows and information associated with each line in. develops, it becomes untenable because it comes with a lot of course and the request ends up becoming interminably long, to the point of failure.
There are 2 branches of the data structure that is repeated according to the number of ca on the purchase order lines. Each section of line item PO repeats as a group in a series of repetitions, which is the number of lines of ca, for example if I have 3 lines IN. I get 1,2,3, 1,2,3, 1,2,3.
Within each OP section of line is a subgroup (ItemDetail). The Group of elements within each subgroup ItemDetail repeat at a frequency that is the number of lines of ca. The data is repeated here looks like it pushes like a factorial, which makes it easy to see why "Select Distinct" becomes untenable for the large POs.
*** I use this code in production with the "Select Distinct" restriction, but I noticed a slight increase in the size of our point of sale, so there is real urgency to get this corrected potential disaster.
Here is the code example that uses the hierarchical query without the "Select Distinct" to pull in the line IN detail. This code will produce the output described (and shown) by pressing against the example data set I included.
DECLARE linectx DBMS_XMLGEN.ctxHandle; DocLength NUMBER; --How long is the PO Doc Clob fulldoc CLOB; --Generated XML document LoopVar NUMBER; --Loop control variable lineqry VARCHAR2(2000) := q'[SELECT LVL, XMLELEMENT(EVALNAME MWELEMENT, TAGVAL) MWELEMENT FROM (SELECT LEVEL LVL, Y.XPL_TAGNAME MWELEMENT, Y.XPL_TAGVALUE TAGVAL, Y.XPL_TAGSEQ TAGSEQ, Y.XPL_SUBSEQ SUBSEQ, Y.XPL_GRPSEQ GRPSEQ, Y.XPL_POLINE POLINE FROM XMLPOLINETEST Y START WITH Y.XPL_PONO = :PONO AND Y.XPL_POLINE = 0 AND Y.XPL_TAGNAME = 'LineDetail' CONNECT BY Y.XPL_PONO = PRIOR Y.XPL_PONO AND Y.XPL_SUBSEQ = PRIOR Y.XPL_GRPSEQ ORDER SIBLINGS BY Y.XPL_POLINE ,Y.XPL_SUBSEQ ,Y.XPL_TAGSEQ)]'; BEGIN DBMS_OUTPUT.ENABLE(BUFFER_SIZE => NULL); DBMS_LOB.CREATETEMPORARY(fulldoc,TRUE); linectx := DBMS_XMLGEN.newContextFromHierarchy(lineqry); DBMS_XMLGEN.setBINDValue(linectx,'PONO',2286766); SELECT XMLSERIALIZE(DOCUMENT XMLELEMENT("Record" ,DBMS_XMLGEN.getXMLType(linectx) ) AS CLOB INDENT SIZE = 2) INTO fulldoc FROM DUAL; DBMS_XMLGEN.Closecontext(linectx); DocLength := DBMS_LOB.GETLENGTH(fulldoc); LoopVar := 1; LOOP DBMS_OUTPUT.PUT_LINE(DBMS_LOB.SUBSTR(fulldoc,8000,LoopVar)); LoopVar := LoopVar+8000; EXIT WHEN LoopVar > DocLength; END LOOP; DBMS_LOB.FREETEMPORARY(fulldoc); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('Call Stack: '||DBMS_UTILITY.FORMAT_CALL_STACK||Chr(10)); DBMS_OUTPUT.PUT_LINE('Error Stack: '||DBMS_UTILITY.FORMAT_ERROR_STACK||Chr(10)); DBMS_OUTPUT.PUT_LINE('Error Backtrace: '||DBMS_UTILITY.FORMAT_ERROR_BACKTRACE||Chr(10)); END;
Here is a set of data in row sample PO:
XPL_PONO XPL_POLINE XPL_SUBSEQ XPL_TAGSEQ XPL_GRPSEQ XPL_TAGNAME XPL_TAGVALUE XPL_ENTDT 2290872 0 0 2 28 LineDetail 05-OCT-15 2290872 1 28 1 29 Item 05-OCT-15 2290872 1 29 1 30 Cust-PO-Line-Number 1 05-OCT-15 2290872 1 29 6 31 Quantity 1 05-OCT-15 2290872 1 29 7 32 Part-Number 10501818 05-OCT-15 2290872 1 29 8 33 Revision-Level 05-OCT-15 2290872 1 29 9 34 Product-Name CARTRIDGE, LH 05-OCT-15 2290872 1 29 10 35 Price 0 05-OCT-15 2290872 1 29 11 36 UOM EA 05-OCT-15 2290872 1 29 12 37 Extended-Price 0 05-OCT-15 2290872 1 29 13 38 Supplier-Part 05-OCT-15 2290872 1 29 14 39 Item-Due-Date 12-OCT-15 05-OCT-15 2290872 1 29 16 40 BatchNo 05-OCT-15 2290872 1 29 17 41 SequenceNo 05-OCT-15 2290872 1 29 18 42 Release-HR 05-OCT-15 2290872 1 29 19 43 ItemDetail 05-OCT-15 2290872 1 29 2 47 Marvin-Sales-Order A_E04704 05-OCT-15 2290872 1 29 3 48 Sales-Order-Line 1 05-OCT-15 2290872 1 29 15 49 DockID - 05-OCT-15 2290872 1 29 4 50 Unit A1 05-OCT-15 2290872 1 29 5 51 Sash 00 05-OCT-15 2290872 1 43 1 52 SCREENING 05-OCT-15 2290872 1 43 2 53 FINISH 05-OCT-15 2290872 1 43 3 54 Screen-Material 05-OCT-15 2290872 1 43 4 55 Screen-Style-Color 05-OCT-15 2290872 1 43 5 56 Sill-Type 05-OCT-15 2290872 1 43 6 57 Sill-Color 05-OCT-15 2290872 1 43 7 58 Dimensions 05-OCT-15 2290872 1 43 8 59 Start-With 05-OCT-15 2290872 1 43 9 60 WIDTH 05-OCT-15 2290872 1 43 10 61 HEIGHT 05-OCT-15 2290872 2 28 1 29 Item 05-OCT-15 2290872 2 29 1 30 Cust-PO-Line-Number 2 05-OCT-15 2290872 2 29 6 31 Quantity 1 05-OCT-15 2290872 2 29 7 32 Part-Number 10501819 05-OCT-15 2290872 2 29 8 33 Revision-Level 05-OCT-15 2290872 2 29 9 34 Product-Name CARTRIDGE, RH 05-OCT-15 2290872 2 29 10 35 Price 0 05-OCT-15 2290872 2 29 11 36 UOM EA 05-OCT-15 2290872 2 29 12 37 Extended-Price 0 05-OCT-15 2290872 2 29 13 38 Supplier-Part 05-OCT-15 2290872 2 29 14 39 Item-Due-Date 12-OCT-15 05-OCT-15 2290872 2 29 16 40 BatchNo 05-OCT-15 2290872 2 29 17 41 SequenceNo 05-OCT-15 2290872 2 29 18 42 Release-HR 05-OCT-15 2290872 2 29 19 43 ItemDetail 05-OCT-15 2290872 2 29 2 47 Marvin-Sales-Order A_E04704 05-OCT-15 2290872 2 29 3 48 Sales-Order-Line 2 05-OCT-15 2290872 2 29 15 49 DockID - 05-OCT-15 2290872 2 29 4 50 Unit A1 05-OCT-15 2290872 2 29 5 51 Sash 00 05-OCT-15 2290872 2 43 1 52 SCREENING 05-OCT-15 2290872 2 43 2 53 FINISH 05-OCT-15 2290872 2 43 3 54 Screen-Material 05-OCT-15 2290872 2 43 4 55 Screen-Style-Color 05-OCT-15 2290872 2 43 5 56 Sill-Type 05-OCT-15 2290872 2 43 6 57 Sill-Color 05-OCT-15 2290872 2 43 7 58 Dimensions 05-OCT-15 2290872 2 43 8 59 Start-With 05-OCT-15 2290872 2 43 9 60 WIDTH 05-OCT-15 2290872 2 43 10 61 HEIGHT 05-OCT-15 2290872 3 28 1 29 Item 05-OCT-15 2290872 3 29 1 30 Cust-PO-Line-Number 3 05-OCT-15 2290872 3 29 6 31 Quantity 1 05-OCT-15 2290872 3 29 7 32 Part-Number 10501819 05-OCT-15 2290872 3 29 8 33 Revision-Level 05-OCT-15 2290872 3 29 9 34 Product-Name CARTRIDGE, RH 05-OCT-15 2290872 3 29 10 35 Price 0 05-OCT-15 2290872 3 29 11 36 UOM EA 05-OCT-15 2290872 3 29 12 37 Extended-Price 0 05-OCT-15 2290872 3 29 13 38 Supplier-Part 05-OCT-15 2290872 3 29 14 39 Item-Due-Date 12-OCT-15 05-OCT-15 2290872 3 29 16 40 BatchNo 05-OCT-15 2290872 3 29 17 41 SequenceNo 05-OCT-15 2290872 3 29 18 42 Release-HR 05-OCT-15 2290872 3 29 19 43 ItemDetail 05-OCT-15 2290872 3 29 2 47 Marvin-Sales-Order A_E04704 05-OCT-15 2290872 3 29 3 48 Sales-Order-Line 3 05-OCT-15 2290872 3 29 15 49 DockID - 05-OCT-15 2290872 3 29 4 50 Unit A1 05-OCT-15 2290872 3 29 5 51 Sash 00 05-OCT-15 2290872 3 43 1 52 SCREENING 05-OCT-15 2290872 3 43 2 53 FINISH 05-OCT-15 2290872 3 43 3 54 Screen-Material 05-OCT-15 2290872 3 43 4 55 Screen-Style-Color 05-OCT-15 2290872 3 43 5 56 Sill-Type 05-OCT-15 2290872 3 43 6 57 Sill-Color 05-OCT-15 2290872 3 43 7 58 Dimensions 05-OCT-15 2290872 3 43 8 59 Start-With 05-OCT-15 2290872 3 43 9 60 WIDTH 05-OCT-15 2290872 3 43 10 61 HEIGHT 05-OCT-15
Here is the output resulting from the use of the hierarchical line IN. query in the examples of code against the sample data:
<Record> <LineDetail> <Item> <Cust-PO-Line-Number>1</Cust-PO-Line-Number> <Marvin-Sales-Order>A_E04704</Marvin-Sales-Order> <Sales-Order-Line>1</Sales-Order-Line> <Unit>A1</Unit> <Sash>00</Sash> <Quantity>1</Quantity> <Part-Number>10501818</Part-Number> <Revision-Level/> <Product-Name>CARTRIDGE, LH</Product-Name> <Price>0</Price> <UOM>EA</UOM> <Extended-Price>0</Extended-Price> <Supplier-Part/> <Item-Due-Date>12-OCT-15</Item-Due-Date> <DockID>-</DockID> <BatchNo/> <SequenceNo/> <Release-HR/> <ItemDetail> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> </ItemDetail> <Cust-PO-Line-Number>2</Cust-PO-Line-Number> <Marvin-Sales-Order>A_E04704</Marvin-Sales-Order> <Sales-Order-Line>2</Sales-Order-Line> <Unit>A1</Unit> <Sash>00</Sash> <Quantity>1</Quantity> <Part-Number>10501819</Part-Number> <Revision-Level/> <Product-Name>CARTRIDGE, RH</Product-Name> <Price>0</Price> <UOM>EA</UOM> <Extended-Price>0</Extended-Price> <Supplier-Part/> <Item-Due-Date>12-OCT-15</Item-Due-Date> <DockID>-</DockID> <BatchNo/> <SequenceNo/> <Release-HR/> <ItemDetail> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> </ItemDetail> <Cust-PO-Line-Number>3</Cust-PO-Line-Number> <Marvin-Sales-Order>A_E04704</Marvin-Sales-Order> <Sales-Order-Line>3</Sales-Order-Line> <Unit>A1</Unit> <Sash>00</Sash> <Quantity>1</Quantity> <Part-Number>10501819</Part-Number> <Revision-Level/> <Product-Name>CARTRIDGE, RH</Product-Name> <Price>0</Price> <UOM>EA</UOM> <Extended-Price>0</Extended-Price> <Supplier-Part/> <Item-Due-Date>12-OCT-15</Item-Due-Date> <DockID>-</DockID> <BatchNo/> <SequenceNo/> <Release-HR/> <ItemDetail> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> </ItemDetail> </Item> <Item> <Cust-PO-Line-Number>1</Cust-PO-Line-Number> <Marvin-Sales-Order>A_E04704</Marvin-Sales-Order> <Sales-Order-Line>1</Sales-Order-Line> <Unit>A1</Unit> <Sash>00</Sash> <Quantity>1</Quantity> <Part-Number>10501818</Part-Number> <Revision-Level/> <Product-Name>CARTRIDGE, LH</Product-Name> <Price>0</Price> <UOM>EA</UOM> <Extended-Price>0</Extended-Price> <Supplier-Part/> <Item-Due-Date>12-OCT-15</Item-Due-Date> <DockID>-</DockID> <BatchNo/> <SequenceNo/> <Release-HR/> <ItemDetail> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> </ItemDetail> <Cust-PO-Line-Number>2</Cust-PO-Line-Number> <Marvin-Sales-Order>A_E04704</Marvin-Sales-Order> <Sales-Order-Line>2</Sales-Order-Line> <Unit>A1</Unit> <Sash>00</Sash> <Quantity>1</Quantity> <Part-Number>10501819</Part-Number> <Revision-Level/> <Product-Name>CARTRIDGE, RH</Product-Name> <Price>0</Price> <UOM>EA</UOM> <Extended-Price>0</Extended-Price> <Supplier-Part/> <Item-Due-Date>12-OCT-15</Item-Due-Date> <DockID>-</DockID> <BatchNo/> <SequenceNo/> <Release-HR/> <ItemDetail> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> </ItemDetail> <Cust-PO-Line-Number>3</Cust-PO-Line-Number> <Marvin-Sales-Order>A_E04704</Marvin-Sales-Order> <Sales-Order-Line>3</Sales-Order-Line> <Unit>A1</Unit> <Sash>00</Sash> <Quantity>1</Quantity> <Part-Number>10501819</Part-Number> <Revision-Level/> <Product-Name>CARTRIDGE, RH</Product-Name> <Price>0</Price> <UOM>EA</UOM> <Extended-Price>0</Extended-Price> <Supplier-Part/> <Item-Due-Date>12-OCT-15</Item-Due-Date> <DockID>-</DockID> <BatchNo/> <SequenceNo/> <Release-HR/> <ItemDetail> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> </ItemDetail> </Item> <Item> <Cust-PO-Line-Number>1</Cust-PO-Line-Number> <Marvin-Sales-Order>A_E04704</Marvin-Sales-Order> <Sales-Order-Line>1</Sales-Order-Line> <Unit>A1</Unit> <Sash>00</Sash> <Quantity>1</Quantity> <Part-Number>10501818</Part-Number> <Revision-Level/> <Product-Name>CARTRIDGE, LH</Product-Name> <Price>0</Price> <UOM>EA</UOM> <Extended-Price>0</Extended-Price> <Supplier-Part/> <Item-Due-Date>12-OCT-15</Item-Due-Date> <DockID>-</DockID> <BatchNo/> <SequenceNo/> <Release-HR/> <ItemDetail> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> </ItemDetail> <Cust-PO-Line-Number>2</Cust-PO-Line-Number> <Marvin-Sales-Order>A_E04704</Marvin-Sales-Order> <Sales-Order-Line>2</Sales-Order-Line> <Unit>A1</Unit> <Sash>00</Sash> <Quantity>1</Quantity> <Part-Number>10501819</Part-Number> <Revision-Level/> <Product-Name>CARTRIDGE, RH</Product-Name> <Price>0</Price> <UOM>EA</UOM> <Extended-Price>0</Extended-Price> <Supplier-Part/> <Item-Due-Date>12-OCT-15</Item-Due-Date> <DockID>-</DockID> <BatchNo/> <SequenceNo/> <Release-HR/> <ItemDetail> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> </ItemDetail> <Cust-PO-Line-Number>3</Cust-PO-Line-Number> <Marvin-Sales-Order>A_E04704</Marvin-Sales-Order> <Sales-Order-Line>3</Sales-Order-Line> <Unit>A1</Unit> <Sash>00</Sash> <Quantity>1</Quantity> <Part-Number>10501819</Part-Number> <Revision-Level/> <Product-Name>CARTRIDGE, RH</Product-Name> <Price>0</Price> <UOM>EA</UOM> <Extended-Price>0</Extended-Price> <Supplier-Part/> <Item-Due-Date>12-OCT-15</Item-Due-Date> <DockID>-</DockID> <BatchNo/> <SequenceNo/> <Release-HR/> <ItemDetail> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> <SCREENING/> <FINISH/> <Screen-Material/> <Screen-Style-Color/> <Sill-Type/> <Sill-Color/> <Dimensions/> <Start-With/> <WIDTH/> <HEIGHT/> </ItemDetail> </Item> </LineDetail> </Record>
Thanks in advance for any help.
Paul
I might have misunderstood your data, but think that the problem is in your code of treewalk. I think that a party must be:
SELECT
LEVEL LVL,
Y.XPL_TAGNAME MWELEMENT,
Y.XPL_TAGVALUE TAGVAL,
Y.XPL_TAGSEQ TAGSEQ,
Y.XPL_SUBSEQ FOLLOWING,
Y.XPL_GRPSEQ GRPSEQ,
Y.XPL_POLINE KAMILLA
OF XMLPOLINETEST Y
START WITH Y.XPL_PONO =: PONO
AND Y.XPL_POLINE = 0
AND Y.XPL_TAGNAME = 'LineDetail.
CONNECT PRIOR Y.XPL_PONO = Y.XPL_PONO
AND PRIOR Y.XPL_POLINE (0, Y.XPL_POLINE)
AND PRIOR Y.XPL_GRPSEQ = Y.XPL_SUBSEQ
BROTHERS AND SŒURS ORDER BY Y.XPL_POLINE
Y.XPL_SUBSEQ
Y.XPL_TAGSEQ
EDIT: adding Y.XPL_PONO PRIOR = Y.XPL_PONO for the use of the index.
-
Help simple loop for no data found
I am new to PL/SQL and will have problems trying to manage people entering in a good REC BANNER_ID. In the beginning of the game
I get no data found when an identification number is entered that does not exist in the spriden table. I want to be able to have the people who did not go in a good REC BANNER_ID in skipped records County which is towards the end. I tried a lot of things, but I do not seem to get anywhere. I'm sure it's pretty simple. I think I need to add some kind of "* IF."for rec in c1 loop select SPRIDEN_pidm into pidm from SPRIDEN where SPRIDEN_ID = rec.BANNER_ID and SPRIDEN_CHANGE_IND is null;
statement to the article mentioned above. Here is the whole part of the code
Here are the results I get with 1 id good and a bad id--set serveroutput on format wraped; set serveroutput on; set verify off; spool /u03/banjobs/LOCAL/student/scholar_insert.txt Declare term_code varchar2(6) := '&&TERM'; cursor c1 is select * from ttubantemp.SXTSCHOLAR; Pidm Number; so varchar2(2); icnt number := 0; cnt number := 0; insert_cnt number := 0; update_cnt number := 0; exist_cnt number := 0; skip_cnt number := 0; BEGIN dbms_output.enable (buffer_size => null); for rec in c1 loop select SPRIDEN_pidm into pidm from SPRIDEN where SPRIDEN_ID = rec.BANNER_ID and SPRIDEN_CHANGE_IND is null; Select Count(*) Into Cnt From SPRCMNT Where Sprcmnt_Pidm = Pidm And Sprcmnt_Cmtt_Code = 'SO'; -- and SPRCMNT_TEXT not like term_code; If Cnt > 0 Then Select Sprcmnt_Cmtt_Code Into So From Sprcmnt Where Sprcmnt_Pidm = Pidm and SPRCMNT_CMTT_CODE = 'SO'; Else so := null; end if; -- dbms_output.put_line('BANNER_ID = '||rec.BANNER_ID|| ' - PIDM = '||Pidm|| ' - Term = '||Term_Code|| ' - cnt = '||Cnt); If Pidm Is Not Null then Select Count(*) Into Cnt From Spriden Where Spriden_Pidm = Pidm And So Is Null; if cnt > 0 then dbms_output.put_line(' INSERTING'); INSERT INTO sprcmnt( SPRCMNT_PIDM, SPRCMNT_CMTT_CODE, SPRCMNT_TEXT, SPRCMNT_TEXT_NAR, SPRCMNT_CONFIDENTIAL_IND, SPRCMNT_DATE, SPRCMNT_ORIG_CODE, SPRCMNT_ACTIVITY_DATE, SPRCMNT_CTYP_CODE, SPRCMNT_CONTACT_DATE, SPRCMNT_USER_ID, SPRCMNT_CONTACT_FROM_TIME, SPRCMNT_CONTACT_TO_TIME) VALUES (pidm, 'SO', term_code, NULL, 'N', Sysdate, 'SCHL', SYSDATE, NULL, Null, 'NEXTGEN', NULL, NULL); insert_cnt := insert_cnt + 1; else select count(*) into cnt from sprcmnt Where Sprcmnt_Pidm = Pidm And So Is Not Null And Sprcmnt_Text Like '&&%TERM%'; if cnt > 0 then dbms_output.put_line(' UPDATING'); update sprcmnt set SPRCMNT_TEXT = SPRCMNT_TEXT||' '||term_code where SPRCMNT_PIDM = pidm and SPRCMNT_CMTT_CODE = 'SO'; update sprcmnt set SPRCMNT_ACTIVITY_DATE = sysdate where SPRCMNT_PIDM = pidm and SPRCMNT_CMTT_CODE = 'SO'; Update Sprcmnt set SPRCMNT_USER_ID = 'NEXTGEN' where SPRCMNT_PIDM = pidm and SPRCMNT_CMTT_CODE = 'SO'; update_cnt := update_cnt + 1; else dbms_output.put_line(' RECORD EXISTS'); exist_cnt := exist_cnt + 1; end if; end if; icnt := icnt + 1; else dbms_output.put_line('SKIPPED BANNER_ID = '||rec.BANNER_ID); skip_cnt := skip_cnt + 1; end if; end loop; commit; dbms_output.put_line('Total Records = '||icnt); dbms_output.put_line('Records Inserted = '||insert_cnt); dbms_output.put_line('Records Updated = '||update_cnt); dbms_output.put_line('Records Existed = '||exist_cnt); dbms_output.put_line('Records Skipped = '||skip_cnt); END; / spool off; / EXIT
Error report:
ORA-01403: no data found
ORA-06512: at line 15 level
01403 00000 - "no data found".
* Cause:
* Action:
BANNER_ID = T00001227 - PIDM = 1450 - term = 201280 - cnt = 0
INSERTION OF
Engage
Here are the results with only a good idea
anonymous block filled
BANNER_ID = T00001227 - PIDM = 1450 - term = 201280 - cnt = 0
INSERTION OF
Total records = 1
Inserted records = 1
Put records = 0
Folders existed = 0
Ignored records = 0
Engage
Edited by: Withnoe 6 July 2012 14:27Put another block of start-end inside the loop (around your select statement) and includes an exception handler.
Pseudocode here:for rec in c1 loop BEGIN select SPRIDEN_pidm into pidm from SPRIDEN where SPRIDEN_ID = rec.BANNER_ID and SPRIDEN_CHANGE_IND is null; EXCEPTION WHEN NO_DATA_FOUND THEN dbms_output.put_line('SKIPPED BANNER_ID = '||rec.BANNER_ID); skip_cnt := skip_cnt + 1; END; . . . end loop;
In addition, if you count the records to see if he has at least 1 card that meets the condition, why count ALL records? You can count and put "rownum = 1" or "" rownum < 2"="" so="" it="" stops="" when="" it="" gets="" to="" one="" row.="" another="" way="" i="" like="" to="" do="" it="" is="" "select="" count(*)="" from="" dual="" where="">
". But often there is no need to count at all. People will sometimes do a count to see if there is to be done and if so, then run. In many cases, it is best to try just to get the job done without counting any first.
-
Hey,.
I'm having a strange customer requirement.
I use dbms_output.put_line to exit. But I was getting error of buffer flow.
Then, I used to write the log to a file but when utl_file due to a problem of permission for the log file directory to the computer unix FTP, I can't use utl_file.
Is it possible in dbms_output than if flow of buffer error raise at this time
2nd log file generate the new name and the remaining log data written to the new log file.
My code is generally inferior to...
---------------------------------------------------------------------------------------------------------------
SET OF BUFFER 1000000
SET SERVEROUTPUT ON
coil LMG_DBmigration_CP_DATA_Log.log
Declare
Start
Stmnts for DBMS_OUTPUT. PUT_LINE;
Stmnts for DBMS_OUTPUT. PUT_LINE;
Stmnts for DBMS_OUTPUT. PUT_LINE;
:
:
:
Stmnts for DBMS_OUTPUT. PUT_LINE;
end;
/
spool off
"exit";
---------------------------------------------------------------------------------------------------------------
no idea...?
Rgds,
PCAs long as you put dbms_output.enable (buffer_size-online NULL) in the begin... END of block (before first dbms_output.put_line is running), it won't be a problem.
-
Is this really a 'bug' in dba_tab_columns?
Hey guys, it's Xev.
I've been struggling with this for weeks. No matter what I do, I can't get my procedure to see the dba_tab_columns inside my running procedure. Just jump and say
'cannot see the table or the view', this generic response.
Is there really a bug or a limitation with how I use this point of view s/n? is there something else I can do? It just won't recognize other users custom also.
I have two basic lines of defense here, but two of them not what I need to do.
Can someone help me on this please.
OK, this is the 'first method' I have tried to use, it works very well, but 'only' for a single user at a time. I can't seem to 'find' the rest of the 'schema user. " He finds that I said
but only in schema, the tables and the fields of the user who runs it. I tried to switch out (user_tab_columns) for dba_tab_columns, but it explodes and says that he "cannot see the table or view.
It is my preferred method. If you change this option to find other other users in through everything to another the whole database schema, I would do anything for you!
create or replace procedure find_str
AUTHID current_user
as
l_query long;
long l_case;
l_runquery boolean;
l_tname varchar2 (30);
l_cname varchar2 (4000);
l_refcur sys_refcursor;
z_str varchar2 (4000);
Start
z_str: = ' ^ [0-9] {9} $';
dbms_output. Enable (buffer_size = > NULL);
DBMS_APPLICATION_INFO.set_client_info (z_str);
dbms_output.put_line ('keyword Table column value');
dbms_output.put_line ('---------------------------- ------------------------------ --------------------------------------------------');
for x in (select distinct table_name from all_tables
When the owner not in ('SYS', 'SYSTEM', 'MDSYS","OUTLN', 'CTXSYS', 'OLAPSYS', 'OWBSYS', 'FLOWS_FILES', 'EXFSYS', 'SCOTT',
'APEX_030200', 'GENERAL', 'ORDSYS","SYSMAN","APPQOSSYS","XDB", 'ORDDATA', 'WMSYS'))
loop
l_query: = ' select "' | x.table_name | ''', $$
of ' | x.table_name | '
where 1 = 1 and (1 = 0 ";")
l_case: = "box";
l_runquery: = FALSE;
for y in (select *)
of user_tab_columns
where table_name = x.table_name
and data_type in ('VARCHAR2', 'CHAR'))
loop
l_runquery: = TRUE;
l_query: = l_query | ' or regexp_like (' |)
y.column_name | (', userenv ("client_info")) ';
l_case: = l_case | «When regexp_like (' |)»
y.column_name | (', userenv ("client_info")) then ' |
'''<' || y.column_name | '>''||' || y.column_name | '||'' < /' || y.column_name | ">'' ' ;
end loop;
If (l_runquery)
then
l_case: = l_case | "ANY other purpose;
l_query: = replace (l_query, "$$", l_case). ')';
Start
Open the l_refcur for l_query;
loop
extract the l_refcur in l_tname l_cname;
When the output l_refcur % notfound;
dbms_output.put_line
(rpad (z_str, 29) |)
RPAD (l_tname, 31).
RPAD (l_cname, 50));
end loop;
exception
When no_data_found then null;
end;
end if;
end loop;
end find_str;
NOW,.
It's the second method, she also did a good job of finding what I want it, but again don't search other users and on the other the schema. If you modify this to do find other users and another schema, I'd go crazy! Laughing out loud!
For the test given just create a table in your schema and put a "nine-figure" everywhere in the fields and both these procedures will find them, but only for the 'USER '.
AND, that's my problem, I have many customized user go on the forums and create procedures for each user. It is impossible to plant.
I really need you guys on this point, Happy New Year!
create or replace PROCEDURE find_string
--(p_search_string IN VARCHAR2 par DÉFAUT ' ^[0-9]{3}-[0-9]{2}-[0-9]{4}$')
(p_search_string IN VARCHAR2 DEFAULT ' ^ [0-9] {9} $')
IS
e_error_in_xml_processing EXCEPTION;
e_table_not_exist EXCEPTION;
PRAGMA EXCEPTION_INIT (e_error_in_xml_processing,-19202);
PRAGMA EXCEPTION_INIT (e_table_not_exist,-942);
BEGIN
DBMS_OUTPUT. Put_line ('Table help of keyword/value of column');
DBMS_OUTPUT. PUT_LINE ('---------------------------- ------------------------------ --------------------------------------------------');
FOR r1 IN
(SELECT table_name, column_name
OF dba_tab_cols
WHERE table_name IN (select distinct table_name from dba_tab_cols
When the owner not in (' MDSYS', 'OUTLN', 'CTXSYS', 'OLAPSYS', 'FLOWS_FILES', 'OWBSYS', 'SYSTEM', 'EXFSYS', 'APEX_030200', 'SCOTT', 'GENERAL', "ORDSYS", "SYSMAN", ")
APPQOSSYS', 'XDB","ORDDATA","SYS","WMSYS"))
-WHERE table_name = 'FIND_TEST '.
ORDER BY table_name, column_name)
LOOP
BEGIN
FOR r2 IN
(SELECT DISTINCT SUBSTR (p_search_string, 1: 28) "Keyword",
SUBSTR (r1.table_name, 1, 30) 'table. "
SUBSTR (t.column_value.getstringval (), 1, 50) ' / value of the column.
TABLE
(XMLSEQUENCE
(DBMS_XMLGEN. GETXMLTYPE
("SELECT ' ' |" ") R1.column_name |
« « DE » ' || R1.table_name |
"' WHERE REGEXP_LIKE.
("' || R1.column_name | '",'''
|| p_search_string | ''')'
() .extract (' LINES/rowset / * ""))) t)
LOOP
DBMS_OUTPUT. PUT_LINE
(RPAD (r2. ("" Keyword ", 29).
RPAD (r2. ("' Table ', 31).
RPAD (r2. (("" Column / Value ", 50));
END LOOP;
EXCEPTION
WHEN e_error_in_xml_processing THEN NULL;
WHEN e_table_not_exist THEN NULL;
WHEN OTHERS RAISE.
END;
END LOOP;
END find_string;
Happy New Year, if you can get this to find other users! Good luck!
OK, just a quick update, all is not lost.
I decided to use all_tab_columns and not to a stored procedure. Also, I made the diagram one passes in 'parameter' since I don't have the ability to create other peoples in the schema.
Then I loop and use "regexp_like' (one of my favorite expressions) and use (immediate execution)... overall, I finally found a way to do...
After the trial and efforts...
Thanks to all who have contributed and helped
Thank you
Xev.
-
DBMS_OUTPUT. ENABLE (1000000);
Hi all
My DB is 10.2.0.4
I received an error ORA-20000: ORU-10027: buffer overflow, limit of 20000 bytes.
I saw a similar topic with the suggestion to DBMS_OUTPUT. ENABLE (1000000);
A quick question - if I have a package with several procedures, do I place DBMS_OUTPUT. ENABLE (1000000); in each procedure, after the BEGIN?
Thank you for your help.You can also set only once, in theinitialisation part of your package body:
create or replace package body bla is -- Private type declarations -- Private constant declarations -- Private variable declarations -- Function and procedure implementations begin -- Initialization DBMS_OUTPUT.ENABLE(1000000); end bla;
-
20K limit for DBMS_OUTPUT in child reports - can it be increased?
I have a few child Developer SQL reports that use the PL/SQL DBMS output as 'Style '. However, I don't know how to increase the limit serveroutput beyond the 20 K bytes, which is now the limit.
ORA-20000: ORU-10027: buffer overflow, limit of 20000 bytes
ORA-06512: at "SYS." DBMS_OUTPUT", line 32
ORA-06512: at "SYS." DBMS_OUTPUT", line 97
ORA-06512: at "SYS." DBMS_OUTPUT", line 112
ORA-06512: at line 21
Is it possible to increase this limit to the reports of the child?
This question has been asked before, but I do not see a response.
If your Oracle DB version is version10.2 or later, buffer_size UNLIMITED syntax is available as shown in the doc link rp0428 posted above. The equivalent of UNLIMITED in a call to dbms_ouptut.enable would be dbms_output.enable (NULL). I added the (ridiculous) example of a report of child brother employees under a Department of parent report:
Begin
Dbms_output. Enable (null);
FOR indx IN 1... 25000
LOOP
Dbms_output.put_line (indx |) "and account" | Chr (13) | 10;
END LOOP;
End;
-
A mysterious problem Null ~.
Hey guys, it's Xev.
I have a question null mysterious. Well, it's mysterious to me because I do not understand why it's happening.
First of all, here is the table to create with the data from the sample, I learned to do the first.
After that, I have provided the table that I am inserting while execution of the main program and I'll post the main pl/sql program after that so you can see what I'm talking about.
CREATE TABLE 'SMEG '. "" FND_IT ".
(VARCHAR2 (50 BYTE) "TESTCOL",
'COMMENTS' VARCHAR2 (60 BYTE)
);Insert into FND_IT (TESTCOL, COMMENTS) values ("abcde", null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('12345 ', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('1a4A5', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('a 12, 45', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ("12aBC", null);
Insert into FND_IT (TESTCOL, COMMENTS) values ("12abc", null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('12ab5', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('12aa5', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('12AB5', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ("ABCDE", null);
Insert into FND_IT (TESTCOL, COMMENTS) values (123-5', null);
Insert into FND_IT (TESTCOL, COMMENTS) values (' 12.45 ', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('1a4b5', null);
Insert into FND_IT (TESTCOL, COMMENTS) values (1 3 5', null);
Insert into FND_IT (TESTCOL, COMMENTS) values (1, 45', null);
Insert into FND_IT (TESTCOL, COMMENTS) values (1, 5', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ("a b c d", null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('a b c d e', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('e a', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('Steven', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('Stephen', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('111.222.3333', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('222.333.4444', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('333.444.5555', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ('abcdefabcdefabcxyz', null);
Insert into FND_IT (TESTCOL, COMMENTS) values ("77777777 ZZ", "eight figures and then 2 alpha suffix");
Insert into FND_IT (TESTCOL, COMMENTS) values ('77777777',' eight consecutive digits");
Insert into FND_IT (TESTCOL, COMMENTS) values ('ZZ 77777777', 2 characters at the front, a space, and then eight-digit.");
Insert into FND_IT (TESTCOL, COMMENTS) values (77-777-7777', 'up with dashes, looks like an ssn!');
Insert into FND_IT (TESTCOL, COMMENTS) values ('777777777',' nine consecutive digits. ») ;
Insert into FND_IT (TESTCOL, COMMENTS) values ('Z777777777777', ' an alpha and then 12 digits");
Insert into FND_IT (TESTCOL, COMMENTS) values ('7777777777777',' thirteen consecutive digits. ») ;
Insert into FND_IT (TESTCOL, COMMENTS) values ('Z7777777', 'a consecutive 7 alpha');
Insert into FND_IT (TESTCOL, COMMENTS) values (' ZZZ 777777777', ' 3 letters, the digits of the nine space ");
Insert into FND_IT (TESTCOL, COMMENTS) values (' ' ZZ 777777777 ', 'nine numbers and suffix alpha space then 1 then 2.');
Insert into FND_IT (TESTCOL, COMMENTS) values (' ZZ7-77-7777', 2 alpha 1 - 2 dig - dig dig 4' ");
Insert into FND_IT (TESTCOL, COMMENTS) values ('Z77777777777' ', ' digits 1 alpha 11 ");
Insert into FND_IT (TESTCOL, COMMENTS) values ('Z777777' ', ' alpha, 6 consecutive 1 ");
Insert into FND_IT (TESTCOL, COMMENTS) values ('77777777 ZZZZ', 'eight-digit 1 space 4 alpha suffix');
Insert into FND_IT (TESTCOL, COMMENTS) values (' ZZZZ 77777777', ' space prefix alpha 4, 8 digit ");
Insert into FND_IT (TESTCOL, COMMENTS) values ('ZZ77777777' ', ' 2 consecutive alpha 8-digit ");
Insert into FND_IT (TESTCOL, COMMENTS) values ('ZZZ777777' ', ' alpha, 6 consecutive 3 ");This forum that the PL/SQL table main progam insert while it works...
CREATE TABLE DYNAMIC_COUNTS
(VARCHAR2 (30 BYTE) "T_OWNER",
VARCHAR2 (30 BYTE) "T_TABLE_NAME."
VARCHAR2 (30 BYTE) "T_COLUMN_NAME."
NUMBER OF 'FND_GOVIDS '.
);
And here's the main pl/sqlprogram, I have hard-coded so that it can search just a FND_IT table, so you can focus just on why you get null lines inserted into the DYNAMIC_COUNTS table.
I need to insert the ranks of all the fields populated by the variable. It does all this is now, here are the results of table selecing 'DYNAMIC_COUNTS', after the program has been run.
Here is the program:
Set serveroutput size unlimited
run the DBMS_OUTPUT. ACTIVATE (buffer_size = > NULL);------------------------------------------------------------------------------------------------------------------------
DECLARE
FND_LOOK INTEGER.
------------------------------------------------------------------------------------------------------------------------
BEGIN
FOR t IN (SELECT master, table_name, column_name
From all_tab_columns
WHERE table_name = ("FND_IT"))
-Owner WHERE = upper ('& SCHEMA_NAME'))
------------------------------------------------------------------------------------------------------------------------
LOOP
BEGIN
EXECUTE IMMEDIATE ' with an ACE (select case when REGEXP_LIKE (' | t.column_name |))
-Search this 6-digit Alpha
', "^ ([[: alpha:]] |) [[: alpha:]] ({3}) [0-9] {6} $")
then "match"
another "no matches found" end up as output of ' | t.Owner | '.' || t.table_name | ')
Select count (*) in a where a.output = "Match Found" clause 'IN FND_LOOK;
/ * Table for later insertion, the current issue is that's not insert row by row
and inside of them, null values * /.
IF FND_LOOK > 0 THEN
insert into smeg.dynamic_counts (T_OWNER) values (t.owner);
insert into smeg.dynamic_counts (T_TABLE_NAME) values (t.table_name);
insert into smeg.dynamic_counts (T_COLUMN_NAME) values (t.column_name);
insert into smeg.dynamic_counts (fnd_govids) values (FND_LOOK);END IF;
/ * dbms_output * /.IF FND_LOOK > 0 THEN
Dbms_output.put_line (t.owner |) '.' || t.table_name | ' ' || t.column_name | ' ' || FND_LOOK);
END IF;
------------------------------------------------------------------------------------------------------------------------
/ * Exception Handeling * /.
EXCEPTION
WHILE OTHERS
THEN
Dbms_output.put_line)
"Generic error".
|| t.column_name
|| "from".
|| t.Owner
|| '.'
|| t.table_name);
END;
END LOOP;
END;
/OK, after the short program and you go and do a select * from DYNAMIC_COUNTS, this is what you will see...
T_OWNER T_TABLE_NAME T_COLUMN_NAME FND_LOOK
Null null null SMEG
NULL null null FND_IT
NULL null null TESTCOL
null null null 2
That's the problem, I need to have this information all in one rank, not spread out on all these lines that you see above. Where I'm going wrong?
Is it the way I do the insert statement? What must I do different?
Thank you
Xev.
Try this
DECLARE
FND_LOOK INTEGER.
v_tabreccnt NUMBER; --Also added
v_loopcnt NUMBER: = 0; --Also added
v_flag NUMBER: = 1; --Also added
------------------------------------------------------------------------------------------------------------------------
BEGIN
SELECT COUNT (1) IN the v_tabreccnt - added
From all_tab_columns
WHERE table_name = 'FND_IT ';
FOR t IN (SELECT master, table_name, column_name
From all_tab_columns
WHERE table_name = 'FND_IT')
-Owner where = upper ('& SCHEMA_NAME'))
------------------------------------------------------------------------------------------------------------------------
LOOP
BEGIN
EXECUTE IMMEDIATE ' with an ACE (select case when REGEXP_LIKE (' | t.column_name |))
-Search this 6-digit Alpha
', "^ ([[: alpha:]] |) [[: alpha:]] ({3}) [0-9] {6} $")
then "match"
another "no matches found" end up as output of ' | t.Owner | '.' || t.table_name | ')
Select count (*) in a where a.output = "Match Found" clause '
IN FND_LOOK;
/ * Table for later insertion, the current issue is that's not insert row by row
and inside of them, null values * /.
v_loopcnt: = v_loopcnt + 1; --Also added
IF FND_LOOK > 0 THEN
v_flag: = FND_LOOK;-modified logic
END IF;
IF (v_loopcnt = v_tabreccnt) AND (v_flag > 0) THEN
insert into dynamic_counts (T_TABLE_NAME, T_COLUMN_NAME, T_OWNER, fnd_govids) values (t.owner, t.table_name, t.column_name, v_flag); --Also changed
END IF;
/ * dbms_output * /.
IF FND_LOOK > 0 THEN
Dbms_output.put_line (t.owner |) '.' || t.table_name | ' ' || t.column_name | ' ' || FND_LOOK);
END IF;
------------------------------------------------------------------------------------------------------------------------
/ * Exception Handeling * /.
EXCEPTION
WHILE OTHERS
THEN
Dbms_output.put_line)
"Generic error".
|| t.column_name
|| "from".
|| t.Owner
|| '.'
|| t.table_name);
END;
END LOOP;
END;
/
-
dbms_output.put_line error...
Hello
I try to print dbms_output since records of thousands of 200000 more but its failure after a certain limit.
I need to print documents at least 200000, is - it possible? or what is the limit max dbms_output in sqlplus?
I use Oracle 11 g
declare begin dbms_output.enable(1000000); for i in 1..200000 loop dbms_output.put_line(i); end loop; end; / 185184 declare * ERROR at line 1: ORA-20000: ORU-10027: buffer overflow, limit of 1000000 bytes ORA-06512: at "SYS.DBMS_OUTPUT", line 32 ORA-06512: at "SYS.DBMS_OUTPUT", line 97 ORA-06512: at "SYS.DBMS_OUTPUT", line 112 ORA-06512: at line 6
user520824 wrote:
Yes, I did but still error.11g has no limit of dbms_output impression?
It has nothing to do with 11g. You issue:
SET SERVEROUTPUT UNLIMITED SIZE
And then in your code limit it to 1 000 000 by:
dbms_output. Enable (1000000);
Get rid of it and you'll be fine. Or, if you wish, you can change it to:
dbms_output. Enable (null);
set to unlimited in your code, then it becomes independent of SQL * more buffer serveroutput size setting
SY.
Published by: Solomon Yakobson on February 28, 2011 15:28
-
I develop a report that uses the dbms_output to output messages. However what type of report is set to "PLSQL DBMS Output". the output is all wrapped up in a single line, as if the new lines are not interpreted. If I put it as a "Script", I don't get anything.
Is there a magic definition that I'm missing? My pl/sql block has dbms_output.enable and several dbms_output.put_line calls and it's on Windows 7 64 bit with Java 1.7.
Thanks in advance
the dbms_output is rendered in HTML format in this Panel. So if you want a new line, add a '
"to your channel.HTML support is pretty basic as the HTML3 spec.
Here is an example
http://www.thatjeffsmith.com/archive/2012/04/substitution-variables-HTML-reports-in-SQL-Developer/
-
How to capture (or redirect) dbms_output customer?
I work in a home business and I am accessing a remote database using a program called Developer SQL solyp. I have to get data in PLSQL stored procedures. The data is output procedures by dbms_output. The problem is I don't think a way to this customer to capture the dbms_output buffer, or an equivalent of "set serveroutput on ' for SQL * more. I can see the results of normal SQL queries but not procedures PLSQL.
I don't have permission to install other clients of DB.
I have not authorized to change procedures to generate the output other than that dbms_output.
My question is how do I capture the output of the procedures of the customer?
Is it possible to redirect the output of the dbms_output to standard output for a session? or even for the whole DB?
Equivalent to ' set serveroutput on "non-specific to sQL * more?
* dbms_output. Enable makes no difference, it allows only dbms_output it does not redirect.
* Redirect to a file on the DB server does not work, I don't have access to the file system on the DB server.
DBMS_OUTPUT. Simple Put_line writes data in the DBMS_OUTPUT buffer. He twisted it to something similar to sysoutput or syserror, so there is nothing to redirect. Customer must read DBMS_OUTPUT buffer and, for example, it displays on the screen. So check solyp SQL Developer docs to see how to do this. For example, in SQL Navigator, you must click on the button "tunn serveroutput on / off. And if the solyp SQL Developer does not really support DBMS_OUTPUT, you could create something like:
create or replace
function get_dbms_output_lines
return the sys. OdciVarchar2List
pipelined
is
v_line varchar2 (4000);
number of v_status;
Start
loop
dbms_output.get_line (v_line, v_status);
out when v_status = 1;
pipe row (v_line);
end loop;
end;
/
The function is created.
SQL > exec dbms_output.enable
PL/SQL procedure successfully completed.
SQL > start
2 for v_i in 1.10 in loop
3 dbms_output.put_line ('Line' | v_i);
4 end of loop;
5 end;
6.PL/SQL procedure successfully completed.
SQL > select *.
table 2 (get_dbms_output_lines)
3.COLUMN_VALUE
-----------------------------------------------------------------Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 1010 selected lines.
SQL >
Don't forget, of the above will work if the line size does not exceed 4000 bytes (SQL limit).
SY.
-
by comparing the value to the variable null
Hey guys, quick question. I just want to see if my understanding of the code below is correct:
Declare
v_variable varchar2 (100)
Begin
v_variable: = null;
If v_variable = 'test' then
message ('test');
end if;
If v_variable! = 'test' then
message ('test2');
end if;
If my interpretation is correct, "test2" message should print but wont 'test' or is it possible that I could get an error if we cannot compare with null values?
Thank you
Thank you.
End;You must compare the values null, is null. A comparison of null = or! always = the NULL value and thus you reach your outings:
$[CHE_TEST@asterix1_impl] r 1 begin 2 if null = null then 3 dbms_output.put_line('result: true'); 4 elsif null != null then 5 dbms_output.put_line('result: false'); 6 else 7 dbms_output.put_line('result: else'); 8 end if; 9* end; result: else
The two if the conditions are evaluated to NULL, then the else branch is executed.
acutally null = null evaluates to null as you can see:
$[CHE_TEST@asterix1_impl] r 1 declare 2 bres boolean; 3 begin 4 bres := null = null; 5 if bRes is null then 6 dbms_output.put_line('Result: NULL'); 7 else 8 dbms_output.put_line('Result: NOT NULL'); 9 end if; 10* end; Result: NULL
See
http://docs.Oracle.com/CD/B19306_01/AppDev.102/b14261/if_statement.htm#LNPLS01324see you soon
-
String DBMS_OUTPUT buffer limit
Hellou everyone
DECLARE
y varchar2 (32000): = RPAD('x',1000,'*'); -WORK
z varchar2 (32000): = RPAD('x',1001,'*'); -DOES NOT WORK
BEGIN
dbms_output.put_line (length (y));
dbms_output.put_line (y);
dbms_output.put_line (length (z));
dbms_output.put_line (z);
END;
I need a part of debugging and code when the string is Length > 1000 then error pops up:
ORA-06502: PL/SQL: digital or value error: character string buffer too small
ORA-06512: at "SYS." DBMS_OUTPUT", line 148
ORA-06512: at line 2
I don't know if there is some limmitation for the length of the string in put_line in documentation is the obly buffer size
I tried to use dbms_output.enable (1000000) - but the same result
I tried to use DBMS_OUTPUT. GET_LINE, but no results :(
I can insert the value to the table or file, but I want to know why this limitation.
I was looking on the forum but have not found anything.
Thanks for the reply.
ZoffoWhat version of Oracle are you using? This information must be in each original position. Before 10 g dbms_output had a documented length 255 bytes limit.
You posted pl/sql runs without error on my 10.2.0.5 system:
MPOWEL01@UT1> @t15 1000 x******************************************************************************* ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** **************************************** 1001 x******************************************************************************* ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ***************************************** PL/SQL procedure successfully completed.
HTH - Mark D Powell.
PS - set serveroutput size 1000000 included before your pl/sql code
Edited by: Mark D Powell on 31 August 2012 06:16
Maybe you are looking for
-
I post my golf score after each round. I do it from the parking lot to the golf course. I just got an iPhone 7. Everything about AT & T LTE, I get this message: unable to connect Impossible to perform the task at the moment. Please try again late
-
I backed up my old mac and then transferred the data on my new mac. I agree delete playlists iTunes on my old mac for free storage? I don't want to lose the songs on my new mac.
-
My mac mini works well except the disk hard is not recognized in finder. It accepts a disc when I have a pop and whirs for a couple of goes away and then it spits out. The usual restart, unplug the power cord and resets for PVRAM SRC etc. is complete
-
I had VISIO for more than 15 years. I use only occasionally, but it is more load - the program humming just far without starting ((25 % d'utilisation CPU).) Y at - it one solution (other than buying a replacement).
-
How will I know where in the registry is the serial number adobe acrobat 8 standard?