Quantcast
Channel: APEX-AT-WORK by Tobias Arnhold
Viewing all 177 articles
Browse latest View live

A new year promises new possibilities!

$
0
0
The last year was quite successful even so it was a pain in the ass in many ways.
I have been on 3 conferences, made a few blog posts, got member at DOAG #NextGen, I initialized the "APEX Dashboard Competition" and I created a quite complicated example application which creates new solvable business cases for many of you: SVG in APEX.
This wouldn't be possible if I would have been alone. I worked with many different people in the community to get those activities done and I'm thankful for that.

Because I had the luck to talk to so many people I created a new idea regarding my main focus for this year "Getting students and trainees in touch with Oracle technology". This will not be just a simple presentation or some piece of code you create and publish. It is much more complicated and you can't do it alone.

By Kit from Pittsburgh, USA (Grads Absorb the News) [CC BY 2.0 (http://creativecommons.org/licenses/by/2.0)], via Wikimedia Commons

You may even have noticed it: Oracle will invest over 3 billion dollars for better education in the next 3 years. Only in Europe it will be around 1,4 billion. Something they may should have done 5 years ago. Anyway I'm curios if Oracle is just doing some great marketing slogan or if they start seeing the next generation of students as their most important invest after cloud.

In Germany we facing the problem finding new specialists since years. Except for a few companies we (the Oracle community) haven't done so much against it either.
Last year the German community woke up from their winter sleep by founding a new group inside DOAG called "DOAG #NextGen". This group focuses on students using Oracle products (Database, SQL, PL/SQL, APEX and more).

But why do we have the problem to find new students getting interested in Oracle software?
IMHO: Nowadays it is not enough to have a powerful engine and the fact that you can earn good money with it. It needs more to convince students to work with Oracle.

I tried it myself to get more students into Oracle APEX by making the APEX dashboard competition last year. Even so the competition was a success I have failed in my own focused main target: Getting new people interested into APEX.
I had do understand that it is much harder to get in touch with students then I thought. It is definitely not enough to post something in the most known IT event channels (Twitter, Eventbrite, XING, ...). It is actually the hardest and most time taking part to get in touch with them.

Luckily I don't give up so easily. At DOAG #NextGen we are planning a great event for students this year. More info's will follow.

I wish everyone a good start in 2017 and I will write about my next activities regarding students because I know that a lot of you understanding the need for Oracle specialists today, tomorrow and in 10 years.

APEX IR column only exportable for administrators

$
0
0
A few days ago I tweeted about a solution from Martin Giffy D'Souza to hide a specific column from export.


In my case I needed some username columns to be displayed during run-time but only exportable for administrators. The export itself was made with the default APEX CSV export.


Martin solutions was a really good starting point. I just had to add some security checks for the administrator role. And all together was put into a new authorization scheme which I added inside the conditional columns of my Interactive Report.

-- Authorization Scheme Name: ROLE_EXPORT_USERNAME
-- Validate authorization scheme: Once per page view

-- Code:
if pkg_security.has_user_role(:APP_USER,'ADMIN') = true or :REQUEST != 'CSV' then
return true;
else
return false;
end if;



Using APEX_ERROR to manage custom error messages

$
0
0
Sometimes you just feel like you would be a newbie in coding business applications. Luckily it doesn't happen so often anymore. But this time it hit me hard. :)

During an application upgrade on Universal Theme I discovered an ugly workaround to create custom error messages I used in that time.

The old code looked like that:
declare 
retval number;
p_cust_id number;
p_status varchar2(30);
p_upduser varchar2(10);

begin
p_cust_id := :p1_cust_id;
p_status := 0;
p_upduser := :app_user;

retval := cust_apex_pkg.cust_apex_fnc ( p_cust_id, p_status, p_upduser );

if retval = 1 then
apex_application.g_print_success_message := '<span style="color: green;">Order was successfully published.</span>';
elsif retval = 2 then
apex_application.g_print_success_message := '<span style="color: red;">Error: Custom error 1 occurred.</span>';
elsif retval = 3 then
apex_application.g_print_success_message := '<span style="color: red;">Error: Custom error 2 occurred.</span>';
else
apex_application.g_print_success_message := '<span style="color: red;">Error: Unknown error occurred.</span>';
end if;
commit;
end;
As you can see I used the apex_application.g_print_success_message to overwrite the text color. Quite ugly but it worked as expected.
Anyway on Universal Theme it looked not so nice anymore because a "success message" has always a green background color. Putting some red text color above is not the user experience I would prefer.


I searched for about 3 minutes and found a really good article from Jorge Rimblas writing about the APEX_ERROR package. The blog post is from 2013 so this procedure must be available for a while now. What made me feeling like a jerk. The good side is that I now can start again to climb up on the iron throne. :)

The updated code looked like that:

declare 
retval number;
p_cust_id number;
p_status varchar2(30);
p_upduser varchar2(10);

begin
p_cust_id := :p1_cust_id;
p_status := 0;
p_upduser := :app_user;

retval := cust_apex_pkg.cust_apex_fnc ( p_cust_id, p_status, p_upduser );

if retval = 1 then
apex_application.g_print_success_message := 'Order was successfully published.';
elsif retval = 2 then
apex_error.add_error(
p_message => 'Error: Custom error 1 occurred.'
, p_display_location => apex_error.c_inline_in_notification
);
elsif retval = 3 then
apex_error.add_error(
p_message => 'Error: Custom error 2 occurred.'
, p_display_location => apex_error.c_inline_in_notification
);
else
apex_error.add_error(
p_message => 'Error: Unknown error occurred.'
, p_display_location => apex_error.c_inline_in_notification
);
end if;

commit;
end;

Thanks Jorges by blogging and sharing your knowledge.

Run dynamic action from report row and pass multiple variables

$
0
0
Execute a "Dynamic Action" by clicking on a button/link inside a report row is mostly handled by some triggering HTML class.


It actually works in 95% of all cases. But it is not the best way to do it. It is much more effective to execute the "Dynamic Action" with a custom event.

Reason is simple: You don't need to allocate unnecessary elements via a class by jQuery. You execute the "Dynamic Action" in the moment when it is needed. Like calling explicitly a Javascript function.
This matters if you show maybe 500 rows or more on a single page or you handle several dynamic actions in one report.

Running a dynamic action from inside a report is actually an old hat because there are a few guys which have been written about it. Anyway I'm still searching for it every time I need it and some of the code pieces are not up to date anymore. So I will show you the way I handle it today and probably tomorrow, too. :)

First I must thank Jeff Eberhard for his examples about this topic. He really inspired me using the technique in one of my projects where I had to suffer with many rows inside a report.

Blog posts (www.eberapp.com/ords/f?p=BLOG):
Run Dynamic Action from JavaScript
Execute Dynamic Action From Report Column Link
Pass Multiple Values from Report to Dynamic Action

I prefer this way:

1. Set up a "Dynamic Action":
Custom Event: setIemsFromReport
Selection Type: Javascript Expression
Javascript Expression: document



1.1 Now add some action from type: "Execute Javascript Code"
In my example I set up three APEX items with data from my report row.

Code:
apex.item( "P1_DEVICE" ).setValue( this.data.device_name );
apex.item( "P1_IP" ).setValue( this.data.ip );
apex.item( "P1_KOST" ).setValue( this.data.kost );


Info:
As you see the parameters are forwarded with specific variable names. The example came from Matt Nolan. I prefer it mostly because it is exact and it makes it easier to understand (maintainability).

1.2 To get the values into your APEX database session you add one more action from type: "Execute PL/SQL Code":



2. Report column
Inside my report I define a link column which looks like that:

Type:
Link

Target:
javascript:apex.event.trigger(document, 'setIemsFromReport', [{device_name:'#NAME#', ip:'#IP#', kost:'#KOST#'}]);void(0);

Info
apex.event.trigger executes the "Dynamic Action". 
[{...}] defines the variables to forward.
void(0) prevents the browser to do further actions.

Link Text:
<span class="fa fa-edit"></span> 

Link Attributes (not required):
style="font-size:16px;color:#ICON_COLOR#;display:#ICON_DISPLAY#"

Info:
By using some columns with case when clause I'm able to add some custom attributes like hide/show. Example:
  case
    when SUBSTR(DEVICE,1,1) = 'T'
    then 'inline-block'
    else 'none' 
  end as ICON_DISPLAY


That is all you need to hand over attributes from your report row towards one or more APEX items on your page.

Customize your Interactive Report with CSS

$
0
0
A lot of you are using jQuery to customize visual parts of an APEX application. I probably to often do so myself but there is a much more elegant way:   CSS

Nowadays you are able to add different kind of rules into your CSS styles. In this example I will show you how to get into the topic by changing an Interactive Report (IR). In my example I want to change the typical group by visualization.


Before


After


First of all you need to give your IR a unique name or class to identify it properly.
IR > Appearance > CSS Classes: irCustomStyles



Now you need to add the customized CSS code in your page:
Page > CSS > Inline

.irCustomStyles .a-IRR-table td {
border-top: 0 solid #ffffff !important;
}

.irCustomStyles table.a-IRR-table th:first-child.a-IRR-header:not(.a-IRR-header--group) {
background-color: white !important;
}

.irCustomStyles table.a-IRR-table tr:has( .a-IRR-header ) {
border-bottom: medium none white !important;
border-top: medium none white !important;
}

1. Rule: Takes the border from the TD elements away. Standard CSS probably most of you have done like this before. 
2. Rule: This one changes only the first TH element and when they are not referenced with class ".a-IRR-header--group"
3. Rule: The "has"-clause only applies if the result is true. In this case if a class called "a-IRR-header" exists.

Fore more details check those sources:
:not(s) - By Sara Cope
Selecting Parent Elements with CSS and jQuery - by Thoriq Firdaus

An introduction into the APEX 5.1 Layout View

$
0
0
Many of you are still using the old "Component View" but the "Page Designer" introduced in APEX 5 made the developer life much easier.

The top 5 most time saving abilities for me are:
 1. Easy access on all page elements (without any page refresh)
 2. Copy&Paste of items, regions, dynamic actions, ... 
 3. Drag&Drop moving of items and regions
 4. Multi edit of items
 5. Since APEX 5.1: The ability to customize your own personal Page Designer View

The functionality "Layout" introduced in APEX 5 was not in my focus and as I remember I had some issues with it. So I just ignored it.

In APEX 5.1 I started a rerun on it using the "Universal Theme" and I must say it is a real help when you create a complex form page with a lot of page items. It feels different in APEX 5.1 and works almost flawless.

To get in touch with it I prepared a little example for you to help understanding the feature and may get inspired to use it, too.
We start with a page including 16 page items which should be visualized on 3 rows. Some of them are conditional and they are from different types (Text Field, Radio Group, Select List, Textarea).

All items are now displayed one below the other.


What do I aim for in the first step?
1. All items should have the label set to be "above". (Do not use the region template option for that)
2. I want to edit 8 page items split on two rows
3. Items 1-3 per row should be displayed over 2 columns
4. Item size must be adjusted



In between I made a Dynamic Action to make the "detail group" item conditional based on "Organization" if it is null or not.

I did the same for the category selector but I needed some Javascript code to make it right.


Code:
apex.item( "P9_CAT1_NAME_A" ).hide();
apex.item( "P9_CAT1_NAME_B" ).hide();
apex.item( "P9_CAT2_NAME" ).hide();
apex.item( "P9_CAT3_NAME" ).hide();
apex.item( "P9_CAT4_NAME_V1" ).hide();
apex.item( "P9_CAT4_NAME_V2" ).hide();
apex.item( "P9_CAT4_NAME_V3" ).hide();

if ( $v("P9_CATEGORY_SELECTOR") == '1' ) {
apex.item( "P9_CAT1_NAME_A" ).show();
apex.item( "P9_CAT1_NAME_B" ).show();
}
if ( $v("P9_CATEGORY_SELECTOR") == '2' ) {
apex.item( "P9_CAT2_NAME" ).show();
}

if ( $v("P9_CATEGORY_SELECTOR") == '3' ) {
apex.item( "P9_CAT3_NAME" ).show();
}
if ( $v("P9_CATEGORY_SELECTOR") == '4' ) {
apex.item( "P9_CAT4_NAME_V1" ).show();
apex.item( "P9_CAT4_NAME_V2" ).show();
apex.item( "P9_CAT4_NAME_V3" ).show();
}

In my final move I finished the page by adjusting the other items.


The page looked like that:


But as always it could be a little bit better and luckily I used APEX. I just had to make a little change on it:

That's it. Hope you will give the "Layout"-View a chance to proof itself. :)


Info:
In case your Page Designer mentions problems in applying some multi update settings. Just refresh the page and try again.

Interactive Report Download Button only for a certain Authorization Role

$
0
0
The Interactive Report has this great download feature where you can export everything you can see.
Anyway there are circumstances where the customer doesn't want that feature open for everyone.

In APEX you can only choose if you want the download button or not.
Even so APEX can't do it out of the box. There is a way to make your application able to do it.

Since APEX 5 you can't download when the "Download" is disabled. If you try an almost empty page occurs. Ok that means the "Download" functionality must be activated an I have to disable it manually.

You need to focus on three steps:
 1. Add an authorization scheme.
 2. Hide the download button in the front end. (Visualization)
 3. Disable the download functionality in the back end. (Security)

1. Add an authorization scheme
The authorization scheme will handle the rights that only the correct person is allowed to download from the Interactive Report.
I my case I call it "ROLE_DOWNLOAD" and it works like that:
Type: PL/SQL Function Returning Boolean 
Function Body: return security_pkg.has_role(:APP_USER,'ROLE_DOWNLOAD');
Validate: Once per session

2. Hide the download button
Add a static report id


Add a new "Dynamic Action" on "Click".
jQuery Selector: #STATIC_REPORT_ID_actions_button
Event Scope: Dynamic
Security > Authorization: {Not ROLE_DOWNLOAD}



Add some Javascript to remove the button:
$('#STATIC_REPORT_ID_actions_menu .icon-irr-download').parent().parent().parent().remove();

3. Disable the download functionality
When APEX is exporting something from an "Interactive Report" itjust does a simple redirect on the same page and adds a REQUEST for the specific download type. In my case it is the request "CSV" I want to block.

Add a "Branch" executed "Before Header":


And to disable the download I just redirect on the same page without any request. The trick is to add the right PL/SQL Condition. In this example check for the request and the authorization scheme.

Code:
:REQUEST = 'CSV' and APEX_UTIL.PUBLIC_CHECK_AUTHORIZATION('ROLE_DOWNLOAD') = false

 
In my mind this is simple and secure and shows how flexible APEX really is.

JET pie chart in APEX with absolute numbers as data labels

$
0
0
The new APEX pie charts only allows percent values as data labels. Luckily the APEX team added an great example in the "Sample Chart" application which shows how to add custom data labels including absolute values by adding custom JavaScript code.

For German applications I prefer to display 10k (10000) like this: 10.000.
Thanks to APEX and JET it is easy to implement.

function( options ){
    this.donutSliceLabel = function( dataContext ){
        var value_ger;
       
        value_ger = dataContext.value.toLocaleString('de-DE', {
                      minimumFractionDigits: 0
                    });
       
        return value_ger;
    } 
    options.dataLabel = donutSliceLabel;
    return options;
}



Info: Technical updates in the JavaScript area are not supported by APEX updates. For example: A future JET version could have some engine changes which will not accept my JS example anymore.



APEX CONNECT and POUG High Five

$
0
0
Next week the APEX CONNECT 2017 will start. Besides the latest News about Oracle APEX you will have the chance to talk to some of the best developers worldwide.
As I mentioned at the beginning of the year "A new year promises new possibilities!" I'm focusing on students and will hold a presentation about "Next Generation - Erreiche die Mitarbeiter von Morgen".
Besides that I'm always willing to help others so if you have questions don't hesitate to talk to me. I will take the time to listen to your APEX related problem and may be able to help you or guide you a way to success. You know the best thing on conferences is to meet new people.

The other real highlights for me are:
1. Meet the Oracle APEX developers in person.
You need some good APEX related advice then talk to them they wont bite you. :) I'm especially looking forward to talk to Joel Kallman.

