Displaying Currency using SQL function
I need to display amount with decimal point and 2 zeros when there are none .
For eg $18 should be displayed as 18.00 ....
Which sql function should be used to do this.
Also is there any way to display Amount with commas .
For eg 1800000 should be displayed as 1,800,000
Any help in this regard is appreciated.
To display the $18 like 18.00 I think you would use the TO_CHAR function like this
TO_CHAR (retail,'$999.99') "retail price")
and I believe for the commas just add commas in like
TO_CHAR (retail,'$99,999,999.99') "retail price")
Edited by: user12036877 on Oct 9, 2009 9:55 AM
Similar Messages
-
Use sql function decode with Zend code
Hi,
I need to use sql function DECODE() in a query for PHP Code. This query works well in sql*plus but PHP returns
the following error message:
Parse error: syntax error, unexpected T_STRING in C:\Program Files\Zend\Apache2\htdocs\Compta\compta2.php on line 16
the query is :
$query =
'select substr(c.NUM,1 ,2) Compte ,
c.designation , a.Periode
,decode(substr(c.NUM,1 ,1), '1',1, '2',1,'3',1,-1) cp_type ,
sum(credit) - sum(debit) Montant
from ecritures a, clients b, compte c
where
b.NUM (+) =a.NUM
and a.DATEECRITURE between to_date(:debut, \'dd/mm/yy\') and to_date(:fin, \'dd/mm/yy\')
and substr(a.num,1,2) =c.num
group by substr(c.NUM,1 ,1), substr(c.NUM,1,2) , c.designation ,a.periode
order by compte ';
Can any one help me ???
Thanks by advance
nb: Iuse Zend 2.0Hi,
You need to escape single quote mark:
decode(substr(c.NUM,1 ,1), \'1\',1, \'2\',1,\'3\',1,-1) cp_type ,
the same way you did for to_date:
to_date(:debut, \'dd/mm/yy\')
Regards,
Paweł -
How to use SQL functions in the queries
hey guys i wanna know how to use SQL functions in the queries is it possible or not .
Hi,
Wat exactly that set values are?
those from sql query?
How to use count():
The COUNT() function returns the number of rows that matches a specified criteria.
SQL COUNT(column_name) Syntax
The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column:
SELECT COUNT(column_name) FROM table_name
SQL COUNT(*) Syntax
The COUNT(*) function returns the number of records in a table:
SELECT COUNT(*) FROM table_name
SQL COUNT(DISTINCT column_name) Syntax
The COUNT(DISTINCT column_name) function returns the number of distinct values of the specified column:
SELECT COUNT(DISTINCT column_name) FROM table_name
The IN function helps reduce the need to use multiple OR conditions.
The syntax for the IN function is:
SELECT columns
FROM tables
WHERE column1 in (value1, value2, .... value_n); -
Use SQL function to get the original order number using the invoice number
Hi All,
wondering is someone can help me with this challenge I am having? Often I need to return the original order numbers that created the resulting invoce. This is a relatively simple seriese of joins in a query but I am wanting to simplify it using a SQL function that can be referenced each time easily from with in the SELECT statement. the code i currently have is:
Use SQL function to get the original order number using the invoice number
CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
RETURNS nvarchar(200)
AS
BEGIN
DECLARE @OrderList nvarchar(200)
SET @OrderList = ''
SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
FROM OINV AS T1 INNER JOIN
INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
ORDR AS T6 ON T5.DocEntry = T6.DocEntry
WHERE T1.DocNum = @InvNum
RETURN @OrderList
END
it is run by the following query:
Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
From OINV T1
Where T1.DocNum = 'your invoice number here'
The issue is that this returns the order number for all of the lines in the invoice. Only want to see the summary of the order numbers. ie if 3 orders were used to make a 20 line inovice I only want to see the 3 order numbers retuned in the field.
If this was a simple reporting SELECT query I would use SELECT DISTINCT. But I can't do that.
Any ideas?
Thanks,
MikeThanks Gordon,
I am trying to get away from the massive table access list everytime I write a query where I need to access the original order number of the invoice. However, I have managed to solve my own problem with a GROUP BY statement!
Others may be interested so, the code is this:
CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
RETURNS nvarchar(200)
AS
BEGIN
DECLARE @OrderList nvarchar(200)
SET @OrderList = ''
SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
FROM OINV AS T1 INNER JOIN
INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
ORDR AS T6 ON T5.DocEntry = T6.DocEntry
WHERE T1.DocNum = @InvNum
GROUP BY T6.DocNum
RETURN @OrderList
END
and to call it use this:
Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
From OINV T1
Where T1.DocNum = 'your invoice number' -
Using sql functions (min, max, avg) on varray or table collection
Hi,
I would like to know if there is a way to use sql function or oracle sql function like Min,Max, Avg or percentile_cont on varray or table collection ?
Does anyone encountered this type of problem ?
ThanksYes you can apply Min,Max, Avg... if varray or table collection type is SQL (created in the databaase) UDF, not PL/SQL declared type:
SQL> set serveroutput on
SQL> declare
2 type str_tbl_type is table of varchar2(4000);
3 str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
4 max_val varchar2(4000);
5 begin
6 select max(column_value)
7 into max_val
8 from table(str_tbl);
9 dbms_output.put_line('Max value is "' || max_val || '"');
10 end;
11 /
from table(str_tbl);
ERROR at line 8:
ORA-06550: line 8, column 18:
PLS-00642: local collection types not allowed in SQL statements
ORA-06550: line 8, column 12:
PL/SQL: ORA-22905: cannot access rows from a non-nested table item
ORA-06550: line 6, column 5:
PL/SQL: SQL Statement ignored
SQL> create or replace type str_tbl_type is table of varchar2(4000);
2 /
Type created.
SQL> declare
2 str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
3 max_val varchar2(4000);
4 begin
5 select max(column_value)
6 into max_val
7 from table(str_tbl);
8 dbms_output.put_line('Max value is "' || max_val || '"');
9 end;
10 /
Max value is "ZZZ"
PL/SQL procedure successfully completed.
SQL> SY. -
How to use SQL() function while writing scripts in BODS 4.0
How to use SQL() function while writing scripts in BODS 4.0
Hello,
I think you want to post your question to the [Data Integration and Data Quality Management|Data Services and Data Quality; forum. This forum is for other BusinessObjects SDK development questions.
Sincerely,
Dan Kelleher -
Using Sql Functions in Crystal Reports
Can SQL table-valued functions be used in Crystal Reports? The only options I see in the Database Expert are Tables, Views, and Stored Procedures.
Hi Dan,
Are you referring to user-defined SQL functions? If yes, then these are not accessible in Crystal Reports.
You would need to create a stored procedure which calls the function and does the processing and use this procedure in CR.
- Abhilash -
Utils is a packege then should i use sql function in place of utils.
Hi,
while translating my sp from mssql to oracle few code is converted into : utils
utils is a package i think so is it good to use it or should i find any sql equivenlent function.
then please tel me oracle sql function for utils.patindex();
yours sincerelyPlease bear in mind that most people here know Oracle but not SQL Server. So if you wish to use us as a translation service it would be helpful if you told us what the SQL Server function does.
Googling for [url http://msdn.microsoft.com/en-US/library/ms188395(v=sql.90).aspx]PATINDEX() reveals that it is a function which returns the position of a pattern in a string. --The Oracle equivalent is INSTR(). [url http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions080.htm#sthref1174]Find out more.--
Just to prove the point I now think INSTR() is the equivalent of CHARINDEX and what you actually want is one of the regex functions such as REGEXP_INSTR() [url http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions148.htm#sthref1419]Check it out.
Oh, and please, don't use us as a translation service. Read the Oracle documentation or [url http://www.google.co.uk/#q=ms+sql+patindex+oracle&oq=ms+sql+patindex+oracle]use Google.
Cheers, APC
Edited by: APC on Feb 28, 2013 6:10 AM -
Displaying alias using MemberAlias function
Hi,
In my HFR report, I have Product dimension in the Page axis as user prompt. I need to display the prompt selection in the report header. For that I am using the function MemberAlias.
MemberAlias("Grid1",Current,"Product"). But this doesn't return the alias of the selected Product member. It shows the member name.
This problem occurs for the dimensions which are there in the Page axis. For dimensions on Row and Column axis, it works fine.
Please help.
Thanks in advance
-AparnaHi Aparna,
Sorry I was a little distracted. member name can never display alias. :-)
Actually this is a bug in a FR that page member, never shows up alias by using functions.
Anyway what can you do as a work around, is to create a another grid having prompt on that dimension. Define prompt exactly in the same way as in the first grid. Then use merge similar prompts option in the workspace, so that user get it only once.
Then refer the cells of the second grid to get alias inside a text box. and for that either you can use <<Getheading >> or <<MemberAlais >>
fucntions. Hope this will help you to get what you want.
Regards,
Rahul -
Displaying table using call function 'REUSE_ALV_GRID_DISPLAY'
I have created a table which has product code, product description, and product level. I am trying to display it using REUSE_ALV_GRID_DISPLAY. When I Check it, I get the following error message: "PVS2" is not an internal table - the "Occurs n" specification is missing.
Is it possible to copy PVS2 into another table, and then display that table using REUSE_ALV_GRID_DISPLAY?
I have patched together code from sdn, a client program, and my own code and I am starting to get confused. So, please help me.
Regards,
Al Lal
REPORT YABHINAV16.
* program to display products at chosen level *
Tables: T179, T179t.
types: begin of hierarchy,
prodh type t179-prodh,
vtext type t179t-vtext,
stufe type t179-stufe,
end of hierarchy.
types: begin of text,
prodh type t179t-prodh,
vtext type t179t-vtext,
end of text.
data: pvs type standard table of hierarchy initial size 0.
data: pvs2 type hierarchy.
data: it_text type standard table of text,
wa_text type text.
TYPE-POOLS:SLIS.
*For ALV
DATA: GT_FLD TYPE SLIS_T_FIELDCAT_ALV,
GT_EV TYPE SLIS_T_EVENT,
GT_HDR TYPE SLIS_T_LISTHEADER,
GT_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA: WA_FLD TYPE SLIS_FIELDCAT_ALV,
WA_EV TYPE SLIS_ALV_EVENT,
WA_HDR TYPE SLIS_LISTHEADER,
WA_SORT TYPE SLIS_SORTINFO_ALV,
WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
DEFINE FLD.
WA_FLD-FIELDNAME = &1.
WA_FLD-TABNAME = &2.
WA_FLD-OUTPUTLEN = &3.
WA_FLD-SELTEXT_L = &4.
WA_FLD-SELTEXT_M = &5.
WA_FLD-SELTEXT_S = &6.
WA_FLD-COL_POS = &7.
WA_FLD-FIX_COLUMN = &8.
WA_FLD-DO_SUM = &9.
APPEND WA_FLD TO GT_FLD.
CLEAR WA_FLD.
END-OF-DEFINITION.
CONSTANTS: C_TOP TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
C_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
DATA: MTRL LIKE SY-REPID,
TITLE LIKE SY-TITLE.
select-options level for t179-stufe no intervals.
start-of-selection.
Select prodh stufe from T179 into corresponding fields of table pvs where stufe in level.
select prodh vtext from t179t into corresponding fields of table it_text for all entries in pvs where prodh = pvs-prodh.
end-of-selection.
sort pvs by prodh.
sort it_text by prodh.
loop at pvs into pvs2.
read table it_text into wa_text with key prodh = pvs2-prodh.
if sy-subrc eq 0.
pvs2-vtext = wa_text-vtext.
write: / pvs2-prodh, pvs2-vtext, pvs2-stufe.
endif.
* modify pvs2.
endloop.
perform BUILD_FIELDCAT.
perform GRID_DISPLAY.
form BUILD_FIELDCAT .
FLD 'PRODH' 'PVS2' '20' 'Product Hierarchy' ' ' ' ' '1' '' '' .
FLD 'VTEXT' 'PVS2' '40' 'Description ' ' ' ' ' '3' '' '' .
FLD 'STUFE' 'PVS2' '5' 'Level' ' ' ' ' '2' '' '' .
endform. " BUILD_FIELDCAT
form GRID_DISPLAY .
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = MTRL
I_CALLBACK_USER_COMMAND = 'C_USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = C_TOP
I_STRUCTURE_NAME = 'PVS2'
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = GT_FLD
IT_SORT = GT_SORT
I_DEFAULT = 'X'
I_SAVE = 'U'
IT_EVENTS = GT_EV
TABLES
T_OUTTAB = PVS2[]
EXCEPTIONS
PROGRAM_ERROR = 1
others = 2.
if SY-SUBRC <> 0.
message id SY-MSGID type SY-MSGTY number SY-MSGNO
with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " GRID_DISPLAYTYPE-POOLS : SLIS.
DATA : BEGIN OF WA_T001,
BUKRS LIKE T001-BUKRS,
BUTXT LIKE T001-BUTXT,
ORT01 LIKE T001-ORT01,
END OF WA_T001,
IT_T001 LIKE TABLE OF WA_T001.
DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT.
DATA : V_NAME LIKE SY-REPID.
SELECT BUKRS BUTXT ORT01 FROM T001 INTO TABLE IT_T001 UP TO 15 ROWS. V_NAME = SY-REPID.
CALL FUCTION MODULE 'REUSE_ALV_FIELDCATLOG_MERGE. EXPORTING I_CALBACK_PROGRAM =
V_NAME I_INTERAL_TABNAME = 'WA_T001' I_INCLNAME = V_NAME CHANGING CT_FIELDCAT =
IT_FCAT.
CALL FUNCTION MODULE "REUSE_ALV_GRID_DISPLAY"
EXPORTING
I_CALLBACK_PROGRAM = V_NAME
IT_FCAT = IT_FCAT.
TABLES
T_OUTTAB = IT_T001
SY-REPID IS THE SYSTEM VARIABLE WHICH IS HAVING THE ABAP PROGRAM
OR CURRENT MAIN PROGRAM.
----- Sample Progam -
***INCLUDE YRVR058_DEST_WISE_SUMMARY_DF01 .
*& Form DISPLAY_DATA
text *-- Rajesh Vasudeva
--> p1 text
<-- p2 text
FORM DISPLAY_DATA .
IF ITAB[] IS NOT INITIAL.
PERFORM F_APPEND_BLOCK.
ELSE.
MESSAGE 'Data not found for the selection
criteria' TYPE 'S'.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " display_data
*& Form f_append_block
text
--> p1 text
<-- p2 text
FORM F_APPEND_BLOCK .
DATA : L_WA_SORT TYPE SLIS_SORTINFO_ALV, "For
sort
L_WA_EVENTS TYPE SLIS_ALV_EVENT. "For
events
Event (Top of List)
CLEAR L_WA_EVENTS.
L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_LIST.
L_WA_EVENTS-FORM = C_TOPOFPAGE.
APPEND L_WA_EVENTS TO I_EVENTS_PART.
Event (Top of Page)
CLEAR L_WA_EVENTS.
L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
L_WA_EVENTS-FORM = 'F_DISPLAY_HEADER_PARTA'(031).
"f_display_header_part
APPEND L_WA_EVENTS TO I_EVENTS_PART.
Event (End of List)
CLEAR L_WA_EVENTS.
L_WA_EVENTS-NAME = SLIS_EV_END_OF_LIST.
L_WA_EVENTS-FORM = C_END_OF_LIST.
APPEND L_WA_EVENTS TO I_EVENTS_PART.
Set Layout Zebra
STRUCT_LAYOUT-ZEBRA = 'X'.
STRUCT_LAYOUT-NUMC_SUM = 'X'.
STRUCT_LAYOUT-TOTALS_TEXT = 'TOTAL:'(032).
set field catalog
PERFORM F_FIELD_CATALOG_PART.
ASSIGN ITAB[] TO <F_OUTTAB>.
V_PART = 'A'. "initiating list is A
PERFORM F_DISPLAY_BLOCK USING STRUCT_LAYOUT
I_FIELD_CAT_PART[]
C_TAB
I_EVENTS_PART[]
I_SORT_PART[].
ENDFORM. " f_append_block
*& Form f_field_catalog_part
text
--> p1 text
<-- p2 text
FORM F_FIELD_CATALOG_PART .
REFRESH I_FIELD_CAT_PART.
CLEAR I_FIELD_CAT_PART.
PERFORM F_CREATE_CATALOG USING :
*Month
C_TAB 'MONTH' 'MONTH' SPACE 'L' 7
I_FIELD_CAT_PART[],
*OBD
*C_TAB 'VBELN' 'Delivery' SPACE 'L' 12
I_FIELD_CAT_PART[],
*DATE
C_TAB 'WADAT_IST' 'Date' SPACE 'L' 10
I_FIELD_CAT_PART[],
*Destination
C_TAB 'CITY1' 'Destination' SPACE 'L' 25
I_FIELD_CAT_PART[],
*Qty By Road
C_TAB 'NTGEW_ROAD' 'Road Quantity' SPACE 'R' 16
I_FIELD_CAT_PART[],
*Rail Qty
C_TAB 'NTGEW_RAIL' 'Rail Quantity' SPACE 'R' 16 I_FIELD_CAT_PART[],
*Total Qty C_TAB 'TOT' 'Total Quantity' SPACE 'R' 16 I_FIELD_CAT_PART[], *RR/Trk No.
C_TAB 'EXTI2' 'Truck/RR No.' SPACE 'L' 17 I_FIELD_CAT_PART[].
ENDFORM. " f_field_catalog_part
*& Form f_DISPLAY_block
text
-->P_STRUCT_LAYOUT text
-->P_I_FIELD_CAT_PART[] text
-->P_C_TAB text
-->P_I_EVENTS_PART[] text
-->P_I_SORT_PART[] text
FORM F_DISPLAY_BLOCK USING FP_LAYOUT TYPE
SLIS_LAYOUT_ALV
FP_I_FCAT TYPE
SLIS_T_FIELDCAT_ALV
VALUE(FP_TABNAME) TYPE
ANY
FP_I_EVENTS TYPE
SLIS_T_EVENT
FP_I_SORT TYPE
SLIS_T_SORTINFO_ALV.
DATA: V_REPID TYPE SYREPID,
"current Program id
C_SAVE TYPE CHAR1 VALUE 'A'.
"variant save
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
*CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IS_LAYOUT = FP_LAYOUT
IT_FIELDCAT = FP_I_FCAT[]
IT_SORT = FP_I_SORT[]
I_SAVE = C_SAVE "variant
save
IT_EVENTS = FP_I_EVENTS[]
TABLES
T_OUTTAB = <F_OUTTAB>
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " f_DISPLAY_block
*& Form f_create_catalog
text
-->P_C_TAB text
-->P_0085 text
-->P_0086 text
-->P_SPACE text
-->P_0088 text
-->P_5 text
-->P_I_FIELD_CAT_PART[] text
FORM F_CREATE_CATALOG USING FP_I_TABNAME TYPE
SLIS_TABNAME
FP_I_FIELDNAME TYPE SLIS_FIELDNAME
FP_I_SELTEXT TYPE
SCRTEXT_L
FP_I_DOSUM TYPE
CHAR1
FP_I_JUST TYPE C
FP_I_OUTPUTLEN TYPE
OUTPUTLEN
FP_I_FCAT TYPE
SLIS_T_FIELDCAT_ALV.
Record for field catalog
DATA: L_REC_FCAT TYPE SLIS_FIELDCAT_ALV.
L_REC_FCAT-TABNAME = FP_I_TABNAME.
L_REC_FCAT-FIELDNAME = FP_I_FIELDNAME.
L_REC_FCAT-SELTEXT_L = FP_I_SELTEXT.
L_REC_FCAT-DO_SUM = 'X'.
*l_rec_fcat-do_sum = ' '.
L_REC_FCAT-JUST = FP_I_JUST.
L_REC_FCAT-OUTPUTLEN = FP_I_OUTPUTLEN.
L_REC_FCAT-DECIMALS_OUT = '2'.
L_REC_FCAT-KEY = '1'.
APPEND L_REC_FCAT TO FP_I_FCAT.
ENDFORM. " f_create_catalog
Subroutines for Headings
*& Form f_display_header_partA
Display header for report for Part A
*& Form top_of_page
text
--> p1 text
<-- p2 text
FORM TOP_OF_PAGE .
SKIP 1.
WRITE:/25 ' Name of Company ',80 'RUN DATE' ,
SY-DATUM.
SKIP 1.
WRITE:/60 'RUN DATE' , SY-DATUM.
SKIP 1.
DATA: YR(4) TYPE N,
FIN_PRD(10) TYPE C.
IF S_DTABF-LOW+4(2) LT '04'.
YR = S_DTABF-LOW+0(4) - 1.
CONCATENATE YR '-' S_DTABF-LOW+2(2) INTO FIN_PRD.
ELSE.
YR = S_DTABF-LOW+0(4) + 1.
CONCATENATE S_DTABF-LOW0(4) '-' YR2(2) INTO
FIN_PRD.
ENDIF.
WRITE:/5 'DETAILS OF THE MONTH/DATE WISE DESPATCHES
MADE BY ROAD/RAIL DURING THE YEAR ' , FIN_PRD .
SKIP 1.
WRITE :/ 'SALES OFFICE : ' , P_SALES,' ' , RNAME.
SKIP 1.
ENDFORM. " DISPLAY_DATA
Award Points If Useful... -
How to use SQL function in Tabular Form
Edited by: JuniorNewbi on 03-Nov-2009 08:15
Hi
I want to have a Tabular Form in which the Report Source sql statement is retrieved via an SQL function, so that the resulting report can show a variable number of columns and column names.
The following great web site shows just the kind of thing i'm trying to do (Tabular Form Dynamic):
http://htmldb.oracle.com/pls/otn/f?p=31517:195:518536699796436::NO:::
However, as an Apex newbie, i don't know how to invoke the SQL function from within the page. The "Report Source" appears to only allow a static "select...." style of entry.
I don't have access to the Denes Kubicek's workspace so don't know how he would have invoked his PL/SQL Function.
Can anyone help?
Thanks in advance!
Edited by: JuniorNewbi on 03-Nov-2009 08:46 -
Using sql function in xml sql statement
Hello,
I have following statement:
select field1, field2,....,field10 from table( cast (get_mhdata(:1,:2) as mhdata))
where mhdata is an oracle type with 10 fields.
It works good, but I don't know how can I use this statement in xml sql statement.
Please, can you tell me if it is really possible.
Thanks in regards.Hi
You cant pass the parameters if you are executing writing this select function from the communication channel.
You have 3 options:
1) Use a stored procedure and execute from the communication channel
2) Use a stored procedure and execute via message mapping in the IR - here you can pass parameters
3) Same as above but call the query via SQL select - you can also pass parameters.
sincerely,
--NM -
3.1EA1: Column Headings don't display when using SQL*Plus formatting
The Col[umn] command doesn't show the column headings or the total lines in sqldev. This SQL command:
-- Size per datafile
col tablespace_name format a10 head 'Tablespace'
col file_name format a40 head DataFileName
col cursize form 999.99 head "CurrSize|GB"
col maxsize form 999.99 head "MaxSize|GB"
col Autoextensible form a4 head "Auto"
break on tablespace_name
compute sum label Total of cursize maxsize on tablespace_name
select tablespace_name,
file_name,
bytes/1024/1024/1024 cursize,
maxbytes/1024/1024/1024 maxsize,
autoextensible
from dba_data_files
where tablespace_name = 'TS_DP'
Looks like this in sqldev:
TS_DP /ddawno/oradata/data01/dp_data22.dbf 1.76 1.76 YES
TS_DP /ddawno/oradata/data01/dp_data01.dbf 1.76 1.76 YES
22 rows selected
But looks like this in SQLPlus:
CurrSize MaxSize
Tablespace DataFileName GB GB Auto
TS_DP /ddawno/oradata/data01/dp_data22.dbf 1.76 1.76 YES
/ddawno/oradata/data01/dp_data01.dbf 1.76 1.76 YES
Total 36.20 31.64
22 rows selected.
Edited by: 893982 on Nov 1, 2011 11:09 AM Fix dashed line formatting.Hi, thanks for the response.
No, I do not have "set heading off" somewhere. What I pasted into my original post is the entire script that I am running from the worksheet, and I am not using a startup script.
Odd that the column formatting works for you, yet the list of unsupported commands that you pointed me to says that col[umn] is not supported. Help column from within sqldev contradicts that documentation, showing that col[umn] is supported, but only for the "NEW_V[ALUE] syntax."
Wow, there's nothing like enabling the most obscure keyword just to be able to say that a function is supported. Oh, well, at least the scripts that I download from the web run now. In 3.0 they died with a hard error just because the col[umn] keyword was used. -
Call to a possibly undefined method displays when using static function in Unit Test
Hello!
This has been driving me nuts. I am setting up unit tests for a static class which manages a collection of songs. This is how my unit test class looks:
//START CODE
package flexUnitTests {
import com.myapp.managers.MusicManager;
import flash.utils.Dictionary;
import flexunit.framework.Assert;
public class MyAppManagerTest {
[Before]
public function setUp():void {
var songData:Dictionary = new Dictionary();
songData["mn0012345"] = new Dictionary();
songData["mn0012345"]["title"] = "All the Pretty Little Horses";
songData["mn0012345"]["description"] = "by: American Traditional | Voice, Piano | 3 pages";
MusicManager.setSongData(songData);
[Test]
public function test_getAuthorsBySKU():void {
var expected:String = "American Traditional";
var given:String = MusicManager.getAuthorsBySKU("mn0012345");
Assert.assertEquals(expected, given);
//END OF CODE
You will notice two calls in red above. When I leave them in the code I see a variety of errors which look like this:
"Call to a possibly undefined method '' through a reference with a static type com.myapp..."
And
"Access of possible undefined property '' through a reference with static type com.myapp..."
Then, when I comment out the two lines in red above, these errors go away. Flash Builder seems really flakey to me. Often I notice that the error list varies, how can it just no longer be an error? Where did this new access error come from, in a no related part of the code, by adding or removing a function call to a static class which remains in the import statement.
Note that the MusicManager contains no references to any of the UI mxml that is throwing these errors. It just simply loads data into a few globals and allows you to grab info.
How is my usage of this function making foreign objects inaccessible?
Please help!!! I am really hoping there is an answer but I have a bad feeling the answer is just that Flash Builder is flakey.I did some more work on the issue above. There are functions with in the MusicManager that call the UserManager to get a user's ID. When I comment out these calls then the access errors go away. Well the user manager has some calls back to mxml that tell the class that changes where made. My best guess is this is where it stems into the code that is randomly throwing errors. But, it compiles fine and runs fine on a device. Is there something with test cases which doesn't invoke the UI?
-
How to use SQL Functions (eg : GETDATE()) in Receiver JDBC XML message
Hi,
I am using receiver JDBC adapter.
When record is updated in table, "Timestamp" field should be updated with Database timestamp.Hi Dipak,
Check out below helpful links,
MySQL :: MySQL 5.6 Reference Manual :: 11.3.5 Automatic Initialization and Updating for TIMESTAMP and DATETIME
MySQL :: MySQL 5.0 Reference Manual :: 11.3.5 Automatic Initialization and Updating for TIMESTAMP
Regards,
Krupa
Maybe you are looking for
-
How do you export a pdf from acrobat dc to dropbox on a mac
I have been using dropbox for years and have never had a problem exporting a pdf to it until I got Adobe Acrobat DC. Please tell me how to export to a dropbox file.
-
After a recent firmware update, my Mac Mini will not startup with the HDMI cable plugged in. It beeps three times at startup and won't boot. If I unplug the HDMI cable it starts up just fine and then I can plug in the HDMI and get the screen working.
-
IPhone screen size in Photoshop
I'm designing UI for iPhones starting at 2X image size retina display. What screen size should I set up in Photoshop?
-
Raido icon next to tracks in my libary
Not sure what happend but, I recently installed itunes 5 and now I am seeing some extra tracks in my libary. These tracks have the radio icon next to the check mark, they are duplicate tracks of songs I already have in my libary. Could someone please
-
Does HDMI out also mirror iPad 1? It fully mirrors iPad 2, but does it for 1? I'm thinking about getting it.