Skip to content
Advertisement

Tag: plsql

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

Invalid identifier in PLSQL

I want to print employee information according to employee-id. But when I compile code I get this error Here is my code Answer You should display local variables’ values, not table columns.

Procedure: PL/SQL: ORA-00904: “QUARTER”: invalid identifier

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

Selecting last record in plsql

Hello I need to select last record in a table(bill_account_billcycle). After finding it I need to take bill_date column date from last record and need implement inside my cursors’ query. I read rownum max etc but couldnt succeed to implement. I am open to advices. I am going to add a screenshoot of one bill_account record to there and my

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

Conditional debit from credits and running balance using SQL

I’ve data like below in a table cryptotransactionledger id transaction_typeid transaction_type amount totalcoins 1 1 bitcoin-credit 30 30 2 2 ethereum-credit 20 50 If I spend bitcoin, I’m putting a new entry like below in the same table with transaction_typeid 3 and similarly for ethereum with transaction_typeid 4 id transaction_typeid transaction_type amount totalcoins 1 1 bitcoin-credit 30 30 2 2

Pivot/Unpivot SQL Result Set Column Names into Separate Column

I have a result set something like this: Username Birthday Gender Tom Jan 23 Male I would like to convert it to something like this: Name Value Username Tom Birthday Jan 23 Gender Male I’ve been told Pivot/Unpivot was what I was looking for, but I can’t find any info on pulling the column names. Is there a way to

Remove duplicate values from comma separated variable in Oracle

I have a variable (called: all_email_list) which contains 3 email address lists altogether. (I found some similar question but not the same with a proper solution) Example: test@asd.com, test2@asd.com,test@asd.com,test3@asd.com, test4@asd.com,test2@asd.com (it can contain spaces between comas but not all the time) The desired output: test@asd.com, test2@asd.com,test3@asd.com,test4@asd.com Any solution to solve this in a simple way? By regex maybe. Answer Solution

Delete node when child have a certain value is found

I intend to remove a node whenever I find the unit_qty tag with the value equal to 0.0000. For example considering that the message below is called MESSAGE_DATA: the purpose of message_data is to return the following: I’ve already tried the following options: I don’t know if I’m looking up the tag wrong but I’ve tried it with several formats

Advertisement