plsql

Select from PLSQL Associative array?

Hi guys, Is it possible to use SELECT FROM when using an associative array? I'm passing an array to a stored procedure through a .NET application, and I wanna be able to use that array as a condition when selecting from another table. Lets say I'm passing an array of IDs to the procedure, I wanna be able to do this: select * from ...

Update Apex Tabular form with PLSQL

Hi All: How can I update an Apex Tabular Form with pl/sql instead of using a multi-row update(MRU), is it even possible? Thanks in advance. ...

a really basic implementation for hibernate calls plsql function

hi, i really need a basic hibernate implementation calls oracle plsql function. it must include configurations, dao and test class. is there any example for that? ...

Change varchar data type to Number in Oracle

I have data like this in oracle database -> 20123,45 ,data type is varchar. and I want to migrate it to column with NUMBER data type, change comma (,) to dot (.). so expected result is 20123.45 and data type is NUMBER, how can I do that ? thanks before :D ...

How can I write a procedure to find a set of rows like this?

Sorry about the rubbish question title. I have a table SET_DEFINITIONS like this: SETKEY NOT NULL NUMBER(38) SETENTRY NOT NULL NUMBER(38) where the idea is that the rows define sets of numbers. For example the table could contain rows: 1 2 1 4 2 1 2 2 which would mean set 1 is {2,4} and set 2 is {1,2}. I want to wr...

PL/SQL - How to create a conditional cursor?

Hi, I need to have a conditional cursor, like: If a row exists (using WHEN EXISTS or something like this), then my cursor is: CURSOR varCursor IS SELECT 1 a FROM DUAL; Else CURSOR varCursor IS SELECT 2 a FROM DUAL; But look, I don't want to change a column result, I want to change the entire cursor. Bellow I put a bigger examp...

ORACLE PL/SQL: Functions and Optional Parameters, How?

I'm looking for the optimal way to create a function that can accept no parameters and return all results, but also accepts parameters and return those results. The standard I've been dealing with at my job is this: FUNCTION get_records ( i_code IN records.code%type := NULL, i_type ...

How to perform string concatenation in PL/SQL?

I have a variable defined as define dbs '&1' Suppose I pass database1 as an argument. Then the statement is interpreted as define dbs database1 I want to append single quotes around the string, ie I want it to be interpreted as define dbs 'database1' How should I do this? ...

Get Installation Sequence of Oracle Objects

Ok, I have a complex recursion problem. I want to get a dependecy installation sequence of all of my objcts (all_objects table) in my Oracle 11g database. First I have created a view holding all dependencies create or replace view REALLY_ALL_DEPENDENCIES as select * from ALL_DEPENDENCIES union select owner, index_name, 'INDEX', ta...

Where to find PL/SQL injection checking library/code

I would like to know whether anyone knows about a library or code that will accept a PL/SQL string and thow error if there is any PL/SQL injection. Most of the open source projects in the internet are created in PHP. ...

best place/ book to learn sql .pl/sql database programming?

I am not new to programming, but when it comes to databases, my concepts are messed up. I would like to know how to program in databases.. I am not sure which book to refer to ..and also I have to consolidate my concepts in databases. Any resource with good images, on joins, normalization would be of great help Is there any resource/ bo...

Is it possible to extract ddl of a package without package body

I am using dbms_metadata.get_ddl function. I extract ddl of package and package body seperate and use them separately, so i dont need PACKAGE BODY's ddl when i ask for PACKAGE ddl. However get_ddl('PACKAGE',some_package) returns PACKAGE and PACKAGE BODY's ddls together. Is there a parameter to set, or anything else to make this possible....

Problem with Execute immedite

Hi All, I am trying to run this code below using Execute Immediate but its not working and values are correct. Please suggest the correct code. declare v_count number:=1; v_conc_name varchar2(400); v_val VARCHAR2(20):='vineet'; BEGIN v_conc_name:='INT_AP_PAY_CONV'; EXECUTE IMMEDIATE 'UPDATE xxx_cnc_prg_details SET ...

Is it possible to join strings in PL/SQL procedure in my sql statement

As the title suggests, I would like to know if it is possible to join the string in a select statement within a PL/SQL procedure. For example, I have something like this SELECT FCS.CATEGORY, FCS.NUMBERS, FCS.POINTS WHERE FCS.OBJECT = 'T' AND FCS.THIS_DB & strSelectedDB & So, is it possible to do something like...

stored procedure in oracle.

How to use array( Varray) in store procedure. Actually,i have make a stored procedure from which i retrieve a list of elements. For example: create or replace procedure GetTargetFields ( fileformat in varchar2, filefields out Vrray(4) ) IS BEGIN SELECT id INTO filefields FROM ...

How can I debug the value of a PL/SQL collection in Oracle ?

I'm debugging a procedure which ... returns certain values. The procedure seems to use DBMS_SQL.DESCRIBE_COLUMNS2 which was, till now unknown to me. One of the out variables of the DBMS_SQL.DESCRIBE_COLUMNS2 procedure is a collection, and I want to examine that value is being returned into that - how can I observe/watch/examine this va...

Oracle show all employees with greater than average salary of their department.

I am writing a query to find employees who earn greater than the average salary within their department. I need to display the employee ID, salary, department id, and average salary of that department. I have a query that just almost works but it keeps giving me "ORA-00904: "AVG_SAL": invalid identifier" errors. Am I doing this correctl...

plsql query return result into single row as concat

select col1 from tablename returns 2 rows, i want to concat thse two rows data into single column as comma separated. ...

How to write a function with Oracle regexp to test a domaine name ?

I would like to write a PLSQL function that returns true if the domain name I pass is valid. I should use regular expression, but I don't know how to do this. declare ignore boolean; begin isDomainSyntaxOk('www.laclasse.com'); --> should return true. isDomainSyntaxOk('www.la classe.com'); --> should return false because ...

Quoting identifiers for dynamic SQL in PL/SQL

Is there a PL/SQL function or general technique to quote unqualified identifiers (e.g., mytable) for use in a dynamically constructed SQL query? How about partially or fully qualified identifiers (a.b@c)? Consider this contrived example: CREATE PROCEDURE by_the_numbers(COL_NAME VARCHAR, INTVAL INTEGER) IS ... BEGIN -- COL_NAME is ...