2. The hidden jewels besides the keynotes
- APEX / JavaScript / UX / SQL / PLSQL Q&A Panel (Wednesday)
- 1:1 Gespräche - Ask the Oracle Experts (Thursday)

3. Deutsche Bahn is looking for you.
If you searching for a new challenge as an APEX developer and/or project manager then talk to the "Small Solutions" team from Deutsche Bahn. They are searching for more experts and have their own stand at APEX CONNECT.

And after that...



I prepare myself for the most community driven Oracle conference on the planet.

The best known DBA's and developers from all over Europe come to present at the event. They pay for themselves just to be there. Why? It's the common passion which they can't get anywhere else in this concentrated form. I'm happy to be there as well and I will hold the only APEX related presentation. All presentations are held in English. Everyone is welcome to join this amazing event!

DOAG #NextGEN goes POUG

$
0
0
Hallo liebe Oracle Community,

die letzten Wochen und Monate waren etwas sehr hektisch, daher hatte ich auch keine Zeit für Blogposts rund um Oracle und APEX. Der Grund lag in meiner Aktivität in der DOAG #NextGEN Community. Wir als Community planten ein Studenten- und Azubi-Event für Oracle Technologien.

Das Ergebnis ist eine Reise zur POUG nach Krakau.


Mit dabei sind die bekanntesten Oracle Speaker aus ganz Europa.


