Tag Info

New answers tagged

0

Take a look here - point 2 here (recipes for disaster), 2. We will check data integrity at the application level instead of taking advantage of Oracle's constraint checking abilities. Jonathan Lewis is the man for Oracle and indexes. If I were you, I would do something like (works in MySQL and PostgreSQL, don't have Oracle up and running at the moment). ...


2

I like to use rownum. Using a CTE to get the current maximum PK value, you can easily double-up your data. Example below. Test table: create table yourperftest ( pk number, col1 number, col2 number, col3 number ); Test data: insert into yourperftest values (1,1,1,1); insert into yourperftest values (2,2,2,2); insert into yourperftest values ...


0

In case of a Nested-Table (i.e. without INDEX BY BINARY_INTEGER) you can also use CARDINALITY V_COUNT := CARDINALITY(MY_ARRAY); Important difference: In case of Nested-Table which is NULL, COUNT raises an exception, CARDINALITY returns NULL.


0

I came up with a solution for your data set based on some work that I was doing and some modifications to the solution posted by Serge Rielau and Rick Swagerman on IBM's developerWorks (https://www.ibm.com/developerworks/community/blogs/SQLTips4DB2LUW/entry/how_to_split_a_string_into_a_set_of_rows_anti_listagg12?lang=en). Data Setup queries: DECLARE GLOBAL ...


0

In your SELECT, change each IF to [DECODE][1]. Then you can change the = in DECODE's first expression to a comma, and it will work the same as MySQL's IF. e.g., MAX(DECODE(aot.name, 'Primary Owner', asu.userid, 'NO')) I think you'll also need to add a.name to your GROUP BY.



Top 50 recent answers are included