I need to split a string like this (NUL) means a character with ASCII value 0. Don’t know how to type it here. I need to split this when (NUL)~ occurs. So the expected result after split is RANDOM(NUL)THIS_SHOULD_BE_SPLIT THIS_IS_NEW(NUL)STRING THIS_IS_ANOTHER_STRING(NUL) Using OracleDB not sure how it …
Tag: oracle
Replacing null based on a condition
I am having a table with many columns (but posting only col1, col2, col3 here for simplified post): I want to fill null values of source _id with values from id. For example, source_id a5 row has null which has to replaced with id a1 values, subsequently, source_id a6 row having null to be replaced with a5 ro…
Getting error while assigning value to collection variable
procedure ins_note (pi_data in note_detail_arr) is begin FOR i IN pi_data.first..pi_data.last loop IF pi_data(i).template_id IN (022, 019, 015, 017, 021, 001, 010, 016, 018, 020, 023) …
cast VARCHAR2 to LONG,RAW,CLOB and find HASH md5
There is a table A with fields (str1 VARCHAR2(4000 CHAR),str2 VARCHAR2(4000 CHAR)) There is a table B with fields (str1 VARCHAR2(4000 CHAR),str2 VARCHAR2(4000 CHAR),hash_code NUMBER) As a result there is an exception when length(str1||str2) is longer than 4000 (varchar2 is too small). How can I cast this to o…
Get data based on condition in oracle sql
My table loads(Unique) Value T123 11 T234 9.5 T456 15 T678 35 T345 3.7 Want I want count(values<=10) …
How to count multiple columns in SQL (Oracle) with criteria?
I’m working on SMS-Gateway that holds multiple charged SMS-services with different numbers, each SMS sent to the customer has 4 status as below (forwarded, delivered, expired,delivery failed) Now I have the below first_table for the charging-system with the below details (TABLE-A) and below (TABLE-B) wh…
Oracle – How use string data in (in operator)
In tbl_1 I have: Select * from tbl_1 where id in (Select value from tbl_2 where id = 2); –is OK Select * from tbl_1 where id in (Select value from tbl_2 where id = 1); Answer Yet another option:
SELECT data grouped by WEEK in SQL
I have a working query (ORACLE SQL) that gives me gallons grouped by store number, with gallons summed by type and a percentage column as well. Each store number has a different conversion date from which I sum up the data – I now need to also sum it up by week, with Sunday being the first day of each
How do I fix this error: ORA-00933: SQL command not properly ended
Got this error while trying to enter values for 2 different tables on Oracle APEX and need help figuring out where I went wrong. I’m not sure if it’s because I made a typo somewhere or it’s because I’…
query for trunc(date) on a view that already filters for date
We’re accessing a view from another team’s database and to make it a lot simpler, the view looks a bit like this: create view x_view as select x.exec_time, … from stuff x where x.exec_time &…