Und genau dieses Event, das sich so drastisch von allen anderen Oracle Community Events in Europa unterscheidet, möchten wir nutzen, um den Studenten einen Einblick in die DBA- und Development-Community zu geben.

Gemeinsam mit der DOAG haben wir so den POUG Trip: DOAG #NextGEN goes POUG auf die Beine gestellt.


Wir planen, mit einem Bus von Berlin aus nach Krakau zu fahren. Unsere Gruppe wird aus 20 Studenten, Azubis und einigen DOAG Community Mitgliedern bestehen. Aktuell suchen wir noch nach 3-4 Sponsoren, die bei diesem Event mit machen möchten. Es geht darum, einem Studenten oder Auszubildenden diese Reise kostenlos zu ermöglichen, um mit deren Hilfe die Oracle Community auch jüngeren ITlern wieder näher zu bringen. Wir hoffen natürlich auf einen viralen Effekt und wollen rund um das Event so viel Lärm wie möglich machen, damit alle von unserer aktiven Community erfahren.

Ihr habt selbst Studenten / Azubis die im Oracle Umfeld tätig sind? Dann sollen diese sich einfach anmelden, um so die Chance zu erhalten, eine der begehrten Wildcards zu bekommen. Die Konferenz ist international aufgestellt, und fast alle Vorträge werden auf Englisch gehalten.

