Description of Oracle multi-tracking number

Source: Internet
Author: User

In Oracle, single quotes have two effects, one is that strings are quoted by single quotes , and the other is escaped. The use of single quotes is the nearest pairing, the nearest principle . While single quotation marks are relatively poorly understood when they act as escape characters

1, starting from the second single quotation mark is considered an escape character, if there is a single quotation mark after the second single quotation mark (even if there is only one).
Select ' from dual----output: '
Explanation: The second single quotation mark is used as an escape character, and the third single quote is escaped, which can be written in such a way as to better understand:
Select ' from dual----output: '

2. Connector ' | | ' resulting in a new round of escaping: Connection symbol ' | | ' There is no relationship between the single quotation marks, except ' | | ' is part of a string (this is common in dynamic SQL).
Select ' Name ' | | ' from dual----output:name '
Understand: | | The following as a string, that is, before and after is ', in the middle is a dense single quote string ', so the first escape function
Select ' Name ' from dual----output:name '
Understanding: First and last single quotation marks as String reference, middle four single quotes 22 escape

Example:

Select ' Insert into Wt_shipmentproduct (wt_shipmentproduct_id, ad_client_id, ad_org_id, ISACTIVE, CREATED, CreatedBy, UPDATED, Updatedby, m_product_id, wt_owms_shipment_id, wt_ofc_id, QTY, Confirmqty, NAME) ' | |
' VALUES (Wt_shipmentproduct_seq.nextval, one, 50000, ' Y ', Sysdate, 1000180, Sysdate, 1002382, (select m_product_id from M _product p WHERE P.sku = "' | |
M.sku | |
"), (select wt_owms_shipment_id from wt_owms_shipment s where S.documentno =" ' | |
M.documentno | |
"), (select wt_ofc_id from wt_owms_shipment where documentno=" | |
M.documentno | | "), ' | | m.qtyproduct | | ', 0, ' ' | | M.name | |
‘‘‘);‘

,
M.qtyproduct
From Adempiere.wv_owms_arrivalnoticeproduct m
where M.documentno in (' 1000768 ')

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.