Adding progress monitor while inserting data to a Oracle db using Python

Advertisements I would like to add a progress bar in my python script. I am running following lines of code. I am reading a file ‘MRSTY.RRF’ which is 0.195 MB. I would like to how much file has been processed. insert_sty = "insert into MRSTY (CUI,TUI,STN,STY,ATUI,CVF) values (:0,:1,:2,:3,:4,:5)" records=[] with open("../umls_files/umls-2023AA-metathesaurus-full/2023AA/META/MRSTY.RRF" , ‘r’) as f:… Read More Adding progress monitor while inserting data to a Oracle db using Python

oracle sql grouping and custom ordering

Advertisements Below is source data Due Date Status Activity Name Completed_date Completed Maintenance (ADV) 23-Feb-23 9-Apr-23 Assessment Maintenance (ADV) Completed Records Management Standards 10-Mar-23 16-Apr-23 Pending Records Management Standards 16-Apr-23 Assessment Records Management Standards 10-Mar-23 Scheduled Records Management Standards Completed Monitor Compliance 14-Feb-23 9-Apr-23 Assessment Monitor Compliance Completed Monitor Customer 23-Feb-23 9-Apr-23 Pending Monitor Customer… Read More oracle sql grouping and custom ordering

Oracle SQL select from multiple condition but with has same id's

Advertisements I will retrieve data fom oracle database. It has table as you see in picture below. (Table Name is ATTRIBUTE_TAB) I want to query: if (VALUE_NO=’6000′ VALUE_TEXT=’TEMPERED’ VALUE_TEXT=BLUE) but these rows has to be same id. I explained in picture below. My Query is SELECT * FROM ATTRIBUTE_TAB WHERE VALUE_NO=’6000′ OR VALUE_TEXT=’TEMPERED’OR VALUE_TEXT=’BLUE but… Read More Oracle SQL select from multiple condition but with has same id's

How to find how many times a code was used in the past 5 years

Advertisements I’m looking to see often account codes (FTABLE_ACCT_CODE) from a list were used in the past 5 years. I’d like to inactivate them if they weren’t used much. I tried the following select distinct FTABLE_ACCT_CODE, Count(FTABLE_ACTIVITY_DATE), FTABLE_ACTIVITY_DATE from FTable where FTABLE_ACCT_CODE IN (‘1000′,’1001′) and FTABLE_ACTIVITY_DATE >= ’15-May-2018’ GROUP BY FTABLE_ACCT_CODE, FTABLE_ACTIVITY_DATE I was expecting… Read More How to find how many times a code was used in the past 5 years

insert timestamp in oracle

Advertisements I am trying to insert timestamp value in Oracle but its failing for the below query. Please suggest the fix for the same. I tried appending ‘timestamp’, but no luck. insert into table (name, created_date) values (‘test’, ‘2023-04-24T11:11:11.807Z’); this is the exception I am getting: SQL Error: ORA-01861: literal does not match format string… Read More insert timestamp in oracle

how to resolve:- PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: begin end function pragma procedure

Advertisements Need to alter the table by adding one column how can we write correct syntax for altering the table inside the package? it can be with procedure or function? I tried with procedure and getting this error CREATE OR REPLACE PACKAGE BODY temp IS PROCEDURE prc_proc_add_column( table_name IN user_tab_columns.TABLE_NAME%TYPE, p_return OUT NUMBER, p_message OUT… Read More how to resolve:- PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: begin end function pragma procedure

I'm trying to show null values as zeros, how would I join these tables together?

Advertisements This is the query I have, as far as I can tell it should be correct except I am unsure how to combine the tables using the building as a common field. SELECT l.building AS "BUILD", NVL(NUMSECTIONS, 0) AS "NUMSECTIONS" FROM location l LEFT OUTER JOIN (SELECT building AS "BUILD", COUNT(*) AS "NUMSECTIONS" FROM… Read More I'm trying to show null values as zeros, how would I join these tables together?