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…
Tag: sql
SQL Server – How to alter column nvarchar length without drop
I’m trying to alter the length of the column “Body” in table “Post” like this: ALTER TABLE Post ALTER COLUMN Body nvarchar(8000) NOT NULL; The column is defined as nvarchar(4000) and it gives me …
Execute procedure in statement in NOT IN()
I have the following stored procedure in SQL Server CREATE PROCEDURE storedProcedureExample (@displayName NVARCHAR(256)) AS SELECT users.id –user.id is INT FROM users WHERE users….
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…
BigQuery query nested json
I have JSON data which is saved in BigQuery as a string. { “event”:{ “action”:”prohibitedSoftwareCheckResult”, “clientTime”:”2017-07-16T12:55:40.828Z”, “clientTimeZone”:”3″, …
MS Access 2016, joining multiple tables with composite keys
Good Morning all, My first question, so pardon some bad form if it exists. I currently have three tables (table1, table2, table3), all of which have a composite primary key (model-number, serial-…
Query exhausted resources at this scale factor
I was running SQL query on Amazon Athena. And I got the following error couple of times: Query exhausted resources at this scale factor This query ran against the “test1” database, unless qualified …