How to add decimal places in to my oracle SQL query result

I have the following query select oc.card_number, case opt.oper_type when ‘OPTP0000′ then ’05-PURCHASE’ when ‘OPTP0020′ then ’06-CREDIT VOUCHER’ else ‘other’ end as Transaction_Type, opt.oper_date as "TRANSACTION_DATE", op.account_number, case vf.sttl_currency when ‘840’ then ‘USD’ end as "SOURCE_AMOUNT_CURRENCY", case opt.oper_type when ‘OPTP0000’ then -vf.sttl_amount else vf.sttl_amount end as "SOURCE_AMOUNT", op.auth_code, opt.mcc, opt.terminal_number as "TERMINAL_ID", vf.pos_terminal_cap, vf.pos_entry_mode, opt.part_key… Read More How to add decimal places in to my oracle SQL query result

Oracle SqlDeveloper failing on Multi-Line Execute SP with Comments: PLS-00103: Encountered the symbol ";" when expecting one of the following

In SqlDeveloper I’m trying to execute the following multi-line SQL EXECUTE with comments, execute MYPKG.MYSP (null/*Param1*/, null/*Param2*/, 123/*Param3*/, null/*Param4*/, etc. On the first newline it flags the error execute MYPKG.MYSP (null/*Param1*/, null/*Param2*/, 123/*Param3*/, ; END; ORA-06550: line 1, column 131: PLS-00103: Encountered the symbol ";" when expecting one of the following: ( – + case… Read More Oracle SqlDeveloper failing on Multi-Line Execute SP with Comments: PLS-00103: Encountered the symbol ";" when expecting one of the following

Update a row in oracle SQL that has been copied from the same table without effecting previous row

Right now my table(Batch_relations) has fields such as (Batch_name, Batch_size,…) I want to be able to create a copy of a row from this table(already done) and then update that row without changing the row that is was copied from. For example, lets say I have a batch_name called testBatch and the batch size is… Read More Update a row in oracle SQL that has been copied from the same table without effecting previous row

NULL is not getting matched in case expression in sql

I want to write a query where for my date parameter ‘P_D_IN_END_DT’ if either ’01/01/1900′ or ’01/01/1′ or NULL is passed then i will take ‘sysdate’ else i will take parameter i.e ‘P_D_IN_END_DT’ value only. SELECT CASE WHEN P_D_IN_END_DT IN ( TO_DATE (’01/01/1900′, ‘dd/mm/yyyy’), TO_DATE (’01/01/1′, ‘dd/mm/yyyy’), NULL) THEN TRUNC(SYSDATE) ELSE P_D_IN_END_DT END AS END_DT… Read More NULL is not getting matched in case expression in sql

Need suggestion with Oracle REGEXP_REPLACE function

I am writing an update query where I need to update some values in a column using REGEXP_REPLACE function. I had written the below query which works correctly. update my_table_name set column_name = REGEXP_REPLACE(column_name, ‘"MyValue":0’, ‘"MyValue":2’ ) WHERE column_id=1234; However, after – "MyValue": it can be any number ranging from 0-9. So I am trying… Read More Need suggestion with Oracle REGEXP_REPLACE function