Insert Text Literal and Concatenation in Oracle SQL डालें पाठ शाब्दिक और कड़ी Oracle में एसक्यूएल
In Oracle, it's possible to insert literal or concatenate 2 or more charater strings or SQL result output together. Oracle में, यह शाब्दिक या 2 जोड़ना या अधिक charater तार या एसक्यूएल परिणाम उत्पादन में डालने के साथ संभव है. This manipulation allows you to manipulate the format of data returned by SQL query. इस हेरफेर तुम एसक्यूएल क्वेरी से लौट आए आंकड़ों के प्रारूप में हेरफेर करने की अनुमति देता है.
Two solid vertical bar || operator is used to concatenate 2 or more strings. दो ठोस ऊर्ध्वाधर बार | | ऑपरेटर के लिए 2 या अधिक तार जुटना प्रयोग किया जाता है. Beside, Oracle also provides the CONCAT character function as an alternative to the vertical bar operator just in case there is situation where it is difficult or impossible to control translation performed by operating system or network utilities. बगल में, Oracle भी ऊर्ध्वाधर बार ऑपरेटर के लिए एक विकल्प के रूप में CONCAT चरित्र समारोह में प्रदान करता है बस मामले में जहां यह मुश्किल या ऑपरेटिंग सिस्टम या नेटवर्क उपयोगिताओं द्वारा किया अनुवाद नियंत्रण असंभव है स्थिति है. This function should be used in applications that will be moved between environments with differing character sets. इस समारोह अनुप्रयोगों कि चरित्र भिन्न सेट के साथ वातावरण के बीच में आ जाएंगे में इस्तेमाल किया जाना चाहिए.
Oracle will automatically casts values into types which can be concatenated. Oracle स्वतः प्रकार जो concatenated जा सकता है में होगा मूल्यों डाले. As Oracle interprets NULL as the empty (zero-length) character string, it doesn't return NULL if an operand is NULL, meaning concatenating a zero-length character string with another operand always results in the other operand, so null can result only from the concatenation of two null strings. Oracle के रूप में खाली (शून्य लम्बाई) वर्ण स्ट्रिंग के रूप में रिक्त व्याख्या, यह रिक्त वापस नहीं अगर एक संकार्य रिक्त है करता है, एक शून्य लम्बाई एक और हमेशा संकार्य अन्य संकार्य में परिणामों के साथ चरित्र स्ट्रिंग concatenating अर्थ है, तो रिक्त ही परिणाम कर सकते हैं नल से दो तार की कड़ी. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string. एक अभिव्यक्ति है कि रिक्त हो सकती है, NVL समारोह का उपयोग स्पष्ट रूप से एक शून्य लंबाई स्ट्रिंग को अभिव्यक्ति परिवर्तित जोड़ना.
Concatenating two strings results in another character string. एक और चरित्र स्ट्रिंग में दो तार परिणाम Concatenating. If both character strings are of datatype CHAR, the result has datatype CHAR and is limited to 2000 characters. यदि दोनों चरित्र तार डेटाप्रकार CHAR के होते हैं, परिणामस्वरूप डेटाप्रकार CHAR है और 2000 के अक्षरों तक सीमित है. If either string is of datatype VARCHAR2, the result has datatype VARCHAR2 and is limited to 4000 characters. अगर किसी भी स्ट्रिंग डेटाप्रकार VARCHAR2 की है, परिणाम डेटाप्रकार VARCHAR2 है और 4000 वर्णों तक सीमित है. Trailing blanks in character strings are preserved by concatenation, regardless of the strings' datatypes. चरित्र तार कड़ी द्वारा संरक्षित में खाली पीछे चल रहे हैं, 'तार datatypes की परवाह किए बिना.
For literal insertion, put the strings between the single quote ' in the SQL statement. शाब्दिक प्रविष्टि के लिए, एसक्यूएल बयान में एकल बोली 'के बीच तार डाल दिया.
Example and Usage : उदाहरण के और उपयोग:
SELECT 'Name is ' || name FROM table; चुनें 'नाम' है | | नाम से मेज;
Name is whatever_name नाम whatever_name है
SELECT number || ' – ' || description FROM table ORDER BY number संख्या का चयन करें | | '-' | | वर्णन से मेज आदेश द्वारा संख्या
1 – description 1 1 - 1 वर्णन
2 – description 2 2-2 विवरण
Advance Usage : अग्रिम उपयोग:
It's possible to use Concatenation and Literal Insertion to generate a set of SQL query language automatically, especially when need to perform same operation to lots of tables, ie dropping a lot of tables. यह कड़ी और शाब्दिक प्रविष्टि का उपयोग करने एसक्यूएल क्वेरी भाषा का एक सेट स्वतः उत्पन्न है, खासकर जब से मेज के बहुत से ही ऑपरेशन की जरूरत है, टेबल के एक बहुत छोड़ने अर्थात संभव है. To do this, format the SQL data query language to output the query result in valid SQL format, and spool the SQL query results to a file. ऐसा करने के लिए, स्वरूप एसक्यूएल डेटा क्वेरी भाषा वैध एसक्यूएल प्रारूप में क्वेरी परिणाम उत्पादन के लिए, और एक फाइल को एसक्यूएल क्वेरी परिणाम स्पूल. Then execute the file that contains SQL statements. फिर फाइल को एसक्यूएल बयान लागू होता है.
Example: उदाहरण:
SELECT 'DROP TYPE ' || type_name || ';' 'चुनें ड्रॉप प्रकार' | | | type_name | ';'
will generates: उत्पन्न करेगा:
DROP TYPE type_name छोड़ TYPE type_name
that can be run at SQL*Plus by calling the file with @filename. कि एसक्यूएल में चला जा सकता है * प्लस के साथ फ़ाइल नाम @ फ़ाइल का नाम देकर. All types that been selected from first SQL statements will be dropped from the database. सभी प्रकार है कि पहली एसक्यूएल बयान से चुना गया है डाटाबेस से हटा दिया जाएगा.
IMPORTANT : The page is machine translated and provided "as is" without warranty. महत्वपूर्ण: पृष्ठ की मशीन है और अनुवाद प्रदान "के रूप में वारंटी के बिना है." Machine translation may be difficult to understand. मशीन अनुवाद मुश्किल से समझ सकते हो. Please refer to कृपया उल्लेख करने original English article मूल अंग्रेजी लेख whenever possible. जब भी संभव है.
Related Articles संबंधित लेख
- How to Escape Characters in Oracle PL/SQL Queries कैसे Oracle पी एल / SQL प्रश्न में वर्ण बचने के लिए
- Use {Literal} Smarty Tag to Add Google Analytics Tracking Code to BlogSome Hosted Blogs इस्तेमाल की शाब्दिक () समझदार टैग BlogSome होस्ट ब्लॉग के लिए Google Analytics ट्रैकिंग कोड जोड़ें
- Oracle EXP-00091 Error When Export Database Oracle EXP-00091 त्रुटि जब निर्यात डाटाबेस
- Insert and Fill Random Filler Text and Lorem Ipsum Into Office Word, Execel and PowerPoint 2007 डालें और भरें Random पूरक पाठ और Lorem Ipsum में Office Word, Execel और PowerPoint 2007
- Change Oracle Database User Password बदलें Oracle डाटाबेस प्रयोक्ता पासवर्ड
- Check Oracle Version जांच Oracle संस्करणः
- ORA-01502 Oracle Index in Unusable State ORA-01502 Oracle सूचकांक व्यर्थ राज्य में
- IMP-00016 Required Character Set Conversion Not Supported Error when Import to Oracle Database छोटा सा भूत-00016 आवश्यक कैरेक्टर सेट रूपांतरण नहीं समर्थित त्रुटि जब Oracle डाटाबेस के लिए आयात
- Manual and Clean Uninstall Oracle for Windows मैनुअल और स्वच्छ स्थापना रद्द करें Oracle Windows के लिए
- Oracle ORA-01658 Unable to Create INITIAL Extent for Segment in Tablespace Error Oracle ORA-01658 से अनुभाग के लिए तालिकास्थान त्रुटि के रूप में शुरू में विस्तार करने में असमर्थ बनाएँ










































March 2nd, 2007 21:57 2 मार्च 2007 21:57
Good article. अच्छा लेख. Got what I was looking for… मिल गया जो मैं देख रहा था ...