Display the Type SQL PL values
Hello, team ,
I use once in pl/sql table I want to know how to display the value of the type.
DECLARE L_NUMBER PLCH_NUMBER_T := PLCH_NUMBER_T(1,2,5,6,0,2); BEGIN DBMS_OUTPUT.PUT_LINE('count='||L_NUMBER.COUNT); DBMS_OUTPUT.PUT_LINE('First='||L_NUMBER.FIRST); DBMS_OUTPUT.PUT_LINE('count='||L_NUMBER.LAST); end;
Output as :-
Count = 6
First = 1
Last = 6
Number of() 3) := 5
Number of() 6):= 2
Can be...
SQL > declare
2 l_number plch_number_t: = plch_number_t (1,2,5,6,0,2);
3. start
4 because me in 1.l_number.count
5 loop
6 dbms_output.put_line ('number ('| to_char (i) |')-' | l_number (i));
7 end of loop;
8 end;
9.
Number (1) - 1
Number (2) - 2
Number (3)-5
Number 4 - 6
Number (5) - 0
Number (6) - 2PL/SQL procedure successfully completed.
Tags: Database
Similar Questions
-
Which of the 2 hlp files should I use in Win7/64 to display the types of old
Which of the 2 hlp files should I use in Win7/64 to display the types of old
Windows6. 1 x-KB917607-64.msu or
. Msu Windows6. 1 - KB917607 - x 86 (1)
Hello
You must install the package Windows6. 1-KB917607-x 64.msu scored since you are on a 64-bit computer. Hitting the green button to continue on the right side to start the download and installation.
-
The coldfusion.sql.QueryTable value cannot be converted to a number
Hello
I have two queries, in two different functions, who both return the SUM of a column based on the values of the arguments
I need to subtract query from a query of 1 2.
The arguments for the two motions are passed using the CreateObject function
< cfset qry1 = createObject ("component", "components.adminobjects"). Func1(#argument1#,#argument2#) >
< cfset qry2 = createObject ("component", "components.adminobjects"). Func1(#argument1#,#argument2#) >
Queries executed accordingly and returns the results accordingly.
The problem occurs when I try to calculate by subtracting the 2nd request form 1.
So, to get the results I need, that's what I do:
< cfset results = ' #qry1.sum # '-' #qry1.sum2 # ' >
< cfoutput > #results # < / cfoutput >
When I do this, it is said:
The coldfusion.sql.QueryTable value cannot be converted to a number
I don't understand, it is because when I exit #qry1.sum # or #qry1.sum2 # I get the numbers right and they are numbers, but when I do some math on them, I get the error.
Any ideas?
Thank you.
Assuming that the qry1 object has a column named "sum1" and "sum2" try:
Also note that the "sum" is a reserved word, try to change the column "sum" "sum1".
http://help.Adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec173d0-7F ff.html
-
Form does not display the 'new' SQL database records
I have a PDF form that retrieves data from a SQL Server. The fields of
the PDF are filled from the database after you have selected a specific
record in a menu drop down and clicking a button called 'bridge '.
The problem is that the drop-down list does not display new records that
have been recently added to the database. I have to open the form
in the designer, and then save it, (* note - I change anything at this point.)
Then, when the form is opened upward in Adobe drop-down list show all
the documents, including the new ones. I even put a manual on refresh
form to try to solve the computer problem has not helped. Seriously left speechless.Any help is greatly appreciated.
Here is my code for the menu drop down.++++++++++++++++++++++++++++
topmostSubform.Page1.JobSelect::initialize - (JavaScript, client)
var sDataConnectionName = "BBCC" example - var sDataConnectionName
= 'Test ';
var sColHiddenValue = "ContractAdmin_Key"; example - var
sColHiddenValue = "Dept_ID";
var sColDisplayText = "JobDescription". example - var
sColDisplayText = "Dept_ID".Search for sourceSet node that match the name of DataConnection
var nIndex = 0;
While (xfa.sourceSet.nodes.item (nIndex) .name! = sDataConnectionName)
{
nIndex ++;}oDB var = xfa.sourceSet.nodes.item (nIndex);
oDB.open ();
oDB.first ();Search with the command 'class name' node
var nDBIndex = 0;
While (oDB.nodes.item (nDBIndex) .className! = 'command')
{
nDBIndex ++;}Save the original settings before you assign it, BOF and EOF to stay
var sBOFBackup =
oDB.nodes.item (nDBIndex).query.recordSet.getAttribute ("bofAction");
var sEOFBackup =
oDB.nodes.item (nDBIndex).query.recordSet.getAttribute ("eofAction");oDB.nodes.item (nDBIndex).query.recordSet.setAttribute ("stayBOF",
"bofAction");
oDB.nodes.item (nDBIndex).query.recordSet.setAttribute ("stayEOF",
"eofAction");Clear list
this.clearItems ();Find the record with the corresponding data connection name
nIndex = 0;
While (xfa.record.nodes.item (nIndex) .name! = sDataConnectionName)
{
nIndex ++;}var oRecord = xfa.record.nodes.item (nIndex);Find the value
var oValueNode = null;
var oTextNode = null;
for (var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex ++)
{If (oRecord.nodes.item (nColIndex) .name is sColHiddenValue)
{oValueNode = oRecord.nodes.item (nColIndex) ;} on the other
If (oRecord.nodes.item (nColIndex) .name == sColDisplayText) {oTextNode
= oRecord.nodes.item (nColIndex); } }While (!) ODB. IsEOF())
{
this.addItem (oTextNode.value, oValueNode.value);
oDB.next ();}Restore the original settings
oDB.nodes.item (nDBIndex).query.recordSet.setAttribute (sBOFBackup,
"bofAction");
oDB.nodes.item (nDBIndex).query.recordSet.setAttribute (sEOFBackup,
"eofAction");Close connection
oDB.close ();++++++++++++++++++++++
Here is the code for the button refresh
+++++++++++++++++++++
topmostSubform.Page1.Button27::click - (JavaScript, client)
sourceSet.BBCC.requery ();+++++++++++++++++++++
The other thing that could happen is a problem of refreshment in the DropDownList control. Try to add the command xfa.layout.relayout () after the database connection has been closed.
Paul
-
How to insert the value of the type in a value of type varchar date
Oracle forms 6i
Hai All
There are two tables T1, T2
T1 has these code varchar fields, the time varchar, date
T2 has these intimate date fields, outtime date intrinsically date, date of introut
I tried to change the time of Ie respondent T1 to T2
Update T2 intimate value = to_date(bartime|| bardate, «hh24mi maman-dd-yyyy»)...
It run but very well, but I got an error Ora-01861
Concerning
Srikkanth.MUpdate t2 set outtime = to_date (r1.bartime | hh24mi R1.bardate,'dd-MOM-yyyy "") that I wrote like this and it runs and I got an error 01861
One of your error is to set month format his KILLS not MOM
I guess bardate has the format DD-MON-RRRR then this request won't work
update t2 set outtime = to_date(r1.bardate||' '||r1.bartime, 'DD-MON-RRRR HH24MI') where......
---------------------
Take this into account in TO_DATE you tell Oracle that is my String don't String not really but it's date so for this, it must be said that your string contains this format date
To_date (Mystring, DateFormat);
for example
String is ' 2009/Jan/01 20:00 ' To_date would be like to_date (' 01/Jan/2009 20:00 ',' RRRR/MON/DD HH24 ')
It may be useful
If the answers are useful or correct please mark
Baig,
http://baigsorcl.blogspot.comPublished by: bamba on March 12, 2010 16:59
-
A question about the input within the PL/SQL block values
Hi all
I would be grateful if you could kindly help me with this issue well.
Consider the following code.
This program reads the three input values and print them. However, I have noticed that if instead of writingDECLARE myvar1 NUMBER; myvar2 NUMBER; myvar3 NUMBER; BEGIN myvar1 := &1; myvar2 := &2; myvar3 := &3; DBMS_OUTPUT.put_line('myvar1 = ' || myvar1); DBMS_OUTPUT.put_line('myvar2 = ' || myvar2); DBMS_OUTPUT.put_line('myvar3 = ' || myvar3); END; /
I am writingmyvar1 := &1; myvar2 := &2; myvar3 := &3;
The program will have the same result. I would like to know if there is a semantic difference between the two syntax,myvar1 := '&1'; myvar2 := '&2'; myvar3 := '&3';
in other words, there is no difference between for example & myvar1 and "myvar1?
Thanks in advance,
Dariyoosh& 1 would be a NUMBER
' & 1' would be a TANK, that would be implicitly converted to a NUMBER. -
Display the names and values of the parameters in the node parameter of forms
Hello
Is it possible to loopback programmatically via the node parameter forms get the name and value of each parameter. I don't know the name of the individual parameters in advance. I want to display the parameter names and values on a help screen generic as each of our reference forms.
I could do somewhat similar code to display all names of block in a first_block get_form_property property and nextblock property get_block_property is formed. I can't think in the same way as the parameter names and the values of the list if.
Any suggestions would be welcome.
Thank you
NeilNo, there is no standard built-in to browse Forms settings.
François
-
Type/conditional default value for a form element
Hello
I have an interactive report with a form on the table 'A' who 'Who' has columns like 'CREATED_BY', 'LAST_UPDATED_BY '. Now, I'm auto these columns in the form with the & APP_USER. function. The scenario occurs when the 'P' user clicks on the button 'CREATE' on the report, these columns of the report get populated info P. After committing this recording, the "Q" user edit this record even with the link 'Edit' in this folder. The two columns get populated by the Q news, ideally only LAST_UPDATED_BY should get populaed by the news of the Q and not the CREATED_BY column, as it is the 'P', which created this record.
To do this, I guess that in the type of default value for these items, I have to use "Body of the PL/SQL function" instead of "static text with Session of Substitutions in State". Problem is to know how to code the filter: If the user pressed 'create' button or the button "Edit". Help, please
Thank you
MaryHi Mary
Usually, I would do this sort of thing on a trigger. However, you could do the conditional CREATED_BY field on the primary key of the record is null (which is itself a new record, but it must have a value of an existing record). The LAST_UPDATED_BY field should not be conditional, as it should be the name of the user who recorded the record.
Andy
-
Display the description based on lookup_code
I have a drop down field (: P2_TEXT_FOUR) and a text field (: P2_TEXT_FIVE). I also have a table of form of choice in a different tab.
My question is when ever, I chose a drop down value, I need to display the description of this value from the search screen.
What I chose from the dropdown field (: P2_TEXT_FOUR) I need to display the description of the lookup_code value in (: P2_TEXT_FIVE).
Can anyone help?
See the example:
http://Apex.Oracle.com/pls/OTN/f?p=23974:1:1821547540657661:no
JCThis example of the great and end Carl B site is stil one of the best around: http://apex.oracle.com/pls/otn/f?p=11933:63
-
How to display the value of the variable for bottom of pl/sql
How to display the value of the variable for bottom of pl/sql
declare
V_1 number: = 10;
V_2 number: = 20;
V_3 number: = 30;
v_4 number: = 40;
v_5 number: = 50;
test varchar2 (100);
Start
I'm in 1.5
loop
test: = "v_" | I have;
dbms_output.put_line(i||) e > ' | test);
end loop;
end;
/
How to get below output:
1 > v_1
2 > v_2
3 > v_3
4 > v_4
5 > v_5
But I want to output of
1 > 10
2 > 20
3 > 30
4 > 40
5 > 50
Hello
You cannot reference variables as you did and get the value of the variable. Use pretty collection.
set serveroutput on size 2000 declare type number_table is table of number; numbers number_table := number_table(10, 20, 30, 40, 50); begin for i in numbers.first .. numbers.last loop dbms_output.put_line(i || '->' || numbers(i)); end loop; end; / anonymous block completed 1->10 2->20 3->30 4->40 5->50
See the Collections of PL/SQL and Records http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/composites.htm#LNPLS005
-
SQL query to display the sum of the values of each June and December
Hello having problems of construction of a query to the list SQL query to display the sum of the values of each June and December each year.
My Table;
TABLE name: MONTH_TERM
Fields with values:
TERM_KEY MONTH_ACTUAL MONTH_DATE 82 500 01/11/2015 0:00 82 450 01/12/2015 0:00 82 405 01/01/2016 0:00 82 400 01/02/2016 0:00 82 450 01/03/2016 0:00 82 425 01/04/2016 0:00 82 435 01/05/2016 0:00 82 410 06/01/2016 0:00 82 409 01/07/2016 0:00 82 415 01/08/2016 0:00 82 420 09/01/2016 0:00 82 422 10/01/2016 0:00 82 436 11/01/2016 0:00 82 556 01/12/2016 0:00 82 568 01/01/2017 0:00 82 624 02/01/2017 0:00 What I would like to see in a query result:
TERM_KEY MONTH_ACTUAL MONTH_DATE Total of 6 months 82 500 01/11/2015 0:00 82 450 01/12/2015 0:00 950 82 405 01/01/2016 0:00 82 400 01/02/2016 0:00 82 450 01/03/2016 0:00 82 425 01/04/2016 0:00 82 435 01/05/2016 0:00 82 410 06/01/2016 0:00 2525 82 409 01/07/2016 0:00 82 415 01/08/2016 0:00 82 420 09/01/2016 0:00 82 422 10/01/2016 0:00 82 436 11/01/2016 0:00 82 556 01/12/2016 0:00 2658 82 568 01/01/2017 0:00 82 624 02/01/2017 0:00 ---
Here's my query:
Select
"TERM_KEY,"
"MONTH_ACTUAL,"
to_char(MONTH_DATE,'MM/YYYY') MONTH_DATE,
DEAL to_char (MONTH_DATE, 'MM')
WHEN '06' THEN (SELECT SUM (MONTH_ACTUAL)
OF MONTH_TERM
WHERE the to_char (MONTH_DATE, 'MM') between 1 and 6
AND term_key = 82)
WHEN '12' THEN (SELECT SUM (MONTH_ACTUAL)
OF MONTH_TERM
WHERE the to_char (MONTH_DATE, 'MM') between 7 and 12
AND term_key = 82)
ELSE null
END as SIX_MO_CUMM,
of MONTH_TERM
where term_key = 82
It's my results:
TERM_KEY MONTH_ACTUAL MONTH_DATE Total of 6 months 82 500 01/11/15 0:00 82 450 01/12/15 0:00 3608 82 405 01/01/16 0:00 82 400 01/02/16 0:00 82 450 01/03/16 0:00 82 425 01/04/16 0:00 82 435 01/05/16 0:00 82 410 01/06/16 0:00 3717 82 409 01/07/16 0:00 82 415 01/08/16 0:00 82 420 01/09/16 0:00 82 422 10/01/16 0:00 82 436 01/11/16 0:00 82 556 01/12/16 0:00 3608 82 568 01/01/17 0:00 82 624 01/02/17 0:00 Any ideas on how to fix would be great
Select term_key,
month_actual,
month_date,
case mod (to_char (month_date, 'mm'), 6)
When 0 then sum (month_actual)
During)
term_key partition
order of month_date
between the previous month '5' interval and the current line
)
end '6 MONTHS in TOTAL'
from tbl
order of term_key,
month_date
/
TERM_KEY MONTH_ACTUAL MONTH_DAT 6 MONTHS TOTAL
---------- ------------ --------- --------------
82 500 NOVEMBER 1ST, 15TH
82 450 1 DECEMBER 15 950
82 405 1 JANUARY 16
82 400 1 FEBRUARY 16
82 450 1ST MARCH 16
82 425 1ST APRIL 16
82 435 1 MAY 16
82 410 2525 1 JUNE 16
82 409 1 JULY 16
82 415 1ST AUGUST 16
82 420 16 - SEP - 01TERM_KEY MONTH_ACTUAL MONTH_DAT 6 MONTHS TOTAL
---------- ------------ --------- --------------
82 422 1 OCTOBER 16
82-436 NOVEMBER 1, 16
82 556 2658 1 DECEMBER 16
82 568 1 JANUARY 17
82 624 1 FEBRUARY 1716 selected lines.
SQL >
SY.
-
How to display the value of sys_context in SQL Developer?
Hello
I can see the results via sqlplus with the following statements:
SYS_CONTEXT ('empno_ctx', 'empno_attrib') SELECT Empno_attrib FROM DUAL;
SELECT * FROM SESSION_CONTEXT;
the two retrieve correct values;
now, since I mainly work with SQL Developer I wanted to display the results in here too;
I ran the procedure in SQL Developer via a right click on the procedure-> run;
He looked like he ran ok.
However, when I do the queries above nothing is retrieved;
any suggestions?
Thank you
RgdsIt may be that the two things are running in different sessions.
What happens if you run them in a spreadsheet?
Start
procedure_call;
end;
/
Select sys_context... -
How can I tell SQL Developer to always display the datetime values in its entirety?
It's really annoying. Developer SQL displays only the date part of datetime variables. Good, if I preface every query with 'ALTER SESSION SET NLS_DATE_FORMAT = "DD-MON-YYYY HH24:MI:SS";', it will force the datetime value to display, but that it a nuisance!
How can we make SQL Developer ALWAYS display the full datetime value?SQLDeveloper it will display Date + 12:00:00 AM (depending on the format you chose). You will get no error. I published an article on this with screenshots, in my blog. If you are interested, you can read [here: | http://srinisboulevard.blogspot.com/2010/05/date-display-in-oraclesqldeveloper.html]
HTH
-rsrini -
Display the default value for POPUP LOV
Hello
How to display the default value for the element whose type is LOV POPUP?
Version 4.2 of the apex
Thank you.
Hi Sunil,
Sunil Bhatia wrote:
Change the default value to "SQL query"
And set the default value:
SELECT PERSON_ID PEOPLE WHERE USER_NAME = lower(:APP_USER);
-Sunil Bhatia
There is no default Type-> "SQL query".
BO123 :
Change the default value--> "Body of the PL/SQL function" Type and value by default to:
DECLARE L_PERSON_ID PEOPLE.PERSON_ID%TYPE; BEGIN SELECT PERSON_ID INTO L_PERSON_ID FROM PEOPLE WHERE USER_NAME = lower(:APP_USER); RETURN L_PERSON_ID; EXCEPTION WHEN NO_DATA_FOUND THEN RETURN NULL; END;
Better make a packaged function and just call that work instead of writing all the code by default the value of the item.
Kind regards
Kiran
-
Get the value of the pl/sql-generated form?
Hello
I have an APEX page with a dynamic region of PL/SQL. This region calls a PL/SQL procedure that generates html. In this html code, open a form with a text box (id = "txtUserEnteredText") waiting for user input. I need to know how to set the value of an element of APEX page on click of a button with text entered by the user. What I have tried is the next dynamic action for the button (without errors or data is returned):
-Dynamic action
Event: When a click on
Article type: button
Button: P20_GET_TEXT
-Action
Action: Set
Set type: Expression JavaScript
JavaScript expression: $x (document.getElementById('txtUserEnteredText').value);
-The items affected
Selection type: item (s)
Product (s): P20_DISPLAY_TEXT
What I expect is that the P20_DISPLAY_TEXT element will display the text entered by the user once the button is clicked. Another way to say that it is perhaps that I need is to know how to retrieve a value from a rendered HTML element already generated by the PL/SQL Web ToolKit via a dynamic region of PL/SQL. The HTML element in question is a text box that allows a user to enter text. I need to retrieve the text entered in the user in order to process these data instead of using Web ToolKit procedures.
I know it's a crazy way to do things, but I just need to know if I can do it and how.
I use APEX 4.2.2 on the 11.2.0.3 database.
Thank you
-Seth.
Here's what I did in the end to enter the data in the database...
1. at the level of the page, I created the following function to set the value of the hidden page element:
function setItemValue (pRequest) {}
var itemVal = $("input[name=txtUserEnteredText]").val ();
$("#P20_DISPLAY_TEXT").val (itemVal);
doSubmit (pRequest);
}
2. then, I created a point of region button named SUBMIT (as a redirect to URL) that called the function:
JavaScript:setItemValue('SUBMIT');
3. Finally, I created a process page (as after the presents... and when you press the button) call to a procedure of package to do the actual update:
pkg_name.proc_name(:P20_DISPLAY_TEXT);
Thank you
-Seth.
SPECIAL NOTE: I could never make this work in IE - only in Chrome, Firefox and Safari - due to an error of "Validation of Page protection.
Post edited by: backintheday "I added special note on browser differences.
Maybe you are looking for
-
Satellite Pro A10 - unable to connect to the internet
I have an old Satellite SPA10 who lost the internet connection a year ago.The components in question are:Ethernet controllerNetwork controllerVideo controllerVideo controller (VGA)I tried many attempts to install drivers to replace those already on,
-
circle of rotation (not connected)
Since Skype updated to 7.6 something the other day, I was unable to connect. I literally star in the program and it shows just the circle of rotation points, yet gets to the point where I can put in my log in details. I went to this since the update
-
The clips that hold the viewfinder cable electronics in place on his horse.
Have they broken for anyone else? I managed to break one of mine, and the other is like he's about to go too. * grumble grumble *. Are available as spare parts, anyone know? So cheap, I'll replace. If not, I'll convert to velcro or reuable tie.
-
Win XP Pro installation on different computers
I have some old programs that must be run on win xp pro. I just bought a brand new version of win xp pro sp3. I load it on my old computer that runs the home edition of vista. So I bought a new hard drive and I'll take the win xp pro. When this compu
-
SonicOS Enhanced 5.9.1.5 for 105W device
Earlier this year, I found an update at the beginning of the liberation of my current 5.9.1.1 - 39o "early release" firmware which was released in June 18, 2015. I upgraded to 5.9.1.5 and it doesn't seem like it no problem, but now, on the download s