oracle10g

How can I determine if a string is numeric in SQL?

心不动则不痛 提交于 2019-12-17 12:47:53
问题 In a SQL query on Oracle 10g, I need to determine whether a string is numeric or not. How can I do this? 回答1: You can use REGEXP_LIKE: SELECT 1 FROM DUAL WHERE REGEXP_LIKE('23.9', '^\d+(\.\d+)?$', '') 回答2: You ca try this: SELECT LENGTH(TRIM(TRANSLATE(string1, ' +-.0123456789', ' '))) FROM DUAL where string1 is what you're evaluating. It will return null if numeric. Look here for further clarification 回答3: I don't have access to a 10G instance for testing, but this works in 9i: CREATE OR

How to insert/update larger size of data in the Oracle tables?

柔情痞子 提交于 2019-12-17 10:46:28
问题 I want to insert large size of data that character length is more than 10,000. I used CLOB data type to each column. I can't insert/update that large data it shows following error: ORA-01704: string literal too long My code insert into table1 value(1,'values>10000'); 回答1: You'll have to assign the value to a variable & use the variable to insert the data DECLARE v_long_text CLOB; BEGIN v_long_text := 'your long string of text'; INSERT INTO table VALUES (1, v_long_text); END; To make it clear:

Need to reset the value of sequence in Oracle

半腔热情 提交于 2019-12-17 06:14:47
问题 I'm working with Spring and Hibernate to develop web applications in Java. Let's assume that I have a table. When I delete some records from this table, sometimes I need to reset the value of the primary key field. Let's say that I have 10 records in a table and I delete the last 5 records. Now, when I insert new records, the value of the primary key field should be started at 6 but it would start at 11 . If I need to start the primary key value at 6 ( maximum +1 ) in MySql, I just need to

How do you get nicely formatted results from an Oracle procedure that returns a reference cursor?

蹲街弑〆低调 提交于 2019-12-17 05:08:31
问题 In MS SQL Server if I want to check the results from a Stored procedure I might execute the following in Management Studio. --SQL SERVER WAY exec sp_GetQuestions('OMG Ponies') The output in the results pane might look like this. ID Title ViewCount Votes ----- ------------------------------------------------- ---------- -------- 2165 Indexed View vs Indexes on Table 491 2 5068 SQL Server equivalent to Oracle’s NULLS FIRST 524 3 1261 Benefits Of Using SQL Ordinal Position Notation? 377 2 (3 row

How do you get nicely formatted results from an Oracle procedure that returns a reference cursor?

瘦欲@ 提交于 2019-12-17 05:08:01
问题 In MS SQL Server if I want to check the results from a Stored procedure I might execute the following in Management Studio. --SQL SERVER WAY exec sp_GetQuestions('OMG Ponies') The output in the results pane might look like this. ID Title ViewCount Votes ----- ------------------------------------------------- ---------- -------- 2165 Indexed View vs Indexes on Table 491 2 5068 SQL Server equivalent to Oracle’s NULLS FIRST 524 3 1261 Benefits Of Using SQL Ordinal Position Notation? 377 2 (3 row

Oracle Joins - Comparison between conventional syntax VS ANSI Syntax

試著忘記壹切 提交于 2019-12-17 04:28:48
问题 Preamble Of late, I see too many geeks commenting on Oracle questions saying that "Do not use (+) operator, rather use JOIN syntax". Question I do see that both work well. But what is the real difference between using them and what makes you feel using them? I would welcome answers, more from experience. 1. Is there anything to do with limitations in application, performance, etc. while using them? 2. What would you suggest for me? I did read something on Oracle documentation but not good

Different CURRENT_TIMESTAMP and SYSDATE in oracle

半世苍凉 提交于 2019-12-17 03:04:10
问题 After executing this SQL in oracle 10g: SELECT SYSDATE, CURRENT_TIMESTAMP FROM DUAL I receive this strange output: What is cause of the difference in time? The server time is equal of SYSDATE value 回答1: CURRENT_DATE and CURRENT_TIMESTAMP return the current date and time in the session time zone. SYSDATE and SYSTIMESTAMP return the system date and time - that is, of the system on which the database resides. If your client session isn't in the same timezone as the server the database is on (or

Is this a possible Oracle bug or am I missing something?

无人久伴 提交于 2019-12-14 03:52:07
问题 Database is Oracle 10.2.0.1.0 - 64bit running on Red Hat Enterprise Linux ES release 4 (Nahant Update 8) In SQL*Plus following code run perfectly: var comment_id number exec :comment_id := 3052753 select e.label as doc_name, e.url, i.item_id, 'multi' as form_type from cr_items i, cr_extlinks e where i.parent_id = :comment_id and e.extlink_id = i.item_id UNION select null as doc_name, utl_raw.cast_to_varchar2(DBMS_LOB.SUBSTR(r.content, 2000, 1)) as url, r.item_id, 'single' as form_type from cr

Getting a ResultSet/RefCursor over a database link

陌路散爱 提交于 2019-12-14 03:48:44
问题 From the answers to calling a stored proc over a dblink it seems that it is not possible to call a stored procedure and get the ResultSet/RefCursor back if you are making the SP call across a remote DB link. We are also using Oracle 10g. We can successfully get single value results across the link, and can successfully call the SP and get the results locally but we get the same 'ORA-24338: statement handle not executed' error when reading the ResultSet from the remote DB. My question - is

ORA-01000: maximum open cursors exceeded in asp.net

♀尐吖头ヾ 提交于 2019-12-14 03:12:54
问题 I'm facing ORA-01000: maximum open cursors exceeded After hosting an ASP web page on IIS. When I test the web page with visual studio. The maximum open cursors exceeded problem does not happen. What the cause of the problem happen & how can I solve it When I close and displose the Oracle connection then will the opened cursors be automatically closed? If not, how can I close them? Code I use to close & displose the connection rdr.Close() rdr.Dispose() cmd.Connection.Close() cmd.Connection