Ich kenne viele in der Community, die sich auch privat an solch einem Event beteiligen würden, daher mein Vorschlag: Rottet euch zusammen und einer meldet sich dann bei der DOAG als Sponsor an.
Denn wenn jeder einzeln kommt, dann steigt mir die DOAG wahrscheinlich aufs Dach. :)

Ps.: Die Kosten für einen Studenten betragen 600 € (beinhaltet Reise, Hotel, Ticket, Verpflegung).

Bei Fragen steht die DOAG gern bereit, diese zu beantworten: +4970011362438


Danke schon mal vorab für eure Hilfe!

#orclapex Europe tour

$
0
0
From Tuesday, the 29. of August until the 02. September, I will meet the best experts around Oracle.





But first some background:
Last year I was in Sweden and held a presentation at a meetup in Stockholm about APEX. I met Mathias Magnusson an Oracle specialist who is organizing all kinds of Oracle usergroup events in Sweden. I was lucky to meet him again at DOAG 2017 and introduced him to Joel Kallman. During the discussion came the idea to make an APEX day in Sweden. Mathias prepared everything and invited some well-known experts who may join the party as speakers. In the email, he also was asking Heli Helskyaho. She is one of the world most known speaker about Oracle related technology at the moment.
She liked the idea to join in and asked if we could combine it. One event in Helsinki (Finland) and one in Stockholm (Sweden). And that is not all. Mathias put the date of the event shortly before the POUG in Poland. Conclusion: My Oracle #orclapex Europe tour was set up.
Out of my perspective the Nordic APEX days should look like this: 
We need to show the people what APEX can do and how it is used in production. If an Oracle employee or a consultant is talking about how great the tool is then maybe not everyone will believe it. So, I asked the experts from Deutsche Bahn (SmallSolutions-Team) to join the party and they did!

