Skip to content

Sqlcode of the cursor query in oracle

I have a oracle cursor with query CURSOR cursor IS SELECT column1 FROM table_name WHERE column1 = 48200; DBMS_OUTPUT.PUT_LINE(SQLCODE); I need the SQLCODE of the query in the cursor. I wrote without …

How can I filter on associated objects?

I want a filter on included/joined associated models. practice.patients.joins(‘ LEFT JOIN appointments on patients.id = appointments.patient_id LEFT JOIN patient_treatments on patients.id = …

SQL Server convert row values to columns

I have an SQL table like this Name1 Name2 Department1 Department2 Location1 Location2 ———————————————————————- Jhon Alex IT …

Using CASE WHEN to assign buckets

Fairly new to coding. I’ve created a new column that outputs the days a task is overdue using DateDiff. I then want to take the result of the DateDiff and assign it an expression (>60 days overdue, 30-…

Need to join but on a secondary table

I have this one view all_people_expanded_view that has all the data needed except 1. The race of client is in race table. But the description is in race_info. I need to join on race on people_id, but …