Skip to content

Tag: sql

Create a stored procedure in a package oracle

I have created the following package in Oracle: Here is my procedure that I’m trying to create: When I try to create the procedure, I get the following messages: Error(8,3): PL/SQL: SQL Statement ignored Error(8,8): PLS-00456: item ‘P_ITEM’ is not a cursor I’m new to this with packages…

SQL extract data to Excel using Powershell

I want to extract data from SQL server to a new excel file using powershell . For small data set my code works but some tables has more than 100.000 rows and this will take ages. The reason why I don’t use the utility in SQl server is because I want to extract mutilple tables. Is there a way to

Updating table with datetime 6 hours advance

I wonder if this is possible I have easily done this with jQuery however I need it on a database that I have no control aside from updating it, what I want to accomplish is update it 6 hours advance let’s say time now is 1AM I’d like it to be 7AM This code works For getting current date and

Sampling a large number of rows from a table

I want to extract a roughly 5 million row sample from a table that will contain somewhere between 10 million and 20 million rows. Due to the large number of rows, efficiency is key. As such, I am trying to avoid sorting the rows where possible, hence why I am avoiding the dbms_random.value solution that I hav…

What is the syntax of array literal in H2 db?

I need to write an insert query where one value is an array of 3 elements. I’ve tried to do it like this: The sintax I’ve used for ‘col’ value is valid array literal in PostrgreSQL but H2 treats it as a single value of the array but not as an array with 3 elements. Table DDL: Answer Ba…