So, this is what happens now:
    1. Monday I will fly to Helsinki with Richard from Deutsche Bahn. Last preparations with Matthias and Richard (SmallSolutions-Team) for the event.
    1. Having the Oracle/Miracle APEX-Day in Helsinki (Finland): Oracle / Miracle APEX - Day
      1. Including nice talks with Heli, Carsten, Shakeeb and hopefully a lot of APEX interested end users.
    1. After the day we will take the cruiser ship over night to Stockholm including some drinks and talks and "Finnish Tango".
    1. Having the SWEOUG APEX day in Stockholm (Sweden): #SweougApex17
      1. Including nice talks with Patrick, Mathias and hopefully a lot of APEX interested end users. Hopefully a couple of beers in the evening.
    1. Next morning take the plain to Berlin and preparing with Matthias (Small Solutions-Team) for POUG
    1. Meet the students at Berlin main station and take the rented bus to POUG in Kraków.
    1. Getting to know the student group including some activities during the bus trip.
    1. Hotel check-in and dinner with the students
    1. POUG conference starts: #POUG17
      1. Including to meet the best Oracle database experts and get the students to meet them and drink a few beers with Kamil.
    1. POUG Party
    1. POUG conference second day
    1. Evening dinner and taking the bus home
Let me say it in short words:
3 conferences, holding 3 presentations, meeting lots of experts and meeting even more new faces!

In case you are curios and want to get to know the flair from the conferences then follow me at Twitter: @tobias_arnhold / #APEXgoesEurope / #pougtrip / #SewougApex17 / #orclapex

I will write as I have never written before. :)

The best Oracle technology week ever - Part 1: Helsinki and Stockholm

$
0
0
You remember my last blogpost describing how my #europeTour would be like:
#orclapex Europe tour 

It was a week with as little sleep as possible. Reasons:
 - traveling
 - just was to excited
 - to much party

It all started in Helsinki with the first Oracle APEX day in Finland.
I reached Helsinki with Richard Rieb around 10 o'clock in the evening. It was dark and cold, our taxi driver spoke 5 words to us but good hard rock music was played on the radio. We knew we have come to the right place.
At the next day we met the organizers (Heli and Marko), the other speakers (Carsten Czarski, Shakeeb Rahman, Matthias Nöll and Mathias Magnussen) and 30 other APEX interested people.
I was happily surprised to meet Matt Nolan from the FOEX crew.
Background story: This guy gave me, in hard times maybe 8 years ago, some good tips and kept my APEX passion alive.
I was even more surprised to meet Jari Lainen which created a really nice APEX example application and has an awesome blog as well. He mentioned to join a new APEX project soon. He will hopefully start writing then again.

The presentations were really good but see for yourselves:











Btw: If you think I do crazy stuff then I always find someone even more devoted like Heli who flew to Soul for the Oracle code conference in between the Finnish APEX event and the POUG in Krakow.

We the other presenters, except Mathias who had to fill the time gaps in between the conferences, took the cruiser ship to Stockholm.


Funny fact: beer at the bar was 6 €, one beer at the tax free shop costs 3,50 € and 24 for of them in a pack costs 20 €. You know what we did.

We enjoyed beers in a stormy night at the railing watching the ocean.
Tip: On a shaky boat just drink 5 beers and feels like you have drunken 10.

In Stockholm we got the perfect location including really tasty food during the first Oracle APEX day in Sweden. 60 participants were listening to our presentation. See for yourselves:










We got great feedback by the customers and enjoyed several nice talks. I even talked to a guy from Denmark who just came to participate at this particular conference. Thanks to the Swedish Oracle Usergroup (SWEOUG) making it possible. My special thanks goes to Daniel and Mathias.

We spent the night by my relatives as Richard discoverd that one of the beers got broken and drenched his backpack. :D Luckily he flew home the day after.

Next Morning at 5 o'clock we (Matthias and me) headed towards the Arlanda airport and took the flight to Berlin.
In Berlin we met the students for the "NextGEN goes POUG trip" (#pougtrip)

In case you want to look at all the tweets from the conference then search for #europeTour, #sweougApex17 or #orclapex.

Next time I will tell you all about the trip to the "POUG 2017". :) Look closely at the DOAG website.

After the party is before the party

$
0
0
Now two months after the #pougtrip everything went back to normal. Except the planning for the next events.

The DOAG #NextGEN is currently starting a "roadshow" at German universities.

Start is the 07.11.2017 at the Trier University of Applied Sciences. We will have 3 presentations covering different technologies: SQL, JS, JSON, SVG, PL/SQL, REST and APEX.
But see for yourself: Oracle Vorträge an der Hochschule Trier


As you can see the agenda is made with APEX :). Inspired by the #pougtrip we plan free beer for all students!

This is our first test run to find out what it takes to get as much students as possible to listen to Oracle related technologies.

From my perspective the question is: What can an Oracle expert contribute to young professionals?

For example: handling real life problems and sharing the experience while using modern technologies. But I think most important is devotion.
You get inspired by an expert mostly depending on how dedicated this person is delivering the information. This event gives us the chance to inspire young professionals to see Oracle in a new light. See the possibilities and feel the devotion by the people who are working with the technology.

BTW: This event wouldn't be possible without two dedicated students. Thanks Rebecca and Abby!

Dynamic LOV with Pipeline function

$
0
0
A new year brought me some new tasks. I had to take over a generic Excel import and the customer wanted some extension by checking if the join on the master tables were successful.

