Skip to content
Advertisement

Tag: procedure

How do I join a string and an int in PostgreSQL?

I have a procedure with an int parameter. The syntax for the add_retention_policy function is add_retention_policy(‘hypertable’, INTERVAL ‘x days’, true). I want to prefix the hypertable with the schema which is always ‘schema_’ and then followed by the id parameter, how do I do that? Answer You just need to rewrite the INTERVAL part in your function call as days

Found the symbol “CREATE” instead of

I don’t know why it gives me this error: Error(3,3): PLS-00103: Found the symbol “CREATE” instead of one of the following: ( begin case declare exit for goto if … I tried using the backslash, but it doesn’t solve the problem, any help? Answer You cannot use DDL statements in PL/SQL. You need to use EXECUTE IMMEDIATE and cannot use

Unable to create DB2 Procedure through command line

I am trying to create a procedure to do a blanket revoking of executeauth for procedures from a schema. This is in line with trying to secure a non-restricted database. and this is the command I run to process the file with the code above. However, I keep running into this error I’m fairly new to DB2 and this is

Oracle procedure saving SYSDATE

As part of a larger procedure I’m trying to write some code, which saves SYSDATE into a variable but I’m running into a problem. I narrowed it down to the following. Can someone please help me out. Answer In PLSQL you can just assign: if you insist on sql all you have to do is to add into after select:

sql query to pl sql procedure

this is my requirement .i want fetch the record from one table and store it in another temporary table.i wrote as query.but dont know how to make it as procedure by declaring varibales and so. Daily new customers data will gets inserted in table.I only want to fetch the customer data who signed attribute_value as ‘TOY_GIFT’ from last 10 to

MySQL procedure not working with both select and delete

I created a procedure to get a vehicle id from the vehicle table using vehicle number input, then delete the booking record for that vehicle id, and at last to delete the entry in the vehicle table… But when creating the procedure I get an error at line 7 saying Error Code: 1064. You have an error in your SQL

PLS00215: String length constraints must be in range (1..32767)

I am new to pl/sql. I want to create a procedure that has three parameters called ‘startMonth’, ‘endMonth’, ‘thirdMonth’. In the procedure, I am executing a sql query which is in ‘run_sql’ column in table_query. Values for ‘startMonth’, ‘endMonth’, ‘thirdMonth’ are needed to this query. This is how I wrote the procedure. My plan is to put all the sql

How to create procedure in mysql

I am creating a procedure in mysql but I am facing issues with the required result and now I am in a total mess. Please help me! The requirements is this: Get the Top 20 entries from the table, for the current day. By Top 20 entries, they should be the ones that occurred most often during the day –

Advertisement