I have a LOV with two columns one is code and the other is description. I know that text items have a property which says validate from list however my code field and description field are display items. We do not want to force the user to click on a button to show the LOV. In the pre-form trigger i am setting a default value in the code field.
I would like to get/resolve the code to its description from the list without having to do a select from the database. Does anyone know of a way to get this done?
I have had also this very same problem. There might not be a solution to retrieve the label column from record group in the runtime.
But you could do this:
Store the record group query somewhere (package header or DB column).
Populate your record group with query in the runtime.
Create DB function which takes query and key value as parameters. The function would then return description of the key value (use dynamic SQL, execute immediate / dbms_sql).
Use the function in the POST-QUERY trigger:
:block.item_description := your_new_function(l_query, :block.item_value);
Related
I have a form and I a dropdown pop-list with year values in it(year field is not a primary key).
I have to fill all other field values when i select a year from dropdown(need to execute query of data block).
how can i achieve this.
If that dropdown list is part of the data block (it doesn't matter whether it is or is not a primary key), then
navigate to that block
enter query mode
select year
execute query
If dropdown belongs to another (control?) block, then
in Forms Builder, open data block year field's property palette and set "Copy value from item" property to CTRL_BLOCK.YEAR
alternatively, create a data block-level pre-query trigger:
:data_block_name.year := :control_block.year;
create a button (in control block)
create a when-button-pressed trigger which will
go_block('data_block_name');
execute query;
run the form
select year
push the button
Very noob question, but how can I create a form in APEX that is not based on a database table?
For example, I am looking to create a "Change Password" form that consists of 3 fields:
USERNAME (display only, value populated with &APP_USER. from URL)
NEW_PSWD
CONFIRM_PSWD
None of these fields will be saved to the database, so not sure how to handle the SOURCE for the underlying form. My first thought was to just use a SQL statement like this:
SELECT '' as username,
'' as new_pswd,
'' as confirm_pswd
FROM DUAL;
Is there a better / more APEX way to handle this?
UPDATE: I understand how to set up a process to handle the logic, but more asking what should I select for the SOURCE? It "yells" at me if I select a TYPE (TABLE/VIEW, SQL QUERY, PLSQL FUNCTION BODY...) and do not put something in there.
Thanks in advance.
Don't use "Form" page type. Pick "Blank" instead.
Then
create a region on it
put any number of items (3 in your case)
create a button
create a process which will fire when you press that button
it should do "smart" things in the database - insert user into a table, change their password, whatever you plan to do
I was wondering how does ORACLE APEX identify if a certain page item value should go as number or varchar2 when used in stored procedure call.
my_pkg.proc1(P1 =>:P2_ITEM1);
Here, how does APEX engine identify if the parameter P1 for proc1 is expecting a number or varchar2 or date.
To extend:
I have a grid. With query as below
Select * from table(my_pkg.pipe_func(:P2_PARAM1,:P2_PARAM2));
When user clicks a button I need to get the current session state value of these bind substitutions and I want to store above select query in a table as
Select * from table(my_pkg.pipe_func('ParamVal',256));
How can this be achieved?
It's the Oracle database that does this grunt work, in the same way it's done it for years. You can see this in the v$sqlarea.
And you should explicity convert these bind variables, as they will be inheretly treated as a varchar - same as they're stored.
where id = to_number(:p1_id)
And from an APEX perspective, if the user changes a value on screen, and you invoke a dynamic action to refresh a region using those items - you should list them in the 'Page items to submit' attribute, just under the region SQL. This will ensure the database session state is updated with what's in the browser, before conducting the refresh.
I use Crystal report 2011 to create report from with data from Oracle database. I have a Allow multi values parameter name userid (userid is string).
I want to query
Select ... from table where userid in {?userid};
I try {?userid}, ({?userid}), '{?userid}' ... but it's not working.
what should I do?
Put the cursor on the place where you want it, and double click on the parameter.
I Have problem in update one of my datablock textitem.
the problem will raise up because I use where condition for my datablock,and after I load the data block, I try to get new value to my text item,but after I put value there is no change...
I dont know how I can change a text item database value when my block has where condition.(the problem is it replace the value with database value.
I use oracle 6i.
When you execute a query in a block, Oracle Forms first clears the block before it populates it with the data retrieved from the database.
If you want to change what is shown in the database item after the query is done, you would normally add code to the POST-QUERY trigger on the block. This trigger fires once for each record retrieved from the database.