Unfortunate we were talking about a generic solution which meant that all the configuration was saved inside tables including the LOV-tables which were saved as simple select statements.

Goal:
Show all import rows/values which were not fitting towards the master data.

How did I fix it?


Source of LOV data:

Source of import data:


I made a little abstract data model so that you understand what I mean:
I have two tables "I_DATA" including the values from the import and "I_DYNAMIC_SQL" including the LOV statements.

-- ddl
CREATE TABLE "I_DYNAMIC_SQL"
( "ID" NUMBER NOT NULL ENABLE,
"SQL_STATEMENT" VARCHAR2(4000),
CONSTRAINT "I_DYNAMIC_SQL_PK" PRIMARY KEY ("ID")
USING INDEX ENABLE
) ;

CREATE TABLE "I_DATA"
( "ID" NUMBER NOT NULL ENABLE,
"DATA_VALUE" VARCHAR2(1000),
"DYNAMIC_SQL_ID" NUMBER,
"DATA_GROUP" VARCHAR2(20),
CONSTRAINT "I_DATA_PK" PRIMARY KEY ("ID")
USING INDEX ENABLE
) ;

-- data
REM INSERTING into I_DATA
SET DEFINE OFF;
Insert into I_DATA (ID,DATA_VALUE,DYNAMIC_SQL_ID,DATA_GROUP) values (1,'Jonas',1,'G1');
Insert into I_DATA (ID,DATA_VALUE,DYNAMIC_SQL_ID,DATA_GROUP) values (2,'Sven',1,'G2');
Insert into I_DATA (ID,DATA_VALUE,DYNAMIC_SQL_ID,DATA_GROUP) values (3,'Annika',1,'G3');
Insert into I_DATA (ID,DATA_VALUE,DYNAMIC_SQL_ID,DATA_GROUP) values (4,'Jens',1,'G4');
Insert into I_DATA (ID,DATA_VALUE,DYNAMIC_SQL_ID,DATA_GROUP) values (5,'FH Trier',2,'G1');
Insert into I_DATA (ID,DATA_VALUE,DYNAMIC_SQL_ID,DATA_GROUP) values (6,'TH Bingen',2,'G1');
Insert into I_DATA (ID,DATA_VALUE,DYNAMIC_SQL_ID,DATA_GROUP) values (7,'FH Trier',2,'G2');
Insert into I_DATA (ID,DATA_VALUE,DYNAMIC_SQL_ID,DATA_GROUP) values (8,'TH Bingen',2,'G2');
Insert into I_DATA (ID,DATA_VALUE,DYNAMIC_SQL_ID,DATA_GROUP) values (9,'Frankfurt UAS',2,'G3');
Insert into I_DATA (ID,DATA_VALUE,DYNAMIC_SQL_ID,DATA_GROUP) values (10,'TH Bingen',2,'G4');

