Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle Apex - virtual column error raised

KatReedAug 27 2018 — edited Aug 28 2018

I am currently working in Oracle Application Express 18.1.0.00.45 and I am getting an error that I do not understand.

I created an interactive grid using the following query:

select periodic_topics_id, filter, topic, CASE WHEN LINK1 like '%116%' then LINK1||:APP_SESSION ELSE LINK1 END AS LINK1 From periodic_topics where meeting like :P31_MEETING_DESC and (nvl(:P31_FILTER,'0') = '0' or instr(:P31_FILTER||':',filter||':') > 0) 

In the table in the database, the periodic_topics_id column is the primary key and it is automatically populated when a new row is added to the table using the following trigger:

create or replace TRIGGER periodic_topics_trigger BEFORE INSERT ON periodic_topics FOR EACH ROW BEGIN :new.periodic_topics_id := periodic_topics_seq.nextval; END;

In the APEX application, link1 is a textfield and in the "Link" section of this column's properties, the "Target" is of type URL and the URL is &LINK1. I also indicated in the APEX application that periodic_topics_id is the primary key. These are the properties of the link column that I am referring to:

pic.png

The problem: when I manually insert a value into a cell in the "LINK1" column of the interactive grid, an error is raised that says:

"•Ajax call returned server error ORA-20987: APEX - Process 'Periodic Topics - Save Interactive Grid Data' raised 'ORA-01733: virtual column not allowed here' while executing a DML command. This error can occur if a column is based on an aggregation or SQL expression. Set column attribute 'Query Only' to Yes to exclude the column from the INSERT and UPDATE statement. - Contact your application administrator. for ."

However, if I create the interactive grid using the same query but without the case statement, then I have no problem adding a link in the interactive grid. No error occurs. In other words, no error occurs when I try to add a value to the "Link1" column in the interactive grid if I create the interactive grid using the following query:

select periodic_topics_id, filter, topic, link1 From periodic_topics where meeting like :P31_MEETING_DESC and (nvl(:P31_FILTER,'0') = '0' or instr(:P31_FILTER||':',filter||':') > 0)

Just FYI, I need the query to have the case statement because some of the links will direct the user to external websites and others will direct the user to another page in the application. Without the case statement concatenating :APP_SESSION to the link, the user is forced to log back in to the application whenever they click on a link that directs them to another page in the application.

Does anyone know why the error would occur when the case statement is in the query but not when the case statement isn't in the query?

Thank you in advance.

This post has been answered by fac586 on Aug 28 2018
Jump to Answer

Comments

Hoek

Just use the search box on the upper left on this page: Oracle Database Online Documentation 11g Release 2 (11.2)

Frank Kulash

Hi,

