Help with dynamic checkbox of database results
Hello
I create dynamic checkboxes based on a read to sqlite database. I am able to get the data and the number of boxes is being created, but I'm having a problem populating the labels from the boxes. This is the section of code that gets the results of the database and creates the boxes.
Table of results: var = stmt.getResult () .data;
for each (var obj:Object in the result)
{
var cb:CheckBox = new CheckBox();
CB.label = obj.toString ();
cb.setStyle ("color", 0x00593B);
cb.setStyle ("symbolColor", 0x000000);
container.contentGroup.addElement (cb);
}
Neil
For me, this has been answered on another forum.
The line cb.label = obj.toString ();
needed to be replaced by data.
CB.label = obj.myDatabaseFieldName;
myDatabaseFieldName would be the column you extract data from and should be the actual name of the table.
Neil
Tags: Flex
Similar Questions
-
Dynamic box of database results
Hello
I create dynamic checkboxes based on a read to sqlite database. I am able to get the data and the number of boxes is being created, but I'm having a problem populating the labels from the boxes. This is the section of code that gets the results of the database and creates the boxes.
Table of results: var = stmt.getResult () .data;
for each (var objobject result)
{
var cb:CheckBox = new CheckBox();
CB.label = obj.toString ();
cb.setStyle ("color", 0x00593B);
cb.setStyle ("symbolColor", 0x000000);
container.contentGroup.addElement (cb);
}Neil
Hello
normally, your "obj" is dynamic and must contain a property with the column you want to display from DB in the label of the cb. (I do not this template, so not sure...)
So, you should try:
CB.label = objthe_column_name
If you want a label based on more than 1 column, you can replace the method. toString(), by using a specific class to manage your ValueObject (instead of object).
-
Need help with dynamic Action through 4 items
Hello everyone.
I'm having some trouble trying to comp with dynamic action that will turn on or display a select list item when a value is set for the four elements of the Radio button group.
P1_SELCT_LIST
P1_RADIO_GROUP_1
P1_RADIO_GROUP_2
P1_RADIO_GROUP_3
P1_RADIO_GROUP_4
So once all four Radio groups are not null, I want the select View list item.
Any help with this would be great.
I'm on Apex 4.2.0.00.27
Hello
You can create the following action:
Event: click on
Selection type: jQuery selector
jQuery selector: radio
condition:
$v ('P1_RADIO_GROUP_1')! == ''
&&
$v ('P1_RADIO_GROUP_2')! == ''
&&
$v ('P1_RADIO_GROUP_3')! == ''
&&
$v ('P1_RADIO_GROUP_4')! == ''
Then add a real Action as follows:
ACtion: show
Fires when the result of the event is: true
Fire on the page loading: No. (uncheck)
Assigned to elements, selection type: product (s)
Product (s): P1_SELECT
Also add an Action to false as follows:
ACtion: hide
Fires when the result of the event is: false
Fire on the page loading: YES (check)
Assigned to elements, selection type: product (s)
Product (s): P1_SELECT
Kind regards
Vincent
-
Help with dynamic action and the selection list item
G ' Day Apex gurus.
I have problems trying to achieve to trigger the Help window from an element automatically select. A Help window is triggered when it is clicked on the label of an item, but my customer wants to be triguered automatically as soon as the user clicks to view the options in the select list.
I think I should be able to do with dynamic actions but I can't function.
I know when someone clicks on the label of the item selection list trigger this JavaScript
JavaScript:popupFieldHelp('277938589795252851','1545903379570909')
So I want to trigger the javascript also when the user click on the item selection list and pull down the options and for that I think that the dynamic action is the way to go, but I can't do things.
That's what I have to do:
I created a dynamic option as follows:
Name: test
Sequence: 30
Even: click
Selection type: product (s)
Article (s): P1_RATING <-a selection list item
Condtion: - no requirement.
Real Actions
Sequence: 10
Action: Run the JavaScript Code
Fires when the result of the event is: true
Fire on loading the page: checked
Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')
Thank you anyone who can tell me what I'm doing wrong here or bring a solution to my problem to trigger the Help window from an element automatically select.
Kind regards
CarlosHi Carlos,
I've set up a test case of exactly in the same way and it worked fine for me. I've created a page element called P1_DA_DEMO and added some values of the static selection list, then added a help text. I used the settings are lower, I suggest you try again, but also make sure that you have no other Javascript errors on the page. Use a tool like firebug to check.
Name: Action Dynamics demo
Sequence: 10
Even: click
Selection type: product (s)
Product (s): P1_DA_DEMO<- a="" selection="" list="">->
Condtion: - no requirement.Real Actions
Sequence: 10
Action: Run the JavaScript Code
Fires when the result of the event is: true
Fire on loading the page: unchecked
Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')Scope of the event set a Bind s.
Thank you
Paul
-
Need help with dynamic where clause.
Hello world. I'm kind of a novice with PL/SQL, so please be patient with me. I am building a web application using Weblogic Oracle 11 g and Oracle database.
To make a long story short, I need to generate the complex dynamic WHERE clause. I don't know what will be the name of the column or the operator of comparison or the value will be until the moment of execution.
I'm not 100% certain, but I think I need to use dynamic SQL statements. Unless there is a better way to do it.
I'm sure that using dynamic SQL opens me up to SQL injection attacks if I use simple string concatenation. I would like to use bind variable if possible.
In any case, it seems like trying to build a dynamic where clause does not seem to work as I want it would be...
bv1 := 'colA = 5 and colB >= 9'; query_str := 'SELECT * FROM view WHERE :bv1'; OPEN CUR FOR query_str USING bv1;
The code above pours out when I try to run it.
Is there a way to build dynamic where the provisions without the use of concatenation of simple string that leaves me open to attacks by SQL injection?
Thank you
Hello. I have read briefly upward on things, you suggested, but it seems a bit abstract for me since I was a novice.
Can you give us an explanation or an example of how to use it to accomplish what I need to do?
Do ypu really plan create a query with a WHERE clause that contains a predicate for all possible columns?
Variable bind offer performance when the same query is executed several times with different values for bind variables.
Select * from emp where empno =: v_empno
After the first run Oracle will always be this query in the library cache. The next running can use the version of the cache even if the bind value is different.
Select * from emp where empno =: v_empno;
Select * from emp where ename =: v_ename;
Select * from emp where sal =: v_sal;
Each one is a DIFFERENT query. Yes - each of them uses a variable binding, but queries are different.
So, if your username select EMPNO, an '=', and a value from the first query can be executed. But the next time that the user can select the ENAME column so that 'stored' first request may not be used given that the query does not match.
The third time your user selects SAL so none of the first two queries can be used in the library cache. The use of bind variables gives performance during the SAME QUERY is used multiple times with DIFFERENT values for the variable binding. Oracle is not to analyze the hard query everything simply because the VALUE is different.
So bind variables do not help you if most of the queries were completely DIFFERENT sets of predicates. And SYS_CONTEXT will not help either since that simply provides a way to define binds the values of the variables.
Just for the simple example above, there are at least SIX possible combinations of columns that could choose your user name: empno, ename, sal, empno ename, empno & sal, ename & sal
-
Help with dynamically created components (turning point properties on or off)
Hi all! I'm working on an application with a bunch of delegates of control is created dynamically.
Here's my use case-scenario:
I do a type app GPA calculator, and instead of hard coding a lot of drop-down lists for students select notes, I created a custom component. According to the documentation, each component created dynamically are destroyed until the parent TI auto is destroyed. ControlDelegate seems to be a better option that you can set the flag to false to make the component to go. I created a delegate of control that uses the custom of the list drop-down and added a few aliases to give each a name of object on creation. Now, my problem is that I can't understand the correct item call to the property delegateActive set to false to make the element disappear.
Here is the delegate of the control:
import bb.cascades 1.2 Container { property alias cT : classTitle.text property alias oN : obName.text property alias dN : dDown.objectName property alias cdF : dDown.delegateActive property alias dDown : dDown topPadding: 10.0 bottomPadding: 10.0 ControlDelegate { id: dDown sourceComponent: droDwn delegateActive: true } attachedObjects: [ ComponentDefinition { id: droDwn GpaDD { ddPro { title: cT objectName: oN } } } ] Label { id: classTitle text: "" visible: false } Label { id: obName text: "" visible: false } onTouch: { console.log(dDown.delegateActive + " " + dDown.objectName) } }
on the home page, I have the following code to create a new component:
Page { id: gpaCalc actions: [ ActionItem { id: addDD title: "Add Class" imageSource: "asset:///images/add.png" ActionBar.placement: ActionBarPlacement.OnBar onTriggered: { var nn = ddContainer.count(); var newDD = defDrop.createObject(); newDD.cT = "Class " + [ nn ]; newDD.oN = "_" + nn; newDD.dN = "_" + nn; ddContainer.add(newDD); } }, ActionItem { id: remDD title: "Remove Class" imageSource: "asset:///images/Edit.png" ActionBar.placement: ActionBarPlacement.OnBar onTriggered: { console.log(); } } ] attachedObjects: [ ComponentDefinition { id: defDrop DropDelegate { } } ] Container { /* ImageView { * horizontalAlignment: HorizontalAlignment.Fill * verticalAlignment: VerticalAlignment.Fill * imageSource: "asset:///images/rect_overlay.png" * opacity: 0.65 * }*/ ScrollView { horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill scrollViewProperties { scrollMode: ScrollMode.Vertical } Container { horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill topPadding: 50 leftPadding: 50 rightPadding: 50 id: ddContainer onCreationCompleted: { if (ddContainer.count() < 2) { var nn = ddContainer.count(); var newDD = defDrop.createObject(); newDD.cT = "Class " + [ nn ]; newDD.oN = "_" + nn; newDD.dN = "_" + nn; ddContainer.add(newDD); } } Label { text: "Select Your Grades" textStyle.fontStyle: FontStyle.Normal textStyle.fontWeight: FontWeight.W100 verticalAlignment: VerticalAlignment.Top horizontalAlignment: HorizontalAlignment.Center textStyle.fontSize: FontSize.XXLarge } } accessibility.name: "TODO: Add property content" } } }
How can I find the last delegate of control created to define the delegate tag as wrong?
Any help is appreciated!
You have so much you need to do it this way?
Why not just have a placeholder for * each * drop-down list and turn them on and off individually using delegateActive? -
Help with dynamic scripting for drift property
Hello
I try to get the list nodes children, then loopthorugh the nodes to do some calculations in a property derived by using dynamic scripts. I tried with the below script.
var childEnumerator is node. GetChildEnumerator();
While (childEnumerator.MoveNext ())
{
var varValeurProp = childEnumerator.GetCurrent (). PropValue ("Custom.Salary");
Print (propvalue);
}
While evaluating this script, I get an error below. No idea what I'm missing here?
DRM-16008: there was a calculation Script Custom.TotalSalaryExp for EMP_Zone/Emp/PPD1 property error: TypeError: 'GetChildEnumerator' is not a function
Please help me. Thank you fr your cooperation
Kind regards
Nathalie
Try this instead...
var childEnumerator is node. GetChildEnumerator();
childEnumerator.MoveNext ();
While (childEnumerator.GetCurrent ()! = null)
{
var varValeurProp = childEnumerator.GetCurrent (). PropValue ("Custom.Salary");
Print (propvalue);
childEnumerator.MoveNext ();
}
-
Help with dynamic Action with pl/sql and Javascript
Hi all
I'm a little hard with the following and I was wondering if someone can help me.
I have a list of unique selection on the page that queries a table in my diagram.My test app is here: http://apex.oracle.com/pls/apex/f?p=32581 workspace: Leppard Login: guest pw: app_1000 Tab: DB Link (page 19)
This is the flow that works, but not the user experience I want:
User clicks on the button Create Page 19 > the next page, page 20, appears as a popup window > user enters the name of the link = "MyLink" (or other) and one unit number, i.e. 1234 (or other) > user clicks 'Create using process' button > success message > user closed the window to return to the page 19 > user clicks LOV refresh to refresh the list of selection so that the new value is displayed.
That's what I'm aiming for: user clicks on the button Create Page 19 > the next page, page 20, appears as a popup window > user enters the name of the link = "MyLink" (or other) and one unit number, i.e. 1234 (or other) > user clicks button "create using the DA ' > dynamic action is called running pl/sql closes the popup window and refreshes the list of selection on page 19.
I know that I have some problems with my dynamic action. First of all, the pl/sql is not yet recognize the values that I enter the fields in item on page 20. I created a first pl/sql "null;" to force these items in session state, but it does not work for me and the pl/sql just inserts a null value into my table. Secondly, I can't get javascript to fire code to refresh the list of selection on page 19. The code I use in the DA is the same thing as what is behind the button refresh LOV, so I am confident that the code works, I just can't get this fire click the button "create using the DA" on page 20.
Sorry if this is confusing - I can clarify if necessary, let me know. Thanks in advance. Of course I'm still learning...
John
Published by: John K. on May 30, 2013 19:28I modified your DA as follows.
In real Action of DA,.
1 Seq 10, I added the element page 20 Page points to submit and return Pagenames. You forgot to add items here
2 Seq 20, I changed your simple code to insert. Simple code just insert
3 Seq 30, I added the new code to close the window and reload the window open.Thank you
Lacombe -
Need help with the design of database
Hello!
I would really appreciate help in the design of my database. I have a client that has one or more provisions of a certain type. These arrangements will have accounts associated with them. A customer has access to a number of accounts (accounts have a guy too) and when the customer has an arrangement, the arrangement will tell what types of accounts are related.
Some kind of pattern here
http://S8.PostImage.org/qcoiozcf9/Namnl_s.PNG
There are business rules to calculate that represents a client has access to (access above). It is basically three queries involving several different tables (you can give accounts, being a parent etc client that allows you to Auditors that you have not really own). One or two of these queries would a NOT IN / NOT EXIST (if you give your account, you won't have access to yourself until you revoke this action). AccountsOnArrangements is a subset of access (indicated by ArrangementType/AccountType-relationship). So A arrangement has all accounts of type 1, 2 and 3 customer B has access.
My question is, basically, how I should apply access and AccountsOnArrangements.
I can access in a view, which runs three queries with Union all. I can also use a table that I maintain with the application code. I have experimented a view but the performance doesn't look too good. I might have a materialized for each of the 3 queries that access, or view materialized for the 3 union all, but I wonder how the performance of this one will be. AccountsOnArrangements could also be a view or a table that I will maintain.
Is it normal to use views or use the code to insert and remove rows from these tables 'close' when a base line is modified?
Does still make sense? I have a few problems even explain :)
Published by: KarlTrumstedt on 22-Aug-2012 13:02
Published by: KarlTrumstedt on 22-Aug-2012 13:02
Published by: KarlTrumstedt on 22-Aug-2012 13:02
Published by: KarlTrumstedt on 2012-Aug-22-15:11According to the needs described I did according to model
[Customers] CustomerId PK ParentId FK to Customer.CustomerId [Accounts] AccointId PK CustomerId FK to Customer.CustomerId /*Owner*/ AccountType (CustomerId,AccountType) UK [AccountsAccess] AccointId FK to Accoints.AccointId CustomerId FK to Customer.CustomerId [Arrangements] ArrangementId CustomerId AccountType (CustomerId,AccountType) FK to Account.(CustomerId,AccountType)
In AccountsAccess will be stored CustomerId, AccountId pairs that tell the CustomerId has access to AccountId. For the entirely given accounts, there is no line for the CustomerId of the owner.
Frequently asked questions are representing a client has access to?
I create a SQL-based hierarchical display (because of the children of the customer, grandchildren...)
and AccountsAccessExactly what accounts is an arrangement linked with?
a view based on the join of the Arrangements and accounts on (CustomerId, AccountType)
Who has access to an account
a SQL-based hierarchical display (because of parents of the customer, grandparents...)
and AccountsAccessand who owns it?
a view based on the join of customers and accounts
-
I need help with dynamic input text
I am developing a game and I have a problem with my dynamic input text. I am doing my input text appear on other images whenever I click on the button, well, I tried a few solutions I've seen here, but it hasn't really well.
This is the first code I used:Stop();
function handleClick(pEvent:MouseEvent):void {}
var myfirstVariable = box1.text;
Welcome.Text = "Welcome to the game" + myfirstVariable;
}
enter_button.addEventListener (MouseEvent.MOUSE_UP, handleClick);
This works but only on an image. and this is the code I'm trying to use now:
Stop();
var enteredText:String;
welcome.addEventListener (Event.CHANGE, updateString);
function updateString(evt:Event) {}
enteredText = welcome.text;
}
enter_button.addEventListener (MouseEvent.MOUSE_UP, handleClick);
and on the other images:
Stop();
enteredText = welcome_2.text;
Thank you much for the help ^^
If you change the images have an another textfield on this new framework, you must set its text property to:
enteredText = welcome_2.text;<-comment out="" this="" line="" and="">-comment>
welcome_2.text = enteredText;
-
Need help with dynamic code generation
Hi people,
I'm trying to dynamically create and run the following query
Environment: Oracle Database 10 g Enterprise Edition Release 10.2.0.4.0
I get the following error messageDECLARE A NUMBER; stmt VARCHAR2(200); 4 5 CURSOR C1 IS 6 SELECT TABLE_NAME 7 FROM DB_MGMT.CTRL_TAB_RETENTION 8 WHERE RETENTION_PERIOD_IN_MONTHS = 11 9 AND rownum < 2; 10 11 BEGIN 12 FOR i IN C1 13 LOOP 14 15 -- dbms_output.put_line('Table Name: ' || i.TABLE_NAME); 16 17 -- dbms_output.put_line('SELECT min(DT_SKEY), max(DT_SKEY) FROM '||i.TABLE_NAME||' ;'); 18 19 stmt :='SELECT min(DT_SKEY), max(DT_SKEY) FROM DWH_RSRC_PERF.'||i.TABLE_NAME||';'; 20 21 dbms_output.put_line(stmt); 22 23 execute immediate stmt; 24 END LOOP; 25 END; 26 /
Does anyone can spot obvious syntax errors in the code above?SQL> @sanity_check SELECT min(DT_SKEY), max(DT_SKEY) FROM DWH_RSRC_PERF.FACT_NOK_CELL_SERVICE2_HH; DECLARE * ERROR at line 1: ORA-00911: invalid character ORA-06512: at line 23
Thanks in advance
rogers42rogers42 wrote:
HelloThanks for the suggestion.
Everything by getting rid of aid ';', but the output of the select statement is not displayed?
When you use a SELECT statement in PL/SQL, you must select the results in variables or arrays.
Try something like this:DECLARE CURSOR C1 IS SELECT TABLE_NAME FROM DB_MGMT.CTRL_TAB_RETENTION WHERE RETENTION_PERIOD_IN_MONTHS = 11 AND rownum < 2; min_dt_skey NUMBER; max_dt_skey NUMBER; stmt VARCHAR2 (100); BEGIN FOR i IN C1 LOOP -- dbms_output.put_line('Table Name: ' || i.TABLE_NAME); stmt :='SELECT min(DT_SKEY), max(DT_SKEY) FROM DWH_RSRC_PERF.' || i.TABLE_NAME; dbms_output.put_line(stmt); EXECUTE IMMEDIATE stmt INTO min_dt_skey, max_dt_skey; dbms_output.put_line ( min_dt_skey || ' = MIN (dt_skey), ' || max_dt_skey || ' = MAX (dt_skey) for table ' || i.table_name ); END LOOP; END;
-
Newb needs help with dynamic text
Hello world
I'm not a newb - but that's how...
I am trying to create a multi-page form that allows uses to register the products.
The first page asks you name etc., and on the second page, I want to say "Welcome"+ username "!" -This kind of thing...
The problem is that I can't seem to keep the values of dynamic text through the pages.
I can get it to repeat the entry on the first page with this code:
_root.firstname_txt. OnChanged = function() {}
_root.firstname_repeat. Text = "Hello"+ _root.firstname_txt.text; "
};
However when I call on the second page it is not defined:
second_repeat. Text = "Hello"+ _root.firstnamt_txt.text; "
trace (_root.second_repeat.text);
I'm sure it's something simple and I am just a dunce of programming...
Any help is appreciated.
yourIf your textfield (_root.firstname_repeat) does not exist on the 2nd frame, its text property will be indefinite.
to remedy, or extend the existence of your textfield in frameworks or use a variable to store its text property (in your manager onChanged) and use this variable to retrieve the value you need.
-
I'm having some trouble with a L2L tunnel where the remote end has a address DHCP on the external interface, this is a
WRVS4400N Wireless - N Gigabit Security Router with VPN, and I am locked into a particular to this end configuration. My end is an ASA5540, who must accept a dynamic connection, and I can do everything I need of to get this up and running...
Remote endpoint in Rome
192.168.252.0/24 within the network and must be able to talk to my end 192.168.240.0/24; 192.168.241.0/24; and 192.168.242.0/24
Setting up IPSec in Rome which cannot be changed:
IKE with preshared key
Phase 1 3DES, MD5, DH 2, key to life 86400
Phase2 3DES, MD5, activate the PFS, 2 DH, life 28800, pre-shared key XXXXX
On my end, I have immunity from the ACL and NAT correct... I can actually treat the current remote outside intellectual property as static and bring the tunnel up without problem. My problem is getting the correct dynamic Cryptography.
Here is what I currently have (or should I say have configured previously) on the SAA in the measurement of the dynamic crypto:
Crypto ipsec transform-set esp-SHA-ESP-3DES-3des esp-sha-hmac
Crypto ipsec transform-set ESP-3DES-MD5-esp-3des esp-md5-hmac
life crypto ipsec security association seconds 28800
Crypto ipsec kilobytes of life - safety 4608000 association
Crypto dynamic-map cisco 1 set of transformation-ESP-3DES-MD5
Crypto dynamic-map cisco 1 lifetime of security association set seconds 28800
kilobytes of life crypto dynamic-map cisco 1 set security-association 4608000
crypto isakmp identity address
crypto ISAKMP allow outside
crypto ISAKMP policy 5
preshared authentication
3des encryption
md5 hash
Group 2
life 86400
Therefore my isakmp policy 5 is my stage 1 Kit. My ESP-3DES-MD5 transformation corresponds to my need phase 2 encryption/authentication...
I think that all I'm missing is a way to match the PFS and DH 2 for phase2?
And since my ACL is named in Rome, then my tunnel-group must be named Rome as well?
Thank you.
I don't think that we can have several dynamic IP counterparts use diff pre-shared in these settings.
-
Sourav
-
Hello
I have the following function that works well:
FUNCTION to CREATE or REPLACE Get_Partition_Name (sTable VARCHAR2, iImportIndex INTEGER)
RETURN VARCHAR2 IS
cursor c is select A.partition_name from (select table_name, nom_partition,
ExtractValue)
dbms_xmlgen.
() getxmltype
"Select high_value of all_tab_partitions where table_name =" '. "
|| table-name
|| ' ' and table_owner = "'
|| TABLE_OWNER
|| ' ' and nom_partition = "'
|| nom_partition
|| ''''),
import_value of all_tab_partitions) where table_name sTable = and A.import_value = iImportIndex;
sPartitionName varchar (20);
err_num NUMBER;
BEGIN
Open c;
extract the c in sPartitionName;
IF c % ISOPEN THEN
C CLOSE;
END IF;
RETURN sPartitionName;
EXCEPTION
WHILE OTHERS THEN
err_num: = SQLCODE;
-Save the error in the log table
NEWSPAPER. SAVELINE (SQLCODE, SQLERRM);
END Get_Partition_Name;
I am trying to replace the dynamic SQL, something like cursor statement (see below), but it's broken. According to me, Miss me some quotes.
FUNCTION to CREATE or REPLACE Get_Partition_Name (sTable VARCHAR2, iImportIndex INTEGER)
RETURN VARCHAR2 IS
TYPE t1 IS REF CURSOR;
c t1;
sSql VARCHAR2 (500);
sPartitionName varchar (20);
err_num NUMBER;
BEGIN
sSql: = ' select A.partition_name from (select table_name, nom_partition,
ExtractValue)
dbms_xmlgen.
() getxmltype
'select high_value of all_tab_partitions where table_name ="'
|| table-name
|| ' ' and table_owner = "'
|| TABLE_OWNER
|| ' ' and nom_partition = "'
|| nom_partition
|| ''''''),
text() ") import_value of all_tab_partitions) where table_name =: a and A.import_value =: b';
C OPEN sSql USING sTable, iImportIndex;
extract the c in sPartitionName;
IF c % ISOPEN THEN
C CLOSE;
END IF;
RETURN sPartitionName;
EXCEPTION
WHILE OTHERS THEN
err_num: = SQLCODE;
-Save the error in the log table
NEWSPAPER. SAVELINE (SQLCODE, SQLERRM);
END Get_Partition_Name;
/
Please advise,
Kind regards
M.R.Assuming that the requirement is to find the partition in the table provided with the provided high value and the problem is that dba/all_tab_partitions.high_value is of type long, an alternative solution in the same sense that you already made is as follows. (I just used a slider instead of a function for the simplicity of the demo).
SQL> var r refcursor SQL> set autoprint on SQL> declare 2 ctx dbms_xmlgen.ctxhandle; 3 v_table_name VARCHAR2(40) := 'LOGMNR_USER$'; 4 v_value NUMBER := 100; 5 begin 6 ctx := DBMS_XMLGEN.NEWCONTEXT 7 ('select table_name 8 , partition_name 9 , high_value hi_val 10 from dba_tab_partitions 11 where table_name = :table_name'); 12 dbms_xmlgen.setbindvalue(ctx,'TABLE_NAME',v_table_name); 13 open:r for 14 with x as 15 (select xmltype(dbms_xmlgen.getxml(ctx)) myxml 16 from dual) 17 select extractvalue(x.object_value,'/ROW/TABLE_NAME') table_name 18 , extractvalue(x.object_value,'/ROW/PARTITION_NAME') partition_name 19 , extractvalue(x.object_value,'/ROW/HI_VAL') hi_val 20 from x 21 , TABLE(XMLSEQUENCE(EXTRACT(x.myxml,'/ROWSET/ROW'))) x 22 where extractvalue(x.object_value,'/ROW/HI_VAL') = v_value; 23 end; 24 / PL/SQL procedure successfully completed. TABLE_NAME ------------------------------------------------------------------------------- PARTITION_NAME ------------------------------------------------------------------------------- HI_VAL ------------------------------------------------------------------------------- LOGMNR_USER$ P_LESSTHAN100 100 SQL>
I don't know that there are other ways as well. Especially with the XML features, there are normally several ways to skin a cat.
-
Please help with dynamic form field names in cfloop
Hello
I need to create a form with day, date, month, year and time for 12 months
Instead of coding them 12 times, I create fileds day, date, month, year and hour in my form 1 time, then I use cfloop from = "1" to "12" = index = 'i' to these fields in form loop 12 times.
I gave each form field name such as: < input type = "text" name = "' ScheduleDate_ # I #" value ="" > this way, each of these fields will be named differently: ""
ScheduleDate_1, ScheduleDate_2, ScheduleDate_3, ScheduleTime_1, ScheduleTime_2, etc.
I am facing problem when this form is sent, I think that the error has something to do with the number sign (#) when it comes to update the back-end
I use MS SQL
He doesn't like this:
< CFLOOP From="1" To="12" index="k">
< CFIF Len(Trim(Form.MeetYear_#k#)) NEQ 0 AND Len(Trim(Form.MeetTime_#k#)) NEQ 0>
< cfquery name ='CreateSchedule' datasource =' #DSN # '>
UPDATE TableSchedule
The VALUE SchedDay = < cfqueryparam cfsqltype ="cf_sql_varchar" value ='#form. SchedDay_ # k'>.
SchedMonth =
< cfqueryparam cfsqltype ="cf_sql_varchar" value =' #form. . "AnnMonth_ # k '>.
SchedDate =
< cfqueryparam cfsqltype ="cf_sql_varchar" value =' #form. . "SchedDate_ # k '>.
SchedYear =
< cfqueryparam cfsqltype ="cf_sql_varchar" value =' #form. . "AnnYear_ # k '>.
SchedTime =
< cfqueryparam cfsqltype ="cf_sql_varchar" value =' #form. . "Anntime_ # k '>
Où SchedId = < cfqueryparam cfsqltype ='cf_sql_numeric' value =' #k # '>
< / cfquery >
< / CFIF >
< / CFLOOP >
Can anyone help please?
You cannot nest sharps. Do this instead:
SET SchedDay =
Dave Watts, CTO, Fig Leaf Software
Maybe you are looking for
-
What is the best software project management for a Mac
Hi I just bought a MacBook Pro for my business. My company has won an engineering project that I will be the Project Director. My client uses MS Projects, I can't on my Mac, what is the best option John
-
Trade contacts don't sync correctly
Hi all. I have an iPhone SE 9.3.1. I have an Office 365 email account that I have connected to the phone when I bought it a few weeks ago. All contacts not loading perfectly, no problem. I turned my phone off last night - the first time I did it beca
-
How to set up my wireless connection?
Hello, I have a satellite 1410/2410 I think and im not sure how to set up my wireless I rang bt broadband ordered a card wireless broadband from bt to get into my computer as I was told I need to 1, but it would not install, so I rang back bt and the
-
Profile of speed in a LabView graph
HelloI wanto do a trapeze of speed in a LabView graph. I will order a servo and requires acceleration, after a constant speed and, finally, a desaceleracion. I want to see and control the trapeze of the grafic, clik on the trapeze and moving the line
-
AC monitor does not not because of the Lexmark Incompatibilty
Then I read through the forums and used windows install Cleanup utility tool and everything goes to the "all users" window I couldn't see Lexmark nothing in there. I have a small icon on the toolbar and the folder under all programs, but nothing for