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
Tag: stored-procedures
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
How do I pass a variable to a stored procedure to update a row in another database?
I need to get a value from one database for a customer and update another database with that value. The procedure below works but I need to have it go through table2 and update every customer in table1 with a matching CustomerID. I hate to use the word loop through but as I said, I am very new to this
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
T-SQL stored procedure: update local variable inside IF/ELSE statement
I have an item table that has a foreign key constraint customer_id that references a customer table. The customer_id column is of type uniqueidentifier which needs to be generated on insert (there is no value we could use for this provided by the client). I am created a T-SQL (using SQL Server Express) stored procedure to be called from C#
refactoring sql while loop to regular inserts
I am inserting parent records and child records at the same time in a stored procedure. Rather than have outside code make nested calls to create each parent and then each child of that parent (which is even slower than my current approach), I am giving the sql a comma separated list of child types that I put into a
Conversion failed when converting the varchar value ‘ AND ID =’ to data type int
I was looking how I can parameterize table names and so I found dynamic sql queries. I finally got the proc saved, but when I execute it errors out with “Conversion failed when converting the varchar value ‘ AND ID =’ to data type int.” I have no idea what is going wrong when I try to execute this stored
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
Why i am getting error while executing pl/sql program?
Answer In your code you are missing the semicolon in insert statement & radius value assignment statement – Demo.