-
Convert the Period_Name in GL_JE_Lines table to a date format and then come back year
I'm working on a data model BI Publisher and I try to convert the Period_Name in GL_JE_Lines table to a date format and then return of the year.
The sql below works in 11i, but I can't make it work in Fusion.
to_char (to_date (l. )) period_name , ' MON-RR ' ),'YYYY')
Any ideas?
Hi Jennifer,.
To_char (sysdate, 'DDMONYYYY') in BI Publisher does not return a correct results due NLS_DATE_FORMAT/DATE_LANGUAGE settings.
According to the standards of the I18N, NLS_DATE_LANGUAGE in the database is still hardcoded to NUMERIC_DATE_LANGUAGE. NUMERIC_DATE_LANGUAGE 'MY' in a date format mask is an integer, so you see the correct value.
You're not supposed to publish direct SQL with fixΘe format masks (unless it's some sort of canonical format used in internal processing, including the end-user will not be), you should return language digital date to the mid range and then make the formatting of y.
Workaround
Try adjusting the NLS_LANGUAGE in SQL data model to override formatting from of the
Data base and values of the Session, for ex: select to_char (sysdate, 'MON-DD-YYYY', 'NLS_DATE_LANGUAGE = AMERICAN') of double;
I got this Oracle support after lifting a SR.
Thank you
Rahul.
-
convert the money data type in a decimal format 2.
What is the best way to convert the money data type in a decimal 2 format in ms sql 2005 for use in my applications.
This?
CAST (tr.depositReceivedAmount AS decimal (10, 2))
I respectfully disagree with the idea that you must change the query column a type of 'money' data to something else.
In most database servers, "«argent» Silver" is a data type that is designed to provide a very homogeneous behaviour with regard to the arithmetic accuracy. In Microsoft Access, the representation is a the whole scale. MS SQL Server, it is obviously similar. Ditto Oracle and others.
You like that the money data type in the database for this clarification, because "hell has no fury like an accountant looking for a bad penny." The column of database storage formats are designed to satisfy the accountants, and it's a good thing.
Meanwhile, you also want to take care as to exactly how you are dealing with values. There are several points where the district could take place. You don't have available the strongest possible manipulation of the floating of the data types in ColdFusion. You also are somewhat at the mercy of any interface software can be between you and that SQL server, you can use. "It is correct to all about values , but not several times."
I suggest to round the value just before the display and user input must be two decimals.
Then, you may need to do some things at the end of SQL server. For example, when you update a value in the table, you may need to use logical server to explicitly truncate the value to two decimal places, as well as an update of "$ 34,56" explicitly updates the column "$34,5600.." (This kind of thing should happen in the context of SQL Server). You know that the user entry has exactly two significant digits, but maybe (maybe not...)! SQL server may not know this. You want to ensure that the stored server internally represents exactly two digits, when the origin of a user input value.
Do not err on the side of "convenience" or "which seems." good on the screen (If you do, get ready get telephone communications of the accountants, always at inappropriate times of the night.)
-
convert the varchar2 data type to the data number type
How to convert the varchar2 data type to the data type number.
It looks like my data
create table one)
col1 varchar2 (50)
col2 varchar2 (500);
Insert in a (col1, col2) values ('1234 ', ' 2345');
Select Column1 of number (19)) cast (to_number (col1);
IAM getting error invalid number
I need to create a table with the same columns with data like number types (19)
can someone help me
Thank you You have changed your original post, so now I see that you get the invalid number.
This is why you should always avoid the varchar columns to store numbers or dates...
Since your table source contains a nonnumeric value, you can write a pl/sql to convert data and see what records are false:
SQL> insert into a (col1,col2) values ('xxxx','2345');
1 row created.
SQL> select * from a;
COL1 COL2
-------- --------
1234 2345
xxxx 2345
2 rows selected.
SQL> create table b (col1 number(19), col2 number(19));
Table created.
SQL> set serverout on
SQL> declare
2 cursor c is
3 select * from a;
4 begin
5 for r in c loop
6 begin
7 insert into b values (to_number(r.col1), to_number(r.col2));
8 exception
9 when invalid_number then
10 dbms_output.put_line('Row rejected: col1='||r.col1||' col2='||r.col2);
11 end;
12 end loop;
13 end;
14 /
Row rejected: col1=xxxx col2=2345
PL/SQL procedure successfully completed.
SQL> select * from b;
COL1 COL2
---------- ----------
1234 2345
1 row selected.
Max
Published by: Massimo Ruocchio, June 14, 2011 20:00
Added the first query in the example
-
I am trying to create layers with a JPEG originally published in LR6. I converted the JPEG in a TIF format for my PES 11. PSE does not recognize the file for purposes of superposition; None of the routes command works. Just to see if PES was grateful the
I am trying to create layers with a JPEG originally published in LR6. I converted the JPEG in a TIF format for my PES 11. PSE does not recognize the file for purposes of superposition; None of the routes command works. Just to see if PES was grateful the file at all, I tried to turn the file. Fortunately, he rotates the photo and turned it back. Why the program allow me to create layers?
You click on Expert in pse before trying to add layers?
Or it is possible that the image is 16-bit/channel.
In photoshop elements go to Image > Mode and click on 8-bit/channel and see if that makes a difference.
-
I want to convert the double data type to string type
I want to convert the double data type to string, have idea about that Hello
Use f
FN: String (ARG) returns the string value of the argument. The argument can be a number, boolean, or node-set element
Example: string (314)
Result: "314".
http://w3schools.com/XPath/xpath_functions.asp#string
See you soon,.
Vlad
-
The variable "date" is also defined in the regular transition is used?
Hello
I needed to understand if the variable "date" is also set when the due transition is used. The reason I ask is the scenario that we saw:
1. There is a regular transition form an interactive activity on an automatic
2. the automatic was an error of syntax (typo) in a SQL statement
3. when the proceedings reached this automatic... instance abandoned... [level of process Exception Management is not present :(]
My first thought was that there is an instanceExpiration exception, but wasn't sure.
A son would be nice... As you know, there are two deadlines:
1. a delay of the process defined by the predefined variable of time and
2. a period for one instance of a work item within an Interactive activity which has a regular transition.
The column "Deadline" by default in the workspace shows one of two deadlines that will expire the first.
Dan
-
Parameter IN or OUT to missing index: 1 using the variable date ODI.
Hello
I created the variable of data type date as EXTRACT_FROM_TS and also the default value for this.
Now I use this variable as a filter in the source table in the design of the Interface as below...
LAST_UPDATE_DATE > = #p_extract_from_ts where LAST_UPDATE_DATE is the field in the source database with date data type not null not forced...
I have lkm hv used SQL for Oracle...
Above variable refresh and interface scenario running one after another in ODI package...
Variable gets refresh every time successfully, but Interface fails at the step of loading data... error message as below...
ODI-1227: SrcSet0 (load) task fails on the source of ORACLE R12DEV connection.
Caused by: java.sql.SQLException: parameter IN or OUT to missing index: 1
+ oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1890) +.
If we remove the filter LAST_UPDATE_DATE > = #p_extract_from_ts, then it works well...
I do not know why this error pops up on adding filter... Please help on this...
Thank you
Roshan Y Hello
put a step DECLARATION above all. After that in my opinion, it is better to put a TO_CHAR().
Try putting your variable in text mode and change your filter in
TO_CHAR (LAST_UPDATE_DATE, 'YYYYMMDDHHMI') > = TO_CHAR(#PROJ.) P_EXTRACT_FROM_TS, "YYYYMMDDHHMI")
In your operator if you click on the variable whose value you see?
-
Convert the XMP Date and time
Hi, in my script I try to read the Date and time using the functions of a file selected in bridge XMP. So, I want to convert this date and time in a format that looks like: "12/01/10 | 13:23 "and writing, to another field of metadata, like the description. Im stuck trying to convert the date and time in I want it looks like? Someone can help, thanks!
Here is the part of the code, with the fact that I have a problem:
When I read the dateTimeOriginal file property, it's in an unfriendly format. It seems strange and indicates the time zone. The commented lines is the code that I tried, but didn't work. I tried to convert the XMPDateTime object in a Date object so I can adjust the format, but I failed.
var myXmpFile = new XMPFile (selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
var myXmp = myXmpFile.getXMP ();
var Name = myXmp.getProperty (XMPConst.NS_EXIF, "DateTimeOriginal");
var date = new XMPDateTime (new Date ((Name));
date2 var = new Date (date);
dateFormat.masks.portfolioDate = "mm/dd/yy" | "hh: mm TT';"
Date.format ("portfolioDate");
date2.format("mm/dd/yy");
Alert (date2. ToString());
Name.convertToLocalTime ();
Name ();
Alert (Name);
This should be close...
var str = myXmp.getProperty(XMPConst.NS_EXIF, "DateTimeOriginal").toString();
var dat =str.match(/(\d+).(\d+).(\d+).(\d+).(\d+).(\d+)/);
var amOrPm = "AM";
var hours = Number(dat[4]);
if (hours > 11) amOrPm = "PM";
if (hours > 12) hours = hours - 12;
if (hours > 11) amOrPm = "PM";
if(hours <10) hours = '0' + hours;
var dateString = dat[3]+"/"+dat[2]+"/"+dat[1].substr (2) +" | "+ hours +':'+dat[5]+ ' ' +amOrPm;
$.writeln(dateString);
-
Could someone tell me how to convert the digital signals in table 1 d of digital waveforms
I use 9474 for drving an engine. for that I have uses 2 ports - to activate and another for running. These signals in the form of Boolean values. I am to convert these signals to a table and since iam doing a digital waveform. but when iam connecting these to the module 9474, it show an error "source is a digital waveform and sink is 1-d array of digital waveform... any body can help in these issueee please...»
Pop - up on the thread and choose Insert...
Build the table.
Ben
-
How to convert the Variable containing the HTML must be interpreted as HTML in the HTML area
To understand the issue, I have a table that stores the HTML code generated by user and type of report:
USER | REPORT_TYPE | HTML_GENERATED
----------------------------------------------------------------------------------------|
TEST_USER | TEST | <HTML><head><title></title></head><BODY>TEST</BODY></HTML> |
On the page, there is a process that uses an anonymous PL/SQL block that is set on "on the charge before the header." Here's part of it:
SELECT HTML_GENERATED into :P2_HTML
from LN_DOCUMENT_LABELS
where USER = :app_user AND REPORT_TYPE = 'TEST';
The idea is to generate all the HTML code behind the scenes in another package.
There is only one element on the page to store the variable in:
P2_HTML (Hidden)
Then I created an HTML region, and in the region, I wanted to call in the element, so I got back:
&P2_HTML.
The result just displays the HTML code:
<HTML><head><title></title></head><BODY>TEST</BODY></HTML>
Is there a way to force it to be the result of the HTML when the page?
TEST
You have a region of pl/sql with code like:
begin
htp.p(:P2_HTML);
end;
Who would send to your browser to display html code... However, you can confirm that the produced HTML code is valid...
Thank you
Tony Miller
Ruckersville, WILL
-
How to store that value in the variable date?
Hi Sir,
I have a request that is
Select to_char (date ' 1900 - 01 - 01 + 1439 /(24*60), ' DD/MM/YYYY HH24:MI:ss') twice;
When I run this query, I get this value: 01/01/1900 23:59
and this value, I'm inserting in a variable that has the date data type.
Here I put like this:
v_nshiftmax: = to_char (date ' 1900 - 01 - 01 + 1439 /(24*60), "DD/MM/YYYY HH24:MI:SS");
While storing get error: not one month valid
How to store this variable?
Thank you If you are holdiing to variable date why you switch to to_char?
Just use to_date('1900-01-01','yyyy-mm-dd') + /(24*60) 1439
-
procedure that will dynamically build the query data and table Medallion
Hi people,
I write a procedure that dynamically build the query data and insert in the table "dq_summary".
enforcement procedure with success and data not inserted into the table 'dq_summary '.
I have thin problem in code attached below
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------FOR rep IN cur_di_attr
LOOP
dbms_output.put_line ('d: ');
BEGIN
EXECUTE IMMEDIATE 'SELECT table_name FROM ' || sum_tab || ' WHERE id = ' || rep.attribute_id INTO rep_tab;
dbms_output.put_line ('rep_tab: '||rep_tab);
run_query := run_query || ' ' || rep_tab || ' WHERE ' || nvl(wh_cond, '1 = 1');
EXECUTE IMMEDIATE run_query INTO end_rslt;
EXECUTE IMMEDIATE 'UPDATE dq_summary SET ' || prop || '_' || p_code || ' = ' || end_rslt || ' WHERE attribute_id = ' || rep.attribute_id;
dbms_output.put_line ('e: ');
dbms_output.put_line ('rep_tab: '||rep_tab);
dbms_output.put_line ('end_rslt: '||end_rslt);
dbms_output.put_line ('f: ');
EXCEPTION
WHEN no_data_found THEN
rep_tab := '';
sum_tab := '';
END;
END LOOP;
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
but in the procedure below must be run several times
create or replace
PROCEDURE DQ_REPORT_PROC
AS
prop di_proposition.pro_name%type;
col_var VARCHAR2(100);
p_code dq_parameter.para_code%type;
sum_tab di_proposition.summary_table%type;
run_query dq_parameter.run_query%type;
wh_cond dq_parameter.where_cond%type;
end_rslt VARCHAR2(20);
rep_tab VARCHAR2(50);
v_error_msg VARCHAR2(200);
v_error_code VARCHAR2(200);
v_object_name VARCHAR2(50) DEFAULT 'DQ_REPORT_PROC';
v_iss_no VARCHAR2(20) DEFAULT NULL;
CURSOR cur_di_prop IS
SELECT upper(replace(replace(pro_name, ' '),'-')) pro_name
FROM di_proposition;
CURSOR cur_di_para IS
SELECT upper(para_code) para_code, run_query, where_cond
FROM dq_parameter;
CURSOR cur_di_attr IS
SELECT attribute_id
FROM dq_summary;
BEGIN
DELETE FROM dq_summary;
INSERT INTO dq_summary (attribute_id, entity_name, attribute_name, data_champ)
SELECT a.attribute_id, b.entity_name, a.attribute_name, a.data_champ
FROM di_attribute_master a, di_entity_master b
WHERE a.entity_id = b.entity_id;
FOR c_prop IN cur_di_prop
LOOP
prop := c_prop.pro_name;
BEGIN
SELECT distinct SUBSTR(column_name, 1, INSTR(column_name, '_')-1), summary_table
INTO col_var, sum_tab
FROM user_tab_cols a, di_proposition b
WHERE a.table_name = 'DQ_SUMMARY'
AND upper(replace(replace(b.pro_name, ' '),'-')) = prop
AND SUBSTR(a.column_name, 1, INSTR(a.column_name, '_')-1) = upper(replace(replace(b.pro_name, ' '),'-'))
AND upper(b.status) = 'Y';
dbms_output.put_line ('col_var: '||col_var);
dbms_output.put_line ('sum_tab: '||sum_tab);
EXCEPTION
WHEN no_data_found THEN
col_var := '';
sum_tab := '';
END;
dbms_output.put_line ('a: ');
FOR para IN cur_di_para
LOOP
dbms_output.put_line ('b: ');
p_code := para.para_code;
run_query := para.run_query;
wh_cond := para.where_cond;
dbms_output.put_line ('c: ');
FOR rep IN cur_di_attr
LOOP
dbms_output.put_line ('d: ');
BEGIN
EXECUTE IMMEDIATE 'SELECT table_name FROM ' || sum_tab || ' WHERE id = ' || rep.attribute_id INTO rep_tab;
dbms_output.put_line ('rep_tab: '||rep_tab);
run_query := run_query || ' ' || rep_tab || ' WHERE ' || nvl(wh_cond, '1 = 1');
EXECUTE IMMEDIATE run_query INTO end_rslt;
EXECUTE IMMEDIATE 'UPDATE dq_summary SET ' || prop || '_' || p_code || ' = ' || end_rslt || ' WHERE attribute_id = ' || rep.attribute_id;
dbms_output.put_line ('e: ');
dbms_output.put_line ('rep_tab: '||rep_tab);
dbms_output.put_line ('end_rslt: '||end_rslt);
dbms_output.put_line ('f: ');
EXCEPTION
WHEN no_data_found THEN
rep_tab := '';
sum_tab := '';
END;
END LOOP;
END LOOP;
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
v_error_msg := SQLERRM;
v_error_code := SQLCODE;
TRACKER_LOG_EXECEPTION(v_iss_no, v_object_name, CURRENT_TIMESTAMP, v_error_msg, v_error_code);
COMMIT;
END DQ_REPORT_PROC;
Published by: BluShadow on February 7, 2012 12:04
addition of {noformat}{noformat} tags. Please read {message:id=9360002} and learn to do this yourself in future.
903830 wrote:
I write a procedure that dynamically build the query data and insert in the table "dq_summary".
enforcement procedure with success and data not inserted into the table 'dq_summary '.
I'm sorry. But there is no kind of say that way. The code is undesirable. The approach is wrong. This will not happen. This will cause the fragmentation of memory in the shared Pool. This will lead to another session being impossible to analyze the sliders because of the fragmented memory.
Not only that. The underlying data model is questionable.
All this seems a candidate perfect as an example of how NOT to design and code and use Oracle.
-
Using the variable of physical table of type "select".
Hello!
I have to use the query as the physical table (in the Administration tool - http://file.qip.ru/file/120930377/8713693/1_online.html):
SELECT ID, CODE
FROM TABLE (pkg.output('1','2'))
This code works well. I need to insert instead of session variables of the ' 1 'and ' 2', parameters which will be fixed to the dashboard.
How to set the variable in this query? As variants @{test} do not work. Good timing, Im bother with that now.
use: "VALUEOF (NQ_SESSION.variable_name).
don't forget the other single quotes as the substituted value is not quoted.
-
Cannot convert the pdf drawings in word format available
I use adobe 8.1 and can't convert the file into a searchable documents in Word. I'm following the guidelines for the OCR character recognition, but without success. Any suggestions or a newer versio of acrobat or prhaps another application.
Try ClearScan option. The search option is the choice. You may need to use the latter since the fonts for ClearScan in some versions are created on the fly and are not system fonts.