Post your answers, and specific questions about them.  (For example, if you're not sure what the question means, or how to find the answer, or if your answer really applies to all situations).

Let's take the last question you posted, for example:
"39. how many hints are there provided by oracle?"

You might wonder if they really expect an exact number, or if an approximation is good enough.  You might not know which manual contains the answer, or what keyword(s) to look up in the index to find the answer.

SomeoneElse

> please give me the answers for all.

You're kidding, right?


Chris Hunt
Please give me the answers for all.

Sure. Please give me all the money you get from the job, since it's me that'll be answering all the interview questions.

SomeoneElse

Actually, if I were to present these questions to a potential candidate the answer I'd want to hear is "wow, what a bunch of shitty questions".


Frank Kulash

Hi,

SomeoneElse wrote:

Actually, if I were to present these questions to a potential candidate the answer I'd want to hear is "wow, what a bunch of shitty questions".

Not entirely.

Some certainly are poor questions. Some require clarification; they might have meant something reasonable.

Some aren't bad interview questions.  For example:

"6. what is mutating table error? how can you solve that problem?"

I think this question is okay.  It is a common enough problem; and there are different ways (some good, some terrible) to deal with the problem.  How the candidate answers this question can tell you a lot about the candidate's experience and intelligence.

Hoek

Yup, most of those questions are outdated, from the previous century, or badly phrased....now "shall we create a table in the procedure"?

Mike Kutz

SomeoneElse

I partly agree with you, but I'd be more interested in hearing the person's reason on why they are bad questions.

On the other hand, if a person with zero(0) knowledge asks the questions, the local guru can then judge the candidate's capability of communicating Oracle concepts (to others) based on how much the interviewee has learned.

In that sense, the questions are perfect.

(except some of the syntax related ones)

MK

bandarupalli

yes these bunch of shitty questions are been asked by the interviewers....

because people like me are kids and people like you are dinosaurs in sql,pl/sql i thought...

but this is the platform which is connecting masters like you and learners like me so i'm requesting you to get answered ....

please help us .. if you can...

thanks in advance

SomeoneElse

>  learners like me so i'm requesting you to get answered ....

OK, but are you really interested in learning or just memorizing some answers to get through the next interview?

EdStevens

Where did you get this list?

A good interviewer doesn't necessarily ask questions as if it is a multiple choice or true/false test, but rather to see how the interviewee handles the question ... they aren't looking to see if you have a memorized answer but rather to evaluate how you go about solving a problem or if you are at least familiar with the resources available to help solve a problem.  I've even been known to pose a question that implies/assumes a falsehood, specifically to see if the candidate could catch it or if they would try to blow smoke.

It should be perfectly acceptable to respond with "that is a detail I can look up in <name the manual> when needed."

=================================================

Learning how to look things up in the documentation is time well spent investing in your career.  To that end, you should drop everything else you are doing and do the following:

Go to  docs.oracle.com.

Locate the link for your Oracle product and version, and click on it.

You are now at the entire documentation set for your selected Oracle product and version.

BOOKMARK THAT LOCATION

Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab (for 10.x) or the "Master Book List" link (for 11.x) you will find the complete documentation library.

Spend a few minutes just getting familiar with what kind of documentation is available there by simply browsing the titles under the "Books" tab.

Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what kind of information is available there.

Do the same with the SQL Reference Manual.

Do the same with the Utilities manual.

You don't have to read the above in depth.  They are reference manuals.  Just get familiar with what is there to be referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.

Then set yourself a plan to dig deeper.

- *Read a chapter a day from the Concepts Manual*.

- Take a look in your alert log.  One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.

- Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.

- *When you have finished reading the Concepts Manual, do it again*.

Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.

=================================

bandarupalli

i wanna know them not answers but the concepts ....

reading some hundreds of pages is different to get explained..

i thought it was the right platform to learn, it is not big deal of interview but they are not getting satisfied with my answers because i have to learn something else not from books...

thats why i put almost all questions( even silly ones)

Thankyou

Frank Kulash

Hi,

This forum is a great place for people to ask questions and get them answered.  That doesn't mean it's the best place to get all questions answered.  Forums like this work best for specific, focused questions.  I gave some examples earlier of some specific, focused things you might ask about those interview questions.  "Answer these 39 questions." isn't a specific, focused question.   For one thing, it invites answers that cover things you already know, and don't help with what you need to learn.  Some examples of specific focused questions that can help you learn are:

  • "When they ask ... do they mean ... or do they mean  ...?"
  • "For this interview question ...is this a good answer: ...?  I'm not confident about ..."
  • "How would I find the answer to ...?  What buzzwords whould I look for?"
  • "For this interview question ... I looked up ... where it says...  Is that right?  It seems wrong to me because ..."
  • "Why would they ask something like ... on an interview?  Are they looking for an aswere such as ...?"
  • "Where can I learn more about ...?  I tried ... but ..."

Most people who answer questions on this forum are interested in helping you learn.  "If you give a man he fish, he will eat for a single day.  If you show him how to fish, he may eat for a lifetime."  Many people whould add "If you beat him over the head with a fish, he'll quit asking you for handouts."

Billy Verreynne

bandarupalli wrote:

yes these bunch of shitty questions are been asked by the interviewers....

because people like me are kids and people like you are dinosaurs in sql,pl/sql i thought...

but this is the platform which is connecting masters like you and learners like me so i'm requesting you to get answered ....

please help us .. if you can...

thanks in advance

The questions are shitty because.. well they are. They do not measure PL/SQL or Oracle expertise in any way. Here's my answers to a few of these interview questions.

5. what is the third parameter of the raise_application_error()?

Look it up in the fricken manual idiot. Besides. not wrapping a system call like that in an application wrapper is the problem.

6. what is mutating table error? how can you solve that problem?

The problem is solved by putting brain in gear before doing a physical database design of the logical data model, instead of using triggers as sticky tape to glue cr@p together.

27. shall we create a table in the package?

Yes we can - as all packages are not application interfaces and an API can be a system level API and deal with data management. There are no such rule of "Thou shalt not use DDL in PL/SQL", except for in the mind of the ignorant.

And this is why the questions are shitty. It pretend to measure expertise, but are horribly flawed as these questions are based on assumptions and exceptions, and presuppositions, with a poor understanding of what technical expertise is, and a very limited understanding of actual Oracle technologies.

In other words, these are random interview questions pulled from blogs about Oracle and Oracle related problems - and not even good blogs... (never mind using the fricken Concepts Guide to probe the understanding of the person being interviewed of Oracle fundamentals).

I would not take kindly to being asked such questions in an interview.

BluShadow

Billy, you're hired!

Billy Verreynne

The single most critical question - what is the availability of filter coffee at workplace like? And if not 99.9999% during the hours of 6AM to 4PM, then no thanks.

BluShadow

Each department has it's own kitchen so you can make whatever drinks you like for yourself.

Plus the canteen has a Costa (lotta) Coffee facility. 

Me personally, I'm not a coffee drinker. 

1 - 17
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 25 2018
Added on Aug 27 2018
7 comments
10,635 views