Put the loop of variables in a single table with formatting (PHP)
I have the following loop;
<? PHP
$i = 1;
While ($i < = $num_rows)
{
$tempquantity = "extra". $i.' quantity ';
$tempcomments = "extra". $i."comments";
$tempname = "extra". $i.' name ';
$tempprice = "extra". $i."price";
$$tempquantity = $_POST ['extra'. $i. "quantity"];
$$tempcomments = $_POST ['extra'. $i. "Comments"];
$$tempname = $_POST ['extra'. $i. "name"];
$$tempprice = $_POST ['extra'. $i. 'price'];
Print "Extra name: $$tempname;
Print "< br / > ';
Print "Extra price:". "." $$tempprice;
Print "< br / > ';
Print "quantity:". "." $$tempquantity;
Print "< br / > ';
Print "reviews:". "." $$tempcomments;
Print "< br / > < br / > ';
$i++;
}
? >
Which, since there are 3 rows, outputs the following:
Extra-Nom: dfvgfddf
Extra price: 4
Quantity required: 67
Customer reviews: gtfh
Extra-Nom: wewew
Extra price: 34
Required quantity: 45
Customer feedback: thtrt
Extra name: ewewe
Extra price: 43
Required quantity: 12
Customer feedback: gdfgg
I want to be able to do is to show the output above in a PHP email body variable which, according to me, this means that the loop variables must be in a single array variable as coding in a body of email variable is not allowed. How can I put a loop of variables like that in a single variable, and how to keep the < br / > tags and names before variables ("name Extra:' etc."), so it seems that it should in the PHP email body?
Thanks in advance
I also need to set the variables generated by the loop in a single database field
Why? Looks like a mistake to me.
Anyway, why not change it.
The name of the tenant: $rentername
on this subject.
" The tenant's name: $rentername.
$i = 1;
While ($i<>
{
$tempquantity = "extra". $i.' quantity ';
$tempcomments = "extra". $i."comments";
$tempname = "extra". $i.' name ';
$tempprice = "extra". $i."price";
$$tempquantity = $_POST ['extra'. $i. "quantity"];
$$tempcomments = $_POST ['extra'. $i. "Comments"];
$$tempname = $_POST ['extra'. $i. "name"];
$$tempprice = $_POST ['extra'. $i. 'price'];
$body. =<>
Additional name: $$tempname
Extra charge: $$tempprice
Required amount: $$tempquantity
Customer reviews: $$tempcomments
EOT;
$i++;
}
and then remove the loop where it occurs earlier.
Tags: Dreamweaver
Similar Questions
-
The script generation is not supported for Table with XML or UDT column Types
I get this message trying to generate a script to create a table with an XMLTYPE column. We use the Oracle Developer Tools for Visual Studio to generate scripts as SQLDeveloper does still not support TFS integration. He was always pretty easy to generate scripts and maintain control of source code in this way (with the exception of materialized views). It was great, just right click and generate a script for the project and check it in. Unfortunately as the adoption of XML grows, we find passage to the SQL Developer more often to perform tasks not supported and then return to the VS IDE to manage source code control. Free of any chance that it will be supported in the future?
Yes, our plan is to support several types as time goes by.
You possibly can speed things along by voting or by filing a request for new feature here:
-
HI :)
I would like to know, how to select in SQL for all the names of columns in a table with their data types so that I get something like this:
Table 1: table_name
the ID of the column has the NUMBER data type
the name of the column has Datatype Varchar2
*....*
--------------------------------------------------------------
Table 2: table_name
the check in the column has the NUMBER data type
the air of the column has Datatype Varchar2
*....*
and it must be for all the tables that I own!...
P. S: I'm trying to do this with java, so it s would be enough if you just tell me how to select all tables_names with all their colums_names and all their data types!...
Thanks :)
I've heard this can be done with USER_TABLES... but I have no idea how: (...)
Edited by: user8865125 the 17.05.2011 12:22Hello
USER_TAB_COLUMNS data dictionary view has a row for each column of each table in your schema. The columns TABLE_NAME, COLUMN_NAME and DATA_TYPE contains all the information you need.
Another view of data, USER_TABLES dictionary, can be useful, too. He has a line of table pre. -
Link the 'LOOP' undeclared variable.
Hello
I am very new to Pl/SQL. My job needs me to migrate MySQL to Oracle database (which I did successfully), but the procedures described in the MySQL has no could be migrated to Oracle, have so create them manually.
When the procedure created, make me these errors
Error (4.1): PLS-00103: encountered the symbol "DECLARE" when expecting one of the following values: type of the subtype of the function pragma < an ID > < a double quote delimited identifier > removal of current cursor exists before the symbol 'start' is substituted for 'DECLARE' continue.
Error (5.1): PLS-00103: encountered the symbol "DECLARE" when expecting one of the following values: type of subtype of the function pragma < an ID > < a between double quote delimited identifiers > removal of current cursor are prerequisite
Please help where I am doing wrongCREATE OR REPLACE PROCEDURE PROCEDURE1 AS BEGIN Declare v_date date; Declare v_particulars varchar(50); Declare v_quantity float default 0; Declare v_item integer default 0; Declare v_vendor integer default 0; Declare v_flag integer default 1; Declare v_supplier_id integer default null; Declare v_unit integer default 0; Declare v_srno integer default 0; Declare op_date date; declare op_bal float default 0; Declare temp_v_from_date date; Declare temp_v_to_date date; Declare done integer default 0; Declare cur1 cursor for (select sibs.opening_balance_date,'Opening Balance',sibs.item_id, sum(sibs.opening_balance_qty), '1'from store_item_batch_stock sibs where sibs.opening_balance_date is not null and sibs.department_id = v_depart and sibs.item_id = v_item_id group by sibs.item_id); Declare cur2 cursor for (select sgm.grn_date, concat('Receipt',' - (',sgm.grn_no,')'), sgt.item_id, sum(NVL((case d.formula when 1 then ((sgt.received_qty + sgt.free_qty) * sgt.mdq_value) / d.conversion_factor1 else (sgt.received_qty + sgt.free_qty) end),0)), '2',sgm.supplier_id,sgm.unit_id from store_grn_m sgm, store_grn_t sgt, mas_store_item c, mas_store_item_conversion d where sgm.grn_date between v_from_date and v_to_date and sgm.department_id = v_depart and sgt.item_id = c.item_id and c.item_conversion_id = d.item_conversion_id and sgt.grn_master_id = sgm.grn_master_id and sgt.item_id = v_item_id group by sgm.grn_master_id ); Declare cur3 cursor for (select sim.issue_date,concat('Issue',concat(' -(',concat(sim.issue_no,')'))), sit.item_issued, sum(NVL(sit.qty_issued,0)), '3' from store_issue_m sim, store_issue_t sit where sim.issue_date between v_from_date and v_to_date and sim.department_id = v_depart and sit.issue_m_id = sim.id and sim.issue_type = 'i' and sit.item_issued = v_item_id and sit.issued = 'y' group by sim.id ); Declare cur4 cursor for (select sgrm.return_date, 'Vendor Return', sgrt.item_id, sum(NVL(sgrt.return_qty,0)), '3' from store_grn_return_m sgrm,store_grn_return_t sgrt where sgrm.return_date between v_from_date and v_to_date and sgrm.department_id = v_depart and sgrt.grn_return_id = sgrm.grn_return_id and sgrt.item_id = v_item_id group by sgrm.grn_return_id ); Declare cur5 cursor for (select sadm.adjustment_date, 'Adjustment',sadt.item_id, sum(NVL(sadt.adjust_qty,0)), '2' from store_adjustment_m sadm, store_adjustment_t sadt where sadm.adjustment_date between v_from_date and v_to_date and sadm.department_id = v_depart and sadt.adjust_id = sadm.id and sadt.item_id = v_item_id and sadt.adjust_qty != 0 group by sadm.id ); Declare cur6 cursor for (select sim.issue_date,'Receipt (Internal)', sit.item_issued, sum(NVL(sit.qty_issued,0)), '2' from store_issue_m sim, store_issue_t sit where sim.issue_date between v_from_date and v_to_date and sim.to_store = v_depart and sit.issue_m_id = sim.id and sim.issue_type = 'i' and sit.item_issued = v_item_id and sit.issued = 'y' group by sim.id ); declare cur7 cursor for (select siam.adjustment_date, 'Adjustment',siat.item_id, sum(NVL(siat.adjusted_qty,0)), '2' from store_item_adjustment_m siam, store_item_adjustment_t siat where siam.adjustment_date between v_from_date and v_to_date and siam.adjustment_login_dept = v_depart and siat.item_adjustment_m_id = siam.item_adjustment_id and siat.item_id = v_item_id and siat.adjusted_qty != 0 group by siam.item_adjustment_id ); Declare oldcur1 cursor for (select sgm.grn_date, 'Receipt', sgt.item_id, sum(NVL((case when d.formula =1 then ((sgt.received_qty + sgt.free_qty) * sgt.mdq_value) / d.conversion_factor1 else (sgt.received_qty + sgt.free_qty) end),0)), '2' from store_grn_m sgm, store_grn_t sgt, mas_store_item c, mas_store_item_conversion d where sgm.grn_date between '2009-03-31' and (v_from_date -1) and sgm.department_id = v_depart and sgt.item_id = c.item_id and c.item_conversion_id = d.item_conversion_id and sgt.grn_master_id = sgm.grn_master_id and sgt.item_id = v_item_id group by sgm.grn_master_id ); Declare oldcur2 cursor for (select sim.issue_date,'Issue', sit.item_issued, sum(NVL(sit.qty_issued,0)), '3' from store_issue_m sim, store_issue_t sit where sim.issue_date between '2009-03-31' and (v_from_date -1) and sim.department_id = v_depart and sit.issue_m_id = sim.id and sim.issue_type = 'i' and sit.item_issued = v_item_id and sit.issued = 'y' group by sim.id ); Declare oldcur3 cursor for (select sgrm.return_date, 'Return', sgrt.item_id, sum(NVL(sgrt.return_qty,0)), '2' from store_grn_return_m sgrm, store_grn_return_t sgrt where sgrm.return_date between '2009-03-31' and (v_from_date -1) and sgrm.department_id = v_depart and sgrt.grn_return_id = sgrm.grn_return_id and sgrt.item_id = v_item_id group by sgrm.grn_return_id ); Declare oldcur4 cursor for (select sadm.adjustment_date, 'Adjustment',sadt.item_id, sum(NVL(sadt.adjust_qty,0)), '2' from store_adjustment_m sadm, store_adjustment_t sadt where sadm.adjustment_date between '2009-03-31' and (v_from_date -1) and sadm.department_id = v_depart and sadt.adjust_id = sadm.id and sadt.item_id = v_item_id and sadt.adjust_qty != 0 group by sadm.id ); Declare oldcur5 cursor for (select sim.issue_date,'RCPT', sit.item_issued, sum(NVL(sit.qty_issued,0)), '3' from store_issue_m sim, store_issue_t sit where sim.issue_date between '2009-03-31' and (v_from_date -1) and sim.to_store = v_depart and sit.issue_m_id = sim.id and sit.item_issued = v_item_id and sit.issued = 'y' group by sim.id ); declare oldcur7 cursor for (select siam.adjustment_date, 'Adjustment',siat.item_id, sum(NVL(siat.adjusted_qty,0)), '2' from store_item_adjustment_m siam, store_item_adjustment_t siat where siam.adjustment_date between '2009-03-31' and (v_from_date -1) and siam.adjustment_login_dept = v_depart and siat.item_adjustment_m_id = siam.item_adjustment_id and siat.item_id = v_item_id and siat.adjusted_qty != 0 group by siam.item_adjustment_id ); Declare closingStockUpdateCursor cursor for(select sno,date,qty,flag from ledger where dept_id = v_depart and item_id = v_item_id and flag!=0 order by date ); Declare continue handler for not found set done =1; delete from ledger where item_id = v_item_id and dept_id = v_depart; Open cur1; item_loop:loop Fetch cur1 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; if not (v_date > v_from_date) then set op_bal = v_quantity; set op_date = v_date; End if; End loop item_loop; Close cur1; set done = 0; Open oldcur1; item_loop:loop Fetch oldcur1 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; set op_bal = op_bal + v_quantity; End loop item_loop; Close oldcur1; set done = 0; Open oldcur2; item_loop:loop Fetch oldcur2 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; set op_bal = op_bal - v_quantity; End loop item_loop; Close oldcur2; set done = 0; Open oldcur3; item_loop:loop Fetch oldcur3 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; set op_bal = op_bal + v_quantity; End loop item_loop; Close oldcur3; set done = 0; Open oldcur4; item_loop:loop Fetch oldcur4 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; if op_date != v_date then set op_bal = op_bal + v_quantity; End if; End loop item_loop; Close oldcur4; set done = 0; Open oldcur5; item_loop:loop Fetch oldcur5 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; set op_bal = op_bal + v_quantity; End loop item_loop; Close oldcur5; set done = 0; Open oldcur7; item_loop:loop Fetch oldcur7 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; set op_bal = op_bal + v_quantity; End loop item_loop; Close oldcur7; set done = 0; insert into ledger(date, particulars,qty,item_id,dept_id,flag,closing_stock) values(v_from_date,'Opening Balance', op_bal, v_item_id,v_depart,'0',op_bal); Open cur2; item_loop:loop Fetch cur2 into v_date, v_particulars, v_item, v_quantity, v_flag, v_supplier_id, v_unit; If done =1 then Leave item_loop; End if; insert into ledger(date, particulars,qty,item_id,flag,dept_id,vendor_id,closing_stock,unit_id) values(v_date,v_particulars, v_quantity, v_item,v_flag,v_depart,v_supplier_id,0,v_unit); End loop item_loop; Close cur2; set done = 0; Open cur3; item_loop:loop Fetch cur3 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; insert into ledger(date, particulars,qty,item_id,flag,dept_id,closing_stock) values(v_date,v_particulars,v_quantity, v_item,v_flag,v_depart,0); End loop item_loop; Close cur3; set done = 0; Open cur4; item_loop:loop Fetch cur4 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; insert into ledger(date, particulars,qty,item_id,flag,dept_id,closing_stock) values(v_date,v_particulars,v_quantity, v_item,v_flag,v_depart,0); End loop item_loop; Close cur4; set done = 0; Open cur5; item_loop:loop Fetch cur5 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; insert into ledger(date, particulars,qty,item_id,flag,dept_id,closing_stock) values(v_date,v_particulars, v_quantity, v_item,v_flag,v_depart,0); End loop item_loop; Close cur5; set done = 0; Open cur6; item_loop:loop Fetch cur6 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; insert into ledger(date, particulars,qty,item_id,flag,dept_id,closing_stock) values(v_date,v_particulars, v_quantity, v_item,v_flag,v_depart,0); End loop item_loop; Close cur6; set done = 0; Open cur7; item_loop:loop Fetch cur7 into v_date, v_particulars, v_item, v_quantity, v_flag; If done =1 then Leave item_loop; End if; insert into ledger(date, particulars,qty,item_id,flag,dept_id,closing_stock) values(v_date,v_particulars, v_quantity, v_item,v_flag,v_depart,0); End loop item_loop; Close cur7; set done = 0; Open closingStockUpdateCursor; item_loop:loop Fetch closingStockUpdateCursor into v_srno,v_date, v_quantity, v_flag; If done =1 then Leave item_loop; End if; if v_flag = 2 then set op_bal = op_bal + v_quantity; else set op_bal = op_bal - v_quantity; end if; update ledger set closing_stock = op_bal where sno = v_srno; End loop item_loop; Close closingStockUpdateCursor; set done = 0; END NULL; END PROCEDURE1; /
Another comment.
If the two products are identical in functionality, there is nothing much to differentiate one from the other. And this is important because the differences between the products are what motivates the buyer who is the best decision.
There are differences major between Oracle and mySQL. Some basic and fundamental differences. And that is what makes a 'better' than the other - product and led the decision on whether to use Oracle or mySQL.
Oracle made a poor mySQL. He did very well the thing of Oracle. So it makes no sense to take a design and the code that works for mySQL, the Pinard on Oracle and think that the differences in this Oracle now allows to make this creation and of labour and 'performing '.
Everything but. As Oracle mimics poor mySQL, the end result of this will be a system that performs worse than what he did on mySQL.
To make use of what makes Oracle 'better' than mySQL, requires the application to be rethought and code refactored.
IMO, that you / your company are, is doomed to failure. You will have to pay more money for a more sophisticated and very capable product RDBMS - which fails to reach its potential, you want to pretend to be mySQL, and to do this, better than mySQL. It's an epic fail.
-
I made a banner using flashcc2014 using the html5 canvas. I don't know how to do 3 times using javascript or by adding the normal "clickTAG" banners need to loop.
Any help appreciated.
Thank you
Rodrigo
the necessary js is the same as, except that you do not type the variables and that precede you them "this."
last image in loop:
{if(!this.alreadyExecuted)}
this.alreadyExecuted = true;
this.loopNum = 1;
} else {}
this.loopNum ++;
{if(this.loopNum==3)}
This.Stop ();
}
}
-
Hello
Please let me know how to query the table and get the records that are less than the other column.
ID item_id item_type
3 1 r1
2 4 r2
1 5 r3
6 5 r4
I need to get all the lines in which item_id < id
o/p
ID item_id item_type
3 1 r1
6 5 r4
SELECT ID, ITEM_ID, ITEM_TYPE
Of
WHERE ITEM_ID<>
-
Retrieve a single table with RMAN
Hello
I'm working on a database of Oracle 11 g Release 11.1.0.6.0 - 64 bit Production With the Real Application Clusters option.
I did a bad update on a table.
I have a level 0 backup before the update
Is it possible to recover the unique table in an instant before the update with RMAN?
Thanks in advance.
SamuelThis is called a point in time recovery.
Here you must create an auxiliary database from the backup.
If you have space in your current server then you can create it here or otherwise in another server.
1 restore the system, sysaux, cancellation and this tablespace that contains the deleted table.
2 drop all the other tablespace in the auxiliary database in State of Mount
3. recover the database to when the table was dropped or updated updated
4. take the auxiliary database table export and import it into the original database -
Move a single table with data engine
Hello
I'm new on data mover. I want to move a table and I used the following script
the value of log c:\app\psft\export.log.
output c:\app\psft\export.dat;
export PS_COMMISSION;
I get the error
unsuccessful end 'command is not valid in bootstrap mode "?
help please?Use non-bootstrap mode instead (e.g. PS or VP1 or whatever else as SYSADM).
Nicolas.
-
Select the element on a form as a table with a different dynamic LOV on each line
I would use a tabular form when one of the columns is a Select based dynamic LOV, and where this is dynamic LOV refers to a column on the values in each row.
So if the tabular presentation was a list of teams and the column selection LOV was the current head of the team, I would like to than this selection list to be filled only with the members of this team (different for each line). As the list of the members of the team is in a different table (all_players or something) I won't fill the LOV with a query with a where clause clause that only selected records of players from team-membership equal to the id of the current team tabular form. Thus, on each line the content of this list would be different.
-JustinThis is explained here:
http://HTMLDB.Oracle.com/pls/OTN/f?p=31517:176
Denes Kubicek
-------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
------------------------------------------------------------------- -
Improving the performance of the loop
Morning all,
I have a loop For, execution of 5,000 times nested within a structure of the event. I parallelization allowed that each iteration is completely indepentant of all other iterations. I am performing an optimization to each iteration. I have several multidimensional arrays as inputs I at the start of the index outside the loop For and then auto-index on the loop. I then accumulate several tables with the results of each iteration as outputs on the loop for run time is between 40-60 minutes, where, as the same code by one of my colleagues using Python takes 10 minutes. Is that what I can do to improve performance? I'm running a quad core, computer laptop i7 with lots of RAM, so not a hamster in a wheel, the code of conduct.
Thank you
Paul
I agree to say that (a) you should zip code (the easiest way is to attach your VI, not a photo, certainly not PowerPoint), and (b) you should not use form nodes if you want speed. I bet a dime that your code is going to fight many times more.
[, Or by the way, here is a code snippet LabVIEW, one.] PNG 'image' which will be transformed into executable of LabVIEW, 'Magic' or due to some code, if you deposit a LabVIEW (version displayed in the upper right) 2016 block.]
Bob Schor
-
How to combine the large number of tables of pair key / value in a single table?
I have a pair key / value tables of 250 + with the following features
(1) keys are unique within a table but may or may not be unique in the set of tables
(2) each table has about 2 million lines
What is the best way to create a single table with all unique key-values of all these paintings? The following two queries work up to about 150 + tables
with t1 as ( select 1 as key, 'a1' as val from dual union all select 2 as key, 'a1' as val from dual union all select 3 as key, 'a2' as val from dual ) , t2 as ( select 2 as key, 'b1' as val from dual union all select 3 as key, 'b2' as val from dual union all select 4 as key, 'b3' as val from dual ) , t3 as ( select 1 as key, 'c1' as val from dual union all select 3 as key, 'c1' as val from dual union all select 5 as key, 'c2' as val from dual ) select coalesce(t1.key, t2.key, t3.key) as key , max(t1.val) as val1 , max(t2.val) as val2 , max(t3.val) as val3 from t1 full join t2 on ( t1.key = t2.key ) full join t3 on ( t2.key = t3.key ) group by coalesce(t1.key, t2.key, t3.key) / with master as ( select rownum as key from dual connect by level <= 5 ) , t1 as ( select 1 as key, 'a1' as val from dual union all select 2 as key, 'a1' as val from dual union all select 3 as key, 'a2' as val from dual ) , t2 as ( select 2 as key, 'b1' as val from dual union all select 3 as key, 'b2' as val from dual union all select 4 as key, 'b3' as val from dual ) , t3 as ( select 1 as key, 'c1' as val from dual union all select 3 as key, 'c1' as val from dual union all select 5 as key, 'c2' as val from dual ) select m.key as key , t1.val as val1 , t2.val as val2 , t3.val as val3 from master m left join t1 on ( t1.key = m.key ) left join t2 on ( t2.key = m.key ) left join t3 on ( t3.key = m.key ) /
A couple of questions, then a possible solution.
Why the hell you have 250 + tables pair key / value?
Why the hell you want to group them in a table containing one row per key?
You could do a pivot of all the tables, not part. something like:
with t1 as ( select 1 as key, 'a1' as val from dual union all select 2 as key, 'a1' as val from dual union all select 3 as key, 'a2' as val from dual ) , t2 as ( select 2 as key, 'b1' as val from dual union all select 3 as key, 'b2' as val from dual union all select 4 as key, 'b3' as val from dual ) , t3 as ( select 1 as key, 'c1' as val from dual union all select 3 as key, 'c1' as val from dual union all select 5 as key, 'c2' as val from dual ) select key, max(t1val), max(t2val), max(t3val) FROM (select key, val t1val, null t2val, null t3val from t1 union all select key, null, val, null from t2 union all select key, null, null, val from t3) group by key
If you can do it in a single query, Union all 250 + tables, you don't need to worry about chaining or migration. It may be necessary to do this in a few passes, depending on the resources available on your server. If so, I would be inclined to first create the table, with a larger than normal free percent, making the first game as a right inset and other pass or past as a merger.
Another solution might be to use the approach above, but limit the range of keys with each pass. So pass we would have a like predicate when the key between 1 and 10 in every branch of the union, pass 2 would have key between 11 and 20, etc. In this way, everything would be straight inserts.
That said, I'm going back to my second question above, why the hell you want or need to do that? What is the company you want to solve. There could be a much better way to meet the requirement.
John
-
ORA-00904 PLS-00364: loop index variable
Hi all
create the table xxc_cust_id (cust_id number);
insert into xxc_cust_id values (1)
create table xxc_child (id number, part varchar2 (20), amount number);
insert into xxc_child values (1, "Replaced processor", 1500)
insert into xxc_child values (1, 'Replaced mouse', 200)
insert into xxc_child values (' 6, ' mouse replaced ', 200)
create table xxc_parent (ID, cust_id varchar2 (10));
insert into xxc_parent values (1,1)
insert into xxc_parent values (6.1)
Select * from xxc_parent
ID CUST_ID
--------- ----------
1 1
6 1
Select * from xxc_child
AMOUNT OF PART ID
-------- -------------------- ----------
1 processor replaced 1500
1 mouse replaced 200
6 mouse replaced 200
Select * from xxc_cust_id
CUST_ID
--------
1
I need
CUST_ID PLATE
-------- ----------
1 1900
to insert data into the table xxc_details
CREATE OR REPLACE PROCEDURE XXC_SUM_DETAILS
IS
CURSOR c_1
IS
SELECT Cust_id
OF xxc_cust_id
ORDER BY cust_id.
CURSOR c1
IS
SELECT a.cust_id, SUM (sum) total_sum
Xxc_parent a, xxc_child b
WHERE a.id = b.id
AND cust_id = c_cust_id.cust_id
GROUP BY a.cust_id;
BEGIN
FOR c_cust_id IN c_1
LOOP
dbms_output.put_line ('Enter');
C_rec IN C1
LOOP
BEGIN
INSERT INTO xxc_details (part_id, total_amount)
VALUES (c_rec.cust_id, c_rec.total_sum);
COMMIT;
END;
END LOOP;
END LOOP;
END;
LINE/COL ERROR
-------- -----------------------------------------------------------------
10/9 PL/SQL: statement ignored
12/42 PL/SQL: ORA-00904: "C_CUST_ID." "" Cust_id ": invalid identifier
21/13 PL/SQL: statement ignored
22/41 PLS-00364: 'C_REC' use the loop index variable is not valid
22/47 PL/SQL: ORA-00984: column not allowed here
In this case you cannot include the sequence directly in the GROUP BY in the query part, that you can group on sequences or the aggregated.
He must ignore the sequence to a higher level, the group so that it is assigned to each row that will be inserted in the sub-sub-group by query to...
INSERT INTO xxc_details (details_id, cust_id, total_amount, CONTRACT_NUMBER)
Select DETAILS_ID_SEQ. NEXTVAL
cust_id
total_sum
quantity
from (select a.cust_id,
Total_sum SUM (b.amount),
d.amount
Xxc_parent a.,
b xxc_child,
xxc_cust_id c,
xxc_sum_acc d
where a.id = b.id
and c.cust_id = a.cust_id
and c.cust_id = d.cust_id
AND contract_type = 'AML.
and not exists (select 1
of e xxc_details
where c.cust_id = e.cust_id
)
GROUP BY a.cust_id, d.amount
);
-
Reading data from a Table by using the loop
I have a dynamic array within the PDF form. I want to loop through the rows in the table and read the contents of the cell. I successfully get the number of rows in the table. But impossible to read the values in the cells. I put control TextField (txtName) editable in every cell and trying to read its value.
screenshot is below.
I use the code is:
form1.Page1.Subform1.btnReadTable::click - (JavaScript, client) var rowCount = MyTable._Row1.count; app.alert("Row Count: " + rowCount); var i = 0; for(i=0 ; i<rowCount ; i++) { //app.alert(MyTable.Row1[i].txtName.rawValue); // NOT WORKING app.alert(MyTable.Row1.txtName.rawValue); // WORKING, But just giving the value for the first row. }
Please tell me how can I get the value of each name in all ranks by making a loop.
Thanks in advance.
-
Afonso
Hi, Afonso,
You must resolve the node for the particular case of i. The syntax is:
xfa.resolveNode("MyTable.Row1[" + i + "].txtName").rawValue;
Here there is an example that will show you the loop in action:
http://www.assuredynamics.com/index.php/category/portfolio/two-way-binding-in-tables/
Hope that helps,
Niall
-
Hi again...
I´d would like to know if any of you know why the following code returns this error:
ORA-01426: digital overflow.
It seems that the LOOP FOR variable, which in this case is represented by doesn´t I hold so much data that a variable NUMBER. Given how much the variable wait internal?
Oh, I´d also like to know how I can post the code here.DECLARE NUM1 NUMBER := 59171108702; NUM2 NUMBER := 59171108702; BEGIN FOR I IN NUM1 .. NUM2 LOOP DBMS_OUTPUT.PUT_LINE ('NUM: ' || I); END LOOP; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE (SQLERRM); END;
Chears,
Bruno
Published by: brunosdiniz on 01/20/2009 03:33The following example shows the limit of the PLS_INTEGER...
SQL> ed Wrote file afiedt.buf 1 DECLARE 2 NUM1 NUMBER := 2147483647; --59171108702; 3 NUM2 NUMBER := 2147483647; --59171108702; 4 BEGIN 5 FOR I IN NUM1 .. NUM2 LOOP 6 DBMS_OUTPUT.PUT_LINE ('NUM: ' || I); 7 END LOOP; 8* END; SQL> / NUM: 2147483647 PL/SQL procedure successfully completed. SQL> ed Wrote file afiedt.buf 1 DECLARE 2 NUM1 NUMBER := 2147483648; --59171108702; 3 NUM2 NUMBER := 2147483648; --59171108702; 4 BEGIN 5 FOR I IN NUM1 .. NUM2 LOOP 6 DBMS_OUTPUT.PUT_LINE ('NUM: ' || I); 7 END LOOP; 8* END; SQL> / DECLARE * ERROR at line 1: ORA-01426: numeric overflow ORA-06512: at line 5 SQL>
The latest example being for PLS_INTEGER 1 too.
-
synchronize the loop with the time on the computer
I'd like to run a while loop exactly all the 1 minute, with the minute that occur according to the time on the computer at 0 seconds.
a timed loop runs a minute after the loop is started and is not synchronized with the 0 seconds of time on the computer.
How do I get there? I realize the first loop will be less than 1 minute, due to the synchronisation.
Thanks, that helped me.
I thought at the start of the second 1 loop would consume resources additional, but realized it's negligible.
I ended up using quotient/remainder on time on the computer in seconds and checking when the remainder is 0, as this allowed for the second interval.
Maybe you are looking for
-
I use spices fx1. It displays all messages and call consolidated newspaper. How can I understand what message/call to a psrticular sim?
-
Portege Z830 - issues after updating Windows for Win 7
My laptop is PORTEGE Z830. I upgraded the system to Windows 7 Enterprise. I got this yellow (!) when I opened ad peripheral printers. When I tried to know what unit he showed: Pilot missing: ACPI\TOS6028\2 & daba3ff & 4 Also, I am not able to adjust
-
Redirect https admin page?
Hi Forum, I installed 6.4.0 without problems. However, the admin page is now exposed to the Internet over HTTP, which I see as a potential security risk. Is it possible to point the http://somedomain.nl/ to a webshare and point http://somedomain.nl/a
-
I'm sorry if this has already been reported. I don't know if it's a Droid Maxx or a problem of Android, but if you go into the settings of-> apps, slide to the 'running' tab and look at the time that one of the applications were broadcast, it seems t
-
I have a laptop DV7-3065DX that I got last Christmas and he has recently developed a strange charging problem. The other day and all of a sudden that it stopped charging, so I left FS2004 and within 5 to 10 minutes, I was playing FS2004, it began to