Skip to content
Advertisement

Tag: stored-procedures

Procedure: PL/SQL: ORA-00904: “QUARTER”: invalid identifier

I’m new to Oracle PL/SQL and I’m attempting to create a procedure, called pop_date_dim, which populates an already-existing date dimension called date_dim. It does so by accepting both a date (DDMMYYYY) and a number (n) as parameters. The date dimension is then populated by using a FOR loop. Unfortunately, I keep getting two errors. Error(142,9): PL/SQL: SQL Statement ignore and

Returning Json string from oracle procedure

I need to have a stored procedure in PL/SQL that return a string containing a json object. This object must be a list of object representing rows a table. For example I have the table MY_TABLE(ID, TB_VALUE) The output must be : My stored procedure looks like that : What’s the best way to achieve this ? Should I use

Get max date based on another column in SQL

I have a table variable which consists of columns id, date and status as shown below And follows is the sample data Also declared a variable as shown below. From this table I need to get the row which containing the maximum value of date( MAX(dates) ) where status is ‘ABC’, from the above sample values, I should get the

SQL query join tables data

I have 2 tables Users and TimeSheets, Timesheets table has column UserId which is users id form users table obviously 🙂 Logic And I’m trying to get all data of Timesheets table plus just name of user from users table but somehow it seems like my query is other way around! Now I know this might be a simple query

SQL copying data with new foreign keys

I have a very tricky problem here. I have two tables. One is dependent on another by foreign key. Table 1 Table1ID Instance ID ModifiedBy 1 1 yevhen 2 1 yevhen 3 1 yevhen Table 2 ID Instance ID Table1ID 1 1 1 2 1 2 3 1 3 These are taken as datasets for something named “Scenario”. When somebody

Advertisement