REM INSERTING into I_DYNAMIC_SQL
SET DEFINE OFF;
Insert into I_DYNAMIC_SQL (ID,SQL_STATEMENT) values (1,'select d,r from (
select ''Jonas'' as d, 1 as r from dual union all
select ''Sven'' as d, 2 as r from dual union all
select ''Jens'' as d, 3 as r from dual union all
select ''Annika'' as d, 4 as r from dual
)');
Insert into I_DYNAMIC_SQL (ID,SQL_STATEMENT) values (2,'select d, r
from (
select ''FH Trier'' as d, 1 as r from dual
union all
select ''TH Bingen'' as d, 2 as r from dual
)');

It actually took some time to find a solution fitting my needs.
1. Fast
2. Easy to understand
3. Not tons of code

What I needed was some kind of EXECUTE IMMEDIATE returning table rows instead of single values. With pipeline functions I was able to do it:
create or replace package i_dynamic_sql_pkg as

/* LOV type */
type rt_dynamic_lov is record ( display_value varchar2(4000), return_value number );

type type_dynamic_lov is table of rt_dynamic_lov;

function get_dynamic_lov (
p_lov_id number
) return type_dynamic_lov pipelined;
end;

create or replace package body i_dynamic_sql_pkg as
/* global variable */
gv_custom_err_message varchar2(4000);

/* Function to return dynamic lov as table */
function get_dynamic_lov (
p_lov_id number
) return type_dynamic_lov pipelined is

row_data rt_dynamic_lov;

type cur_lov is ref cursor;
c_lov cur_lov;

e_statement_exist exception;

v_sql varchar2(4000);
begin

-- 'Exception check - read select statement';
select
max(sql_statement)
into
v_sql
from i_dynamic_sql
where id = p_lov_id;

-- 'Exception check - result';
if v_sql is null
then
gv_custom_err_message := 'Error occured. No list of value found.';
raise e_statement_exist;
end if;

-- 'Loop dynamic SQL statement';
open c_lov for v_sql;
loop
fetch c_lov
into
row_data.display_value,
row_data.return_value;
exit when c_lov%notfound;

pipe row(row_data);
end loop;
close c_lov;

exception
when e_statement_exist then
rollback;
/*
apex_error.add_error(
p_message => gv_custom_err_message
, p_display_location => apex_error.c_inline_in_notification
);
*/
raise_application_error(-20001, gv_custom_err_message);
when others then
raise;
end;
end;

Now I just had to create a SQL statement doing the job for me:
-- ddl
select
da.data_group,
da.data_value,
/* check if a return value exist */
case
when lov.display_value is not null
then 'OK'
else 'ERROR'
end as chk_lov_data_row,
/* apply error check for the whole group */
case
when min(case
when lov.display_value is not null
then 1
else 0
end) over (partition by da.data_group)
= 0
then 'ERROR'
else 'OK'
end as chk_lov_data_group
from i_data da
/* Join on my pipeline function including the dynamic sql id */
left join table(i_dynamic_sql_pkg.get_dynamic_lov(da.dynamic_sql_id)) lov
on (da.data_value = lov.display_value)
order by da.data_group, da.dynamic_sql_id, da.data_value;

Result:

APEX ist anders. Genau das gleiche gilt auch für die APEX Connect!

$
0
0
Es gibt zwei Dinge die ich in über 10 Jahren im Oracle Umfeld immer und immer wieder höre:

1. Die Community wird immer älter.
2. APEX ist aus Grund XY schlecht.

Was hat die APEX Connect damit zu tun?
Die APEX Connect beweist nun zum 4ten Mal, dass eine Community (wie die Technologie selbst) nicht stehenbleiben darf. Ohne die gemeinsame Arbeit an immer wieder neuen Angeboten wäre die Veranstaltung wohl nicht das was sie heute ist.

Deshalb gibt es dieses Jahr erstmals einen eigenen Track für Neueinsteiger, der von einigen DER APEX Experten präsentiert wird. Das bedeutet, Du bekommst als DOAG-Mitglied für 208 € nicht nur einen umfassenden Einstieg in die aktuelle APEX Version, sondern kannst Dir gleichzeitig noch die besten Tipps und Tricks vom Who is Who der Branche abholen.



Dabei ist es egal, ob Du Student, Azubi, ehemaliger DBA, Formsentwickler oder Quereinsteiger bist. Dieser Track ist für alle gleichermaßen perfekt geeignet: APEX for beginners am 24.04.2018


Ein eigener Newcomer-Track bedeutet aber noch viel mehr: Es öffnet die Tore für die neue Generation an APEX-Entwicklern.
Und hier ist die Community gefragt, denn neben den Studentengruppen, die über #NextGEN-Roadshows an den Universitäten bei der Connect teilnehmen, könnt ihr euren Auszubildenden oder Studenten für nur 340 € an allen drei Tagen der Konferenz inklusive Übernachtung und ÖPNV vor Ort teilnehmen lassen.


Wann gab es das schon mal, dass ein Oracle Event für die nächste Generation ein so vollumfängliches Gesamtpaket geliefert hat?
In 10 Jahren als Oracle Experte habe ich noch keines erlebt!

Nun zurück zum Anfang! Ich seh das so:
Die APEX und PL/SQL Community kämpft um die nächste Generation und bietet den kinderleichten Einstieg den es dafür braucht. Dazu gehört Mut, Begeisterung und Voraussicht. Dank dem Einsatz der DOAG, der #NextGEN-Community und den APEX Connect Verantwortlichen ist zumindest im Development-Umfeld der Verjüngungsprozess längst eingetreten.

Warum eine Technologie-Konferenz für einen jungen ITler so wichtig ist, beschreibt Carolin Hagemann:
"Ich selbst habe gerade am Anfang meiner APEX-Zeit als Student an der DOAG K+A teilgenommen. Neben den Erfahrungen persönlich mit den Referenten sprechen zu können (ich habe den "APEX-Raum" betreut) und direkt am Puls der Technologie sein zu können, hat mir gerade diese Zeit auch sehr bei dem Einstieg in die Community geholfen.
Und neben diesen doch eher weichen Faktoren gibt es durchaus auch andere Gründe an den Veranstaltungen teilzunehmen: Ist man erst einmal in dem Sog der APEX-Community gefangen, weiß man von den neusten Releases nur wenige Stunden nach der Veröffentlichung. Man profitiert von den Kontakten und bekommt auch schon einmal 20 Minuten nachdem man einem der APEX-Entwickler eine Frage gestellt hat, eine sehr ausgiebige Antwort ;) Das kann in vielen Situationen ein entscheidender Vorteil sein."

Jetzt seid ihr gefragt und gebt euren Azubis und Studenten die Möglichkeit teilzunehmen oder sponsert eine Wildcard, um ein neues Gesicht in unsere Community zu integrieren. Jeder der sich einmal mit dem APEX Virus infiziert hat, weiß wie schwierig es ist hiervon wieder los zu kommen. Also lasst uns gemeinsam möglichst viele neue Leute infizieren!


---
Danke an Carolin Hagemann und Matthias Nöll für deren wertvollen Input in den Artikel.

---
Links:
Werde Teil der NextGEN Community, dann schreibe einfach eine Mail an nextgen@doag.org

Interactive Report - Column background color

$
0
0
One of my customers needed an IR where half of the report columns should be visualized in another color.


It is really easy to integrate. Go into the report column attributes inside your "Page Designer" and add a "Static ID" for each column:

Column 1: rep_col_diffcolor_1
Column 2: rep_col_diffcolor_2
...


Now add this CSS snippet inside the page attributes:

