Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
creating dynamic LOV from a table containing multiple columns

I have a table (A) with multiple columns and want to create a LOV to be used for other table (B).
ColumnS in Tabel (A=CURRICULUM) are: CURRICULUM_ID, SUBJECT_ID, GRADE_ID, DOMAIN_ID, CATEGORY_ID, STANDARD_CODE, STANADARD_STATEMENT, LEARNING_TARGETS.
My query is as below:
SELECT CURRICULUM_ID CI, STANDARD_CODE SC FROM CURRICULUM
WHERE
SUBJECT=:P48_SUBJECT_ID
AND GRADE_ID=:P48_GRADE_ID
AND DOMAIN_ID=:P48_DOMAIN_ID
AND CATEGORY_ID=:P48_CATEGORY_ID
Its working fine if I use one parameter. but If I use more than one parameter its not working for me. Anyone please elaborate and thanks in advance.
Best Answer
-
Is the SQL query generated by the GUI editor. If not, best to generate with the Query editor as additional features are available such as :
When you want the value to be supplied to a SQL
WHERE
clause using a bind variable in the clause, select the Required checkbox. This ensures that a runtime exception will be thrown if the value is not supplied.To add a named bind variable to a view object, use the Query page of the overview editor for the view object. You can define as many bind variables as you need.
To define a named bind variable:
In the Application Navigator, double-click the view object.
In the overview editor, click the Query navigation tab.
In the Query page, expand the Bind Variables section and click the Create new bind variable button.
In the Bind Variable dialog, enter the name and data type for the new bind variable.
Because the bind variables share the same namespace as view object attributes, specify names that don't conflict with existing view object attribute names. As with view objects attributes, by convention bind variable names are created with an initial capital letter, but you can rename it as desired.
https://docs.oracle.com/cd/E14571_01/web.1111/b31974/bcquerying.htm#ADFFD297
Answers
-
Is the SQL query generated by the GUI editor. If not, best to generate with the Query editor as additional features are available such as :
When you want the value to be supplied to a SQL
WHERE
clause using a bind variable in the clause, select the Required checkbox. This ensures that a runtime exception will be thrown if the value is not supplied.To add a named bind variable to a view object, use the Query page of the overview editor for the view object. You can define as many bind variables as you need.
To define a named bind variable:
In the Application Navigator, double-click the view object.
In the overview editor, click the Query navigation tab.
In the Query page, expand the Bind Variables section and click the Create new bind variable button.
In the Bind Variable dialog, enter the name and data type for the new bind variable.
Because the bind variables share the same namespace as view object attributes, specify names that don't conflict with existing view object attribute names. As with view objects attributes, by convention bind variable names are created with an initial capital letter, but you can rename it as desired.
https://docs.oracle.com/cd/E14571_01/web.1111/b31974/bcquerying.htm#ADFFD297
-
Hi, Thanks for the brief response. Your response taught me a lot more than I anticipated. Now I have an issue almost similar kindly respond with details.
I have a form with more than seven items on it. they are SUBJECT_ID,GRADE_ID,DOMAIN_ID, CATEGORY_ID, STANDARD_CODE, STANADARD_STATEMENT, LEARNING_TARGETS.
I want these items (SUBJECT_ID,GRADE_ID,DOMAIN_ID, CATEGORY_ID, STANDARD_CODE) type to be select list. additionally, I want to make LOVs for each of these items.
- LOV for SUBJECT_ID: I am making this LOV using a table(SUBJECTS) having TWO columns. MY query is (SELECT SUBJECT_ID, SUBJECT_NAME FROM SUBJECTS) It's working fine.
- LOV for GRADE_ID: I am making this LOV using a table(GRADES) having TWO columns. MY query is (SELECT GRADE_ID, GRADE_NAME FROM GRADES) It's working fine.
- LOV for DOMAIN_ID: I am making this LOV using a table(DOMAIN) having TRHEE columns. MY query is (SELECT DOMAIN_ID, DOMAIN_NAME FROM DOMAIN WHERE SUBJECT=:P48_SUBJECT_ID). It's working fine.
- LOV for CATEGORY_ID: I am making this LOV using a table(CATEGORIES) having FOUR columns. MY query is (SELECT CATEGORY_ID, CATEGORY_NAME FROM CATEGORIES WHERE DOMAIN=:P4.8_DOMAIN_ID) It's working fine.
- LOV for STANDARD_CODE: I am making this LOV using a table(CURRICULUM) having MORE THAN EIGHT columns. MY query is (SELECT CURRICULUM_ID CI, STANDARD_CODE SC FROM CURRICULUM WHERE SUBJECT=:P48_SUBJECT_ID AND GRADE_ID=:P48_GRADE_ID AND DOMAIN_ID=:P48_DOMAIN_ID AND CATEGORY_ID=:P48_CATEGORY_ID). It's not working for me.
Kindly tell me how I can correct the 5th LOV. Thanks
-
Does the GUI Query Editor not have a provision for multiple bind variables? If not, likely multiple bind variables are not supported. But most like are supported and the Query Editor could add them.
-
Issue resolved, Thanks for the response
-
thanks for update