How create tabular form using dynamic sql
I have 50 tables and I need create application for support all these tables, I don't want to create 50 tubular regions.
I want create list of tables; user pick one of them and I want generate dynamic tabular form for suppot.
Is it possible?
Thanks Mary
Hi Mary,
It is possible, but you would have to control everything manually. Have a look at: [http://apex.oracle.com/pls/otn/f?p=33642:252] - I've included instructions explaining how this has been created
Andy
Similar Messages
-
Creating tabular form using SQL query
Hi,
I need to create a tabular form using an SQL query so that multiple rows of a table are displayed on screen and are editable to the user.
I have created this sort of form before using the Tabular Form wizard however for this form I need to enter SQL to produce it.
The steps I take are:
1. Create Page
2. Page with Component
3. Form
4. Fow on a SQL query
5. For the query I have: 'select * from depot_master_customer'
However when I view the page, it just displays one blank field with the title '*' !!
I am doing something completely wrong here? It seems like it should be a simple thing to do.
Any help appreciated, this one is driving me mad.
Thanks
SimonSimon,
You will need to manually create the tabular form and DML process. This is covered in detail in the How To document shown below:
http://www.oracle.com/technology/products/database/htmldb/howtos/tabular_form.html
Have you tried this yet?
Good luck!
Emilio. -
Query for create manual tabular form using apex collection using item textfield with autocomplete
can we create a manual tabular form inside item textfield with autocomplete ?
how it is possible?
with Apex_item API used for this item.
i used this code for creat cascading select list
select seq_id,
APEX_ITEM.SELECT_LIST_FROM_QUERY(
p_idx => 1,
p_value => c001,
p_query => 'SELECT C001 D
, C002 R
FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = ''col1''',
p_attributes => 'style="width:150px" onchange="f__name(this,parseInt(#ROWNUM#));"',
p_show_null => 'Yes',
p_null_value => null,
p_null_text => '- Select name -',
p_item_id => 'f01_'|| LPAD (ROWNUM, 4, '0'),
p_item_label => 'Label for f01_#ROWNUM#',
p_show_extra => 'NO') name,
APEX_ITEM.SELECT_LIST_FROM_QUERY(
p_idx => 2,
p_value => c002,
p_query => ' SELECT null d, null r FROM dual WHERE 1 = 2
p_attributes => 'style="width:150px"',
p_show_null => 'Yes',
p_null_value => null,
p_null_text => '- Select name -',
p_item_id => 'f02_'|| LPAD (ROWNUM, 4, '0'),
p_item_label => 'Label for f02_#ROWNUM#',
p_show_extra => 'NO')name2,
from apex_collections
where
collection_name = 'COLLECTION1'
It is fine .
but i want item in tabular form textfield with autocomplete and remove select list. my requirement is using textfield with autocomplete select a employee name and second item textfield with autocomplete display dependent perticular employee related multiple task.
how it is created.i have no idea related textfield with autocomplete.Please help me....pt_user1
I understand that the add row button is currently doing a submit.
To not submit the page you need a dynamic action on the page.
Does the javascript function addRow do what you want?
Otherwise have a look at the following two threads Add row in manual tabular form using dynamic action and Accessing Tabular Form & Add Elements to Collection without Page Submit.
You're process could be something like:
Add the new values to the collection using the idea's in the second thread and at the same time add the new row.
And as second action refresh your tabular form.
If you get stuck set up what you have done on apex.oracle.com using the tables from the demo application.
Nicolette -
How to create a MD form using dynamic page ?
Rahul and Sharmila,
You have answered several of my queries earlier and I am thankful for them.
I have been trying to creating a MD form using dynamic page and I haven't fiqured it out. I need help. You both advised me on creating a simple form using dynamic page. The complexity changes drastically when I have to create a MD form. Has no body ever tried to create a MD form with dynamic page?
I haven't heard from you anything either. I am stuck with this and I need help urgently. Would you kindly tell me if this is possible and how ? Otherwise, I will stop crying for help on this.
Thanks for your kind attention.
MainakHi,
I have replied to this in the morning.
Re: Oracle portal and JSR 168 compliance
Hope it helps.
Thanks,
Sharmila -
How to create tabular form whithout primary key in table
Hi All,
I have requirement to create a tabular form but the problem is, the table which I am using in the application don't have any Primary key, I am using only one table can't change any thing in table.(i.e can't add any row in table,no change in data model)
How can I create tabular form when primary key is not available.
looking forward for all of your quick responce.
Thanks in advance.
Dikshit Kumar NidhiYou can create a view like
select a.rowid id, a.*
from table a
and create a tabular form on this view. You can use
the new column ID as Primary key.Did you try to actually do this? I did at
http://htmldb.oracle.com/pls/otn/f?p=24317:159
And when I change something and click Submit, I get an error
Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-01733: virtual column not allowed here, update "VIKASA"."NO_PK_VW" set "ID" = :b1, "I" = :b2, "J" = :b3 where "ID" = :p_pk_col
Thanks -
Does anyone know anything about Dynamic SQL not being available in Forms v. 6.0.8.11.3? I trying to use Dynamic SQL for the first time and am having some difficulty. When I try to put my SQL in a function and run it straight into the database through SQLPlus, it works fine, but when trying to compile the code in Forms Builder (in a library), I get compiler errors. Any help would be appreciated...
Thanks!
VanessaWhen I tried to compile the following code in Forms, the compiler error I got was Encountered the symbol "STMT_STR" when expecting one of the following: select. However, when I run it in SQLPlus, it creates the function without any errors.
FUNCTION my_func
return number
is
TYPE DiaryCurTyp IS REF CURSOR;
cur DiaryCurTyp;
stmt_str VARCHAR2(200);
dmonth NUMBER;
dday NUMBER;
BEGIN
stmt_str := 'SELECT dmonth, dday FROM p2_diary
WHERE dmonth = :1';
OPEN cur FOR stmt_str USING '12';
LOOP
FETCH cur INTO dmonth, dday;
EXIT WHEN cur%NOTFOUND;
-- <process data>
END LOOP;
CLOSE cur;
END; -
Query for create manual tabular form using apex collection add row button functionality
Hello everyone
My requirement is i created a tabular form manually using apex collection but if i click on add row button then previously selected data refreshed and added new row in this form it is fine.but i don't want to refreshed previously selected data and click on add row button then add new row .how it is possible? plz help
Thanks & Regards,
UjwalaUjwala
Instead of starting a new thread with the same question as Query for create manual tabular form using apex collection add row button functionality.
Could you answer the question about what you see while debug the javascript code.
If you don't understand the question or have trouble debug javascript let us know.
Nicolette -
Can anybody please send me a small program on How to Use Dynamic SQL.
How to execute and run give details.
Thanks
nullYou can certainly use the INTO (and USING) clauses of EXECUTE IMMEDIATE to pass in and return data, i.e.
EXECUTE IMMEDIATE sqlStmt
USING variable1, variable2
INTO output1, output2The more complex the statement, however, the more appropriate DBMS_SQL is. DBMS_SQL also has the potential to allow you to use bind variables rather than reparsing the statement many times.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
How to create a counter using Oracle SQL Developer?
Is there any way to create a counter using Oracle SQL Developer to create the below scenario. Meaning it will recorded down the name of user and ID and time and the date they login.
Library portal home statistics shows how many users (outside and within the campus) visit the library portal.
Page Access statistics is recorded on an hourly basis. Users may select the statistics by
yearly (statistics displayed by all months in the selected year)
monthly (statistics displayed by all days in the selected month)
daily (statistics displayed by all hours in the selected day)I'm giving here one basic post - hope this will solve your problem --
SQL>
SQL>
SQL> create table audit_info
2 (
3 usr varchar2(50),
4 log_time timestamp(6)
5 );
Table created.
SQL>
SQL>
SQL> create table err_log
2 (
3 log_cd varchar2(20),
4 log_desc varchar2(500)
5 );
Table created.
SQL>
SQL>
SQL> create or replace procedure ins_err(errcd in varchar2,
2 errnm in varchar2)
3 is
4 pragma autonomous_transaction;
5 begin
6 insert into err_log values(errcd,errnm);
7 commit;
8 end;
9 /
Procedure created.
SQL>
SQL>
SQL> create or replace procedure ins_aud(ud in varchar2,
2 unm in varchar2)
3 is
4 pragma autonomous_transaction;
5 begin
6 insert into audit_info values(ud,unm);
7 commit;
8 exception
9 when others then
10 ins_err(sqlcode,sqlerrm);
11 end;
12 /
Procedure created.
SQL>
SQL>
SQL>
SQL> create or replace trigger log_odsuser1
2 after logon on odsuser1.schema
3 begin
4 ins_aud('ODSUSER1',sysdate);
5 exception
6 when others then
7 ins_err(sqlcode,sqlerrm);
8 end;
9 /
Trigger created.
SQL>
SQL*Plus: Release 9.2.0.1.0 - Production on Tue Jun 12 12:21:09 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
SQL>
SQL>
SQL>
SQL> set serveroutput on
SQL>
SQL>
SQL> select * from audit_info;
USR
LOG_TIME
ODSUSER1
12-JUN-07 12.00.00.00000000 AMHope this will solve your purpose.
Regards.
Satyaki De. -
How to create a function with dynamic sql or any better way to achieve this?
Hello,
I have created below SQL query which works fine however when scalar function created ,it
throws an error "Only functions and extended stored procedures can be executed from within a
function.". In below code First cursor reads all client database names and second cursor
reads client locations.
DECLARE @clientLocation nvarchar(100),@locationClientPath nvarchar(Max);
DECLARE @ItemID int;
SET @locationClientPath = char(0);
SET @ItemID = 67480;
--building dynamic sql to replace database name at runtime
DECLARE @strSQL nvarchar(Max);
DECLARE @DatabaseName nvarchar(100);
DECLARE @localClientPath nvarchar(MAX) ;
Declare databaselist_cursor Cursor for select [DBName] from [DataBase].[dbo].
[tblOrganization]
OPEN databaselist_cursor
FETCH NEXT FROM databaselist_cursor INTO @DatabaseName
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'Processing DATABASE: ' + @DatabaseName;
SET @strSQL = 'DECLARE organizationlist_cursor CURSOR
FOR SELECT '+ @DatabaseName +'.[dbo].[usGetLocationPathByRID]
([LocationRID])
FROM '+ @DatabaseName +'.[dbo].[tblItemLocationDetailOrg] where
ItemId = '+ cast(@ItemID as nvarchar(20)) ;
EXEC sp_executesql @strSQL;
-- Open the cursor
OPEN organizationlist_cursor
SET @localClientPath = '';
-- go through each Location path and return the
FETCH NEXT FROM organizationlist_cursor into @clientLocation
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @localClientPath = @clientLocation;
SELECT @locationClientPath =
@locationClientPath + @clientLocation + ','
FETCH NEXT FROM organizationlist_cursor INTO
@clientLocation
END
PRINT 'current databse client location'+ @localClientPath;
-- Close the Cursor
CLOSE organizationlist_cursor;
DEALLOCATE organizationlist_cursor;
FETCH NEXT FROM databaselist_cursor INTO @DatabaseName
END
CLOSE databaselist_cursor;
DEALLOCATE databaselist_cursor;
-- Trim the last comma from the string
SELECT @locationClientPath = SUBSTRING(@locationClientPath,1,LEN(@locationClientPath)- 1);
PRINT @locationClientPath;
I would like to create above query in function so that return value would be used in
another query select statement and I am using SQL 2005.
I would like to know if there is a way to make this work as a function or any better way
to achieve this?
Thanks,This very simple: We cannot use dynamic SQL from used-defined functions written in T-SQL. This is because you are not permitted do anything in a UDF that could change the database state (as the UDF may be invoked as part of a query). Since you can
do anything from dynamic SQL, including updates, it is obvious why dynamic SQL is not permitted as per the microsoft..
In SQL 2005 and later, we could implement your function as a CLR function. Recall that all data access from the CLR is dynamic SQL. (here you are safe-guarded, so that if you perform an update operation from your function, you will get caught.) A word of warning
though: data access from scalar UDFs can often give performance problems and its not recommended too..
Raju Rasagounder Sr MSSQL DBA
Hi Raju,
Can you help me writing CLR for my above function? I am newbie to SQL CLR programming.
Thanks in advance!
Satya
-
Create Tabular Form wizard - how to add rows to Table / View Owner list?
Create Tabular Form wizard asks to choose "Table / View Owner"
How to add additional schemas/users to this "Table / View Owner" dropdown list?Next step:
I tried to create 2nd application - and it sees and allows to select from schemas I added in previous step.
Then I tried to add 1 more schema - and 2nd application can't see it...
I create 3rd application and select 1st schema (assigned when workspace was created) - and it sees only this one schema
I create 4th application and select another schema (added in previous steps) - and it sees 2 schemas from 4 assigned
what is this?
how to live with it? -
How to create arabic forms using adobe central forms
How to create arabic forms using adobe central forms
Any luck here? I have just a subset of your challenge, i.e., I want to get forms designed in Designer 8.2/Acrobat 9 to work in Reader 7.0.5
Thanks! -
How to create a form using dblink
dear all
I am using Ora11g Xe, i have created a dblink of another database user; now i would like to create a form using apex, would anybody can guide me how to go about it? i have tried with normal procedure of creating a form (using client@cmd ie tablename@dblink name) but it didn't work;
thanks in advance
udayMy first preference wouldn't be to use a DB link as opposed to some APIs on the target database that I can call from the form.
Reason being that there are some things that may best not controlled over a DB link.
However if you have a really simple case and really have to use this method then in theory you could try creating a synonym pointing to the remote DB object and hopefully Apex should treat it the same as a local object.
Warning, I've never tried it :-). -
Select list in a manually created tabular form
I created a select drop down item in a manually created tabular form. When I run the page, it also shows the null value '%'. How do I edit this?
This is the line I am using in the SQL:
htmldb_item.select_list_from_query(34,IN_PGRS_STAT_DSC,'select distinct STAT_DSC, STAT_DSC from PROJECT_STATUS_REF') IN_PGRS_STAT_DSC,And the select list doesn't work. It gives me an error message if I have the form to display one extra empty record and the select list. But even with the select list, if I don't include the extra row, it works properly.
report error:
ORA-06550: line 1, column 13:
PLS-00103: Encountered the symbol "COLLECT" when expecting one of the following:
:= . ( @ % ;
ORA-06550: line 1, column 82:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( , % from
What I also realized is that the drop down shows the value 7. But the table is empty with no records. I have no idea where this number 7 is coming from?
Message was edited by:
user494578
Message was edited by:
user494578 -
How to process validations using PL/SQL function
Hi.
I created a page with a form to process DML operations against a database table. Also created a validation using PL/SQL function that returns a boolean value:
declare
v_dummy varchar2(1)
begin
select 'X'
into v_dummy
from s_customer
where id = :p2_id;
return (TRUE);
exception
when no_data_found then
return (FALSE);
when others
return (TRUE);
end;
In this case i want to send a message to the user indicating that an certain row (the one with :p2_id value) already exists in the database. The piece of code above will do the job. If this function returns true, it means the row is in the DB already.
The problem is that i don´t know what do to or how to tell htmldb that a TRUE value should issue a message or be processed as en error, whilst a FALSE means OK.
How do i tell htmldb what to do?
Suppose must do something with "expression 1" , "expression 2", etc.
Any ideas???Hóla LuÃs,
when you pick the PL/SQL function body returning a boolean, it implicitly means that TRUE means OK, while FALSE means error, always.
In order to associate such error to a given form field, you have to go back to the page definiton / validations and specify the name of the item in the corresponding field.
When you first create the validation rule, this value is not present even if you ask for the error message inline with the field.
The error message text can be specified in the validation definition, if I am not wrong.
When you need to return special error messages, including dynamic content for instance, you can use the Function Returning Error Message type, which reports an error when the string returned by the function is not null. This comes in handy when you want to display an item's code, for example, rather than generic text.
Even in this case, you must go back to the validation and specify the name of the field if you want to see it inline.
Hope it helps,
Flavio
Maybe you are looking for
-
I've noticed some strange behavior in iCal when importing events from Facebook. Sometimes you get an error when importing the .ics file and other times it works just fine. Facebook > (event page) > Export Event > Save To Calendar > Export > eventidna
-
Hullo folks... Basically: I purchased Lana Del Rey's Born To Die *and* the 'Paradise Edition' which has the original Born to Die tracks plus extra special edition tracks. However ITunes store won't let me download all of 'Paradise Edition' because i
-
Non-english characters on certificate ?
I passed the exam successfully registering on the Pearson VUE site, but I had to enter my name without Polish characters. These data were transferred to CertView and now I am waiting for my certificate. Is it ok that I do not have the right character
-
Very slight stuttering on video?
Hi, Yesterday I finally went out and bought myself a Mini 1.83GHZ standard model with no RAM upgrades or the like. So I have connected it via a DVI-HDMI cable to my Samsung TV. Please bear in mind that I bought the Mini purely for my DVD collection.
-
How do I keep the title from the beginning from going on the second page.
Please anyone that can help.