Skip to content

Tag: oracle

Translating Oracle Date Functions to BigQuery

I’m having trouble translating these Oracle date functions to BigQuery because BigQuery doesn’t allow such user-friendly additions to dates/timestamps. Any help is appreciated. Below are the two date functions in Oracle and my attempted (failed) versions in BigQuery: Oracle: BigQuery attempt: Answ…

Ignore Null Bind Variables in SQL

I am trying to create a dynamic SQL Statement which can be used to filter based on several parameters. But one of the caveats is that not all parameters will be available, so could 4 variables or could be 0. This is my attempt at creating this query (small example with only one variable): This however throws …

DELETE By Procedure With String Input – Oracle

I am writing a procedure to delete some records of z_names table by IDs from the input as string (and I need to seprate them by special character (comma ,)). Sample Input: ‘1,4’ z_names table: ID NAME 1 jim 2 john 3 jack 4 alex After running this procedure, the record with ID 1 and 4 (jim and alex…

Unsure of what to put in the GROUP BY statement

I have the following code However I am unsure what to put in the group by clause as I am receiving this error. ORA-00979: not a GROUP BY expression 00979. 00000 – “not a GROUP BY expression” *Cause: *Action: In the group by , do you have to put the calculation and casts etc. Any help appreci…

Data inserting in between the rows in table

I have a table which has around 1,000,000 records. I noticed that when I insert a record it does not get inserted at last instead it gets inserted in between Example My table (testing) Si. Name. Address. 1. Test. 1/2 test 2. Test. 3/4 test Si has a unique index created but no primary keys defined So when I ma…