.a-IRR-table tr td[headers*="rep_col_diffcolor_"]
{
    background-color: #99ccff;
}


The trick is to address every element by searching for the start part of the "Static ID" name.

CREATE or COPY master data pages in APEX

$
0
0
In this blog post I just want to give a hint about the positive and negatives effects when you COPY master data pages for different master data tables.

Example:
You have two tables: DOCUMENT_CATEGORY and ORDER_CATEGORY
Both tables have the same columns :
ID, CATEGORY_NAME, DESCRIPTION
CREATED_ON, CREATED_BY, CHANGED_ON, CHANGED_BY

In APEX you have a Master - Detail view including 2 pages: report view and modal dialog


If you decide to copy both pages you have to adjust the following things:
Master Data Report:
 - Page Name
 - Breadcrumb
 - Navigation Menu
 - Report DDL: Table Name
 - Report Column Link
 - Create Button Link

Modal Dialog:
 - After Header - Automatic Row Fetch (Name, Table Name)
 - Processing - Automatic Row Processing (Name, Table Name)
 - After Processing - Branch
 - APEX Items (in case you have different names or use prefixes)

What is the advantage?
1. Security
Security settings get copied like "Page Authorization Scheme". Master data pages normally apply to only one role, for example: administration
2. Labels and messages get copied (items, buttons). Really helpful if you named them differently to the standard APEX naming.

What is the disadvantage?
1. Linking
If you forget to change the branches/links then you could end up on the wrong page changing the wrong data. But on the other side this is the first thing you check after you finished the editing of the pages.
2. Automatic processing
If you forget to update the table names then you end up changing the wrong data.

Conclusion:
It is a bit more risky to copy master data pages but it can save you a lot of time changing label names and to remember the security settings.

Join the NextGEN group at APEX Connect 18

$
0
0
The #NextGEN community is planning an after conference evening activity. For that reason we published a German article with all details on doag.org. My dear friend Jonas translated the text via deepl.com/translator.

Original article:
Wir sind EINE Community!

Here you go:

------

Young people who are motivated to get involved in conference planning? Yes, that's right!
And these motivated youngsters bring 24 more youngsters far away from the Oracle APEX universe.
Before the "older ones" among us now fall into shock rigidity - stay relaxed, because we need you!

These 24 students have no idea of our special APEX community.
It's up to us to take them along and show them how much fun, passion and action they can expect in APEX everyday life.

How do you recognize the students? 
Long hair, pale skin, no crutch... well, seriously: all students wear orange bracelets.

What do we expect from you?
Talk to the students! Don't just make them feel like they're in the community, but show them what it means to live the APEX community membership.

How do you do it best?
In addition to the conference and community evening on Wednesday, there are other networking opportunities:
For example, anyone interested can meet after the Speaker Reception on Tuesday at Schweinske (Bolkerstr. 28) from 8:30 p.m. in Düsseldorf's Old Town.
On Wednesday, after the official evening event at the Apollo Varieté, a joint visit to Club El Papagayo, which you can find at Mertensgasse 2 (both on a self-payer basis).

A tip: Give the poor students a drink - this will certainly increase their attention to want to know something about APEX! :slightly_smiling_face:

With these requests and advice we hope as NextGEN to bring the young savages together with the established community.

See you at APEX Connect!

Your NextGen team:

Abby, Caro, Rebecca, Davide, Jonas, Matthias, Philipp, Sebastian and Tobias

------

See on Tuesday! =)

Check inside your APEX application if debug mode is enabled

$
0
0
Sounds like a simple task but whenever I have the requirement to add a region and make it conditional to check if APEX is running in debug mode. I always search for half an hour finding the right solution.

Search example on Google: "Oracle APEX check debug mode conditional PL/SQL"
Trying this or 30 different other ways it always ends up with the wrong results.

But it is so easy - Conditional PL/SQL Expression:
APEX_APPLICATION.G_DEBUG

G_DEBUG returns true or false!
The documentation is a bit imprecise because it says 'Yes' or 'No'.

Anyway it is all well documented in the APEX documentation
> APEX_APPLICATION > Global Variables:
https://docs.oracle.com/database/apex-18.1/AEAPI/Global-Variables.htm#AEAPI29544




Working with the APEX tree

$
0
0
Out of a coincidence I haven't used the APEX tree region for years. Now I got the task to create a customizable tree in my application. Since APEX 5 there is a new tree type called "APEX tree" which supports some really cool functions.

Anyway I had to look around to find out what the APEX tree is actually capable of. First of all start with the APEX "Sample Trees" application which you find in the packaged application area.



Morten Braten took that example and described the features really well:
https://ora-00001.blogspot.com/2016/01/working-with-the-apex-5-treeview.html

John Snyders from the APEX team also created 2 blogposts about the "APEX tree":
APEX 5.0 Converting to the new APEX Tree
Add Checkbox Selection to APEX Tree Region

And as he mentioned there is a Javascript library behind it "libraries/apex/widget.treeView.js." which is documented since APEX 18.1 or at least I think it is. Anyway here is a link which I also have to further investigate:
JS Doc: Widget: treeView

German users can read this document provided by MT AG:
http://files.xmasman.de/20160216_MeetupNRW_TillAlbert_WiePflanzeIchEinenBaumApex.pdf
Viewing all 177 articles
Browse latest View live