advanced sql Functions in Oracle 10G phần 7

Ở đây, chúng tôi đã neo mô hình bằng cách sử dụng dấu sót. Sau đó, chúng tôi đã mâu thuẫn với chính mình bằng cách yêu cầu các mô hình để bắt đầu tìm kiếm ở vị trí thứ hai của chuỗi. Mâu thuẫn kết quả trong một trận đấu không bởi vì chuỗi tìm kiếm có thể không được neo ở đầu và sau đó tìm kiếm từ một số vị trí khác. | Regular Expressions String Searching and Oracle 10g Gives ADDR WHERE_IT_IS 1664 1 2 Springhill Ave 13 Or we can add anchors or wildcard match characters as need be. One must be careful when anchoring and using the other arguments. Consider this example SELECT REGEXP_INSTR Hello . 2 FROM dual Gives REGEXP_INSTR HELLO . 2 0 Here we have anchored the pattern using the caret. Then we have contradicted ourselves by asking the pattern to begin looking in the second position of the string. The contradiction results in a non-match because the search string cannot be anchored at the beginning and then searched from some other position. To return to the other extra arguments we discussed earlier we noted that the Parameters optional argument allowed for special use of the period metacharacter. Let s delve further into the use of those arguments. Suppose we had a table called Test_clob with these contents DESC test_clob 234 Chapter I Giving Name Null Type NUM NUMBER 3 CH CLOB SELECT FROM test_clob Gives NUM CH 1 A simple line of text 2 This line contains two lines of text it includes a carriage return line feed Here are some examples of the use of the n and m parameters Looking at the text in Test_clob where the value of num 2 we see that there is a new line after the semicolon. Further the characters after the x in text may be searched as a t followed by a semicolon followed by an invisible new line character followed by a space then the letters it SELECT REGEXP_INSTR ch t . it REGEXP_INSTR ch x 1 0 n where is t after x FROM test_clob WHERE num 2 Gives where is t after x 36 The query shows the use of nested functions a REGExP_INSTR within another REGEXP_INSTR . Further we specified that we wanted some character 235 Regular Expressions String Searching and Oracle 10g after the semicolon. In order to specify that the some character could be a new line we had to use the n optional parameter. Had we used some other optional parameter such as i we would not have found the pattern

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.