Load SQL referencing other data or column
Hello
is - it possible reference other data to another data for example FROM_DATE was used to the PERIOD column.
From_date is a physical data in the input file, while the PERIOD is not a physical data in the csv file, but simply a column on the table.
FROM_DATE COMPLETED TANK BY ',' OPTIONALLY PROVIDED BY ' "'"TO_DATE(:FROM_DATE,'DD-MON-YY')","
PERIOD INTEGER EXTERNAL BOX POSSIBLY BY ' "' ' TO_DATE (: FROM_DATE, 'YYYYMMDD')", ""
Thank you
Kind regards
Kepler_080
Your PERIOD column seems to be a number.
Maybe something like this will work:
"TO_number(TO_char(TO_DATE(:FROM_DATE,'DD-MON-YY'),'YYYYMMDD'))"
Tags: Database
Similar Questions
-
Load SQL data using the Regional service
Hello
I've been loading data using text file, now I want to try to load from SQL server directly, but screen load data from EAS, "Data Source" is grayed, as soon as I clicked on SQL as the Data Source.
What I miss here?, I configure ODBC to the server level.First of all, don't you configured the source SQL and ODBC in State of charge? Open the rule of the load and the "select" menu-> open SQL. Set up the sql statement in the form, then click ok/collect to test.
Once that the rule of the load seems good, so to actually load the data, show the daa load screen as you did. Select SQL. The data source must be a Virgin because it is for the flat file. Select the rule of load (it has the SQL in it). If you look to the right of the screen, and you may need to expand to see, rather than enter the sqlID and password there. Enter those, and click ok. It should load as usual.
If you want to leave MaxL, there is a syntax similar to tell the import statement is a sql load and give you it the id and the password
-
SQL - problem starting Data Modeler
Hello
I created a relational model with Oracle SQL Developer maker data, with a few tables, and everything worked ok.
Yesterday, I made some changes to the model, add columns and another table, saved the template and closed the Data Modeler.
Today - when I tried to open the template, I get only an error 'some objects are not loaded correctly. See the log file for more details"
Shows that the newspaper at the bottom of the Data Modeler: ' Open Design: "model name" "and no details of what went wrong. No other details are provided and as far as I can see - and now I can't view the model at all.
Any ideas how to find the problem / fix in order to retrieve the created model?
Thank you
CoenraadYou must open the file ' a - erd2.xml ' (with text editor) and look for the name of your models - they are in such a construction:
Logic
....
You should not some special characters in the name of the party: <&>'.
'Name' in the example above makes sense (the text between the opening tag and closing name -Philippe
&> -
Hello OTN.
I don't understand why my sql query will pass by in the data model of the BI Publisher. I created a new data model, chose the data source and type of Standard SQL = SQL. I tried several databases and all the same error in BI Publisher, but the application works well in TOAD / SQL Developer. So, I think it might be something with my case so I'm tender hand to you to try and let me know if you get the same result as me.
The query is:
SELECT to_char (to_date ('15-' |)) TO_CHAR(:P_MONTH) | » -'|| (To_char(:P_YEAR), "YYYY-DD-MONTH") - 90, "YYYYMM") as yrmth FROM DUAL
Values of the variable:
: P_MONTH = APRIL
: P_YEAR = 2015
I tried multiple variations and not had much luck. Here are the other options I've tried:
WITH DATES AS
(
Select TO_NUMBER (decode (: P_MONTH, 'JANUARY', '01',))
'FEBRUARY', '02',.
'MARCH', '03'.
'APRIL', '04'
'MAY', '05'.
'JUNE', '06'.
'JULY', '07',.
'AUGUST', '08'.
'SEPTEMBER', '09'.
'OCTOBER', '10',.
'NOVEMBER', '11'.
"DECEMBER", "12."
'01')) as mth_nbr
of the double
)
SELECT to_char (to_date ('15-' |)) MTH_NBR | » -'|| (TO_CHAR(:P_YEAR), 'DD-MM-YYYY') - 90, "YYYYMM")
OF DATES
SELECT to_char (to_date ('15-' |: P_MONTH |)) » -'|| ((: P_YEAR, 'MONTH-DD-YYYY')-90, "YYYYMM") as yrmth FROM DUAL
I'm running out of ideas and I don't know why it does not work. If anyone has any suggestions or ideas, please let me know. I always mark answers correct and useful in my thread and I appreciate all your help.
Best regards
-Konrad
So I thought to it. It seems that there is a bug/lag between the guest screen that appears when you enter SQL in the data model and parameter values, to at model/value data.
Here's how I solved my problem.
I have created a new data model and first created all my settings required in the data model (including the default values without quotes, i.e. APRIL instead "Of APRIL") and then saved.
Then I stuck my sql query in the data model and when I clicked ok, I entered my string values in the message box with single quotes (i.e. "in APRIL' instead of APRIL)
After entering the values of string with single quotes in the dialog box, I was able to retrieve the columns in the data model and save.
In the data tab, is no longer, I had to enter the values in single quotes, but entered values normally instead, and the code worked.
It seems the box prompted to bind the values of the variables when the SQL text in a data model expects strings to be wrapped in single quotes, but no where else. It's a big headache for me, but I'm glad that I solved it, and I hope this can be of help to other institutions.
See you soon.
-
Loading table to Essbase Data - group
Hello
We are loading the data of a table in Oracle to Essbase. 2 elements of data in the table needs to be loaded by the grouping of data and 2 other data elements should be responsible for taking just the last value with the group.
-To group by on 2 columns, we add 'SUM' on the target
-To load the 2 others that just the last value (its total recurrent) we just map it to target as is
The problem is that we see some inconsistancy data... (any suggestion to manage this case?)
As an alternative, we have created two separate interface... one to manage the group in 2 elements needed the SUM and other interfaces with the other 2.
Please advise! Thank you.You may need to divide in 2 interfaces, otherwise when you could load #missing values to the database where the data exist.
See you soon
John
http://John-Goodwin.blogspot.com/ -
Lock on a table and SQL * Net more data from client
Hello
I have a problem loading data through Php in Oracle: web page of Php open an xml file, create a .csv, then begins to Oracle using an external table to process the data.
The problem is that, the second time that PHP is trying to run the following query:
INSERT INTO table1 T (Field1, Field2, field3, field4, sphere5, case field6) VALUES ('Aaa1E63819707', SYSDATE, 'KO', 'error', 'L', 'file_name.xml') POLL INTO Field1: id
on the Oracle sessions, I have an exclusive lock on table1 and wait for SQL * Net more data from client.
Where is the problem?
Thank you
Igor
Finally I found the problem: a DBA changed the cursor sharing EXACT force! I restored the CORRECT setting and now everything is fine.
Thank you
Bye,.
Igor
-
Write a SQL query with lines in columns
All the
I need help in writing a SQL query with lines in columns, let give u an example...
drop table activity;
CREATE TABLE 'ACTIVITY '.
(
"PROJECT_WID" NUMBER (22.0) NOT NULL,
VARCHAR2 (150 CHAR) "PROJECT_NO."
VARCHAR2 (800 CHAR) 'NAME '.
);
Insert in the ACTIVITY (PROJECT_WID, PROJECT_NO, NAME) values (1683691, '10007', 12-121');
Insert in the ACTIVITY (PROJECT_WID, PROJECT_NO, NAME) values (1684994, '10008', 12-122');
Insert in the ACTIVITY (PROJECT_WID, PROJECT_NO, NAME) values (1686296, '10009', 12-123');
Insert in the ACTIVITY (PROJECT_WID, PROJECT_NO, NAME) values (2225222, '9040', 12-124');
drop table lonet;
CREATE TABLE 'LONET.
(
VARCHAR2 (150 CHAR) "NAME."
NUMBER OF THE "ROOT."
VARCHAR2 (150 CHAR) "ENTRYVALUE".
);
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ("GAC", 1683691, "LDE");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('NAM', 1683691, 'LME');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('BAG', 1683691, 'ICE');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('PAP', 1683691, 'IKE');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('NAM', 1686291, "QTY");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('PAP', 1686291, 'MAX');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ("GAC", 1684994, "MTE");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('PAP', 1684994, 'MAC');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('FMT', 1684994, 'NICE');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('FMR', 1684994, 'RAY');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('BAG', 1686296, "CAQ");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ("PAP", 1686296, "QAQ");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ("VANESSA", 1686296, "THEW");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ("ANDR", 1686296, "REYL");
commit;
Link: activity.project_wid = lonet.root
look like output
Project_wid Project_no NAME GAC NAM BAG RAC 1683691 10007 12-121 LDE LME LCE LKE 1684994 10008 12-122 MTE null null MAC 1686296 10009 12-123 null null CAQ QAQ 2225222 9040 12-124 null null null null two problems, in that I am running
1. I dono how simply we can convert rows to columns
2. for root = 1683691, there are double NAM and RAC in lonet table... ideally these data should not be there, but since its here, we can take a MAX so that it returns a value
3. There are undesirables who should be ignored
Once again my thought process is that we join the activity and 4 alias table lonet.
ask for your help in this
Thank you
Hello
This is called pivoting.
Here's a way to do it:
WITH relevant_data AS
(
SELECT a.project_wid, a.project_no, b.SID
, l.name AS lonet_name, l.entryvalue
Activity one
LEFT OUTER JOIN lonet l.root = a.project_wid l
)
SELECT *.
OF relevant_data
PIVOT (MAX (entryvalue)
FOR lonet_name IN ("GAC" IN the gac
"NAM" AS nam
'BAG' IN the bag
"RAC" AS cars
)
)
ORDER BY project_wid
;
Output:
PROJECT_WID PROJECT_NO GAC NAM BAG RAC NAME
----------- ---------- ---------- ---------- ---------- ---------- ----------
1683691 12 - 10007 121 LDE LME LCE LKE
1684994 MAC MTE 10008 12-122
1686296 12 - 10009 123 QAC QAQ
2225222 9040 12 - 124
To learn more about swivel, see the FAQ in the Forum: Re: 4. How can I convert rows to columns?
Thanks for posting the CREATE TABLE and INSERT statements; It's very useful!
-
SQL * Net more data from client wait event
Hi all
DB 11.2.0.2
AIX 6
I get two events of high expectation of the AWR report page
(1) SQL * Net more data from client
synchronization of log files 2)
Need advice to the configuration of the hardware and network latency?
What should I do for the first event of waiting?
This simple average may, what they're doing massive data loads with a very large table size that the Oracle Server manages very effectively but necessarily expect much coming data of the customer and parallel large log files written to end on the validation. It is possible that setting a large SDU and tcp large transmiat and receive buffers would help if this happens to be what they do; Similarly, if that's what they do, then reduce their size of table can also have some effect.
Concerning
Jonathan Lewis
-
SWF referencing other files - combine?
Hello
Recently, I used a program that converts a pdf file in a flash "flipbook" animation and exports as .swf or .exe. However, my problem is that when you export as .swf, it exports the frame/player and he calls movie.swf, it creates also 2 folders. 1 is called images, that each page of the pdf as a .swf and also a jpeg thumbnail. The other file is called file and search xml etc in there.
When the movie.swf is located in the directory with the other files, it loads the other pages, etc. However, if you move the movie.swf to another location, it does not load anything, it shows the frame/player only. (I guess it's because it's referencing other files internally)
My question is, is it possible to convert this into a swf, which still has the feature click on pages to switch etc.
Thank you.If you have only a swf (or exe) you can not change it.
-
Find the key referenced foreign Table and column
Can someone please refresh my memory?
How can I determine which table and column refers to a foreign key?
For example, with select * from ALL_constraints WHERE TABLE_NAME = 'my_table '; I can see forced CONSTRAINTA_FK and CONSTRAINTB_FK I guess reference another table and column because CONSTRAINT_TYPE = "R", but it isn't that I get. "
I would get all the way to the referenced table and the column I just don't remember how.
Thank you
LouHello
Example:
Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0 Connected as hr SQL> SQL> SELECT UC.TABLE_NAME, 2 UC.R_CONSTRAINT_NAME, 3 UCC.TABLE_NAME, 4 UCC.COLUMN_NAME 5 FROM USER_CONSTRAINTS UC, 6 USER_CONS_COLUMNS UCC 7 WHERE UC.R_CONSTRAINT_NAME = UCC.CONSTRAINT_NAME 8 AND uc.constraint_type = 'R' 9 ORDER BY UC.TABLE_NAME, 10 UC.R_CONSTRAINT_NAME, 11 UCC.TABLE_NAME, 12 UCC.COLUMN_NAME; TABLE_NAME R_CONSTRAINT_NAME TABLE_NAME COLUMN_NAME ------------------------------ ------------------------------ ------------------------------ -------------------------------------------------------------------------------- COUNTRIES REG_ID_PK REGIONS REGION_ID DEPARTMENTS EMP_EMP_ID_PK EMPLOYEES EMPLOYEE_ID DEPARTMENTS LOC_ID_PK LOCATIONS LOCATION_ID EMPLOYEES DEPT_ID_PK DEPARTMENTS DEPARTMENT_ID EMPLOYEES EMP_EMP_ID_PK EMPLOYEES EMPLOYEE_ID EMPLOYEES JOB_ID_PK JOBS JOB_ID JOB_HISTORY DEPT_ID_PK DEPARTMENTS DEPARTMENT_ID JOB_HISTORY EMP_EMP_ID_PK EMPLOYEES EMPLOYEE_ID JOB_HISTORY JOB_ID_PK JOBS JOB_ID LOCATIONS COUNTRY_C_ID_PK COUNTRIES COUNTRY_ID TEMP_LEAVE PK_CLIENT CLIENT CLIEND_ID VISITORS SYS_C004169 GROUPS GROUPID VLANGS SYS_C004170 VISITORS VISITORID 13 rows selected SQL>
In the output:
TABLE_NAME R_CONSTRAINT_NAME TABLE_NAME COLUMN_NAME ------------------------------ ------------------------------ ------------------------------ -------------------------------------------------------------------------------- COUNTRIES REG_ID_PK REGIONS REGION_ID
means that a COUNTRY table has a foreing key called REG_ID_PK that points to an array of AREAS. REGION_ID
Kind regardsPublished by: Walter Fernández on March 4, 2009 23:26 - adding explanation...
-
Other data after the iOS upgrade
I've recently upgraded to iOS10 and now find that I have about 5 GB of 'Other' data that did not previously exist. I tried to restart the iPhone and then sync to iTunes, but it's still there. How can I get rid of him?
Is it in iCloud or storage?
-
delete other data out of my iphone
OK, I tried all suggestions to delete the "other" data out of my phone, including a restoration. Restore seemed to work until I connected to iTunes again once and then he came right away. I have 4.38 GB of data and no amount of cleaning browser cache or the removal of all discussions of the message seems to be working. I have an iPhone running iOS 9.3.1 6
Any help out there?
Did you restore the backup? If so, you may need to do a restore as new as the backup may be corrupted. Restore the backup can bring back the question.
-
I need to transfer my history of the text and images from my old iPhone to my new iPhone, but have already moved all other data to my new phone via iTunes and spent time to organize. How do I reset this transfer without any? I transfer a 5s to itself.
For your photos, try importing them to your computer and their synchronization then back to the SE.
Import photos and videos from your iPhone, iPad or iPod touch - Apple Support
For your texts, they moved with the backup restore?
-
When you connect to the 'do not call site' to complain I get the following message "the connection to the complaints.donotcall.gov was interrupted while the page is loading." All other pages load fine. Loads of everything perfectly on I / E 8.
I started Firefox in safe mode and got the same results.
Disabled the firewall and virus programs, no help. I have 2 new computers about 2 years, both have the same problem with version 12.0You can use this button to go to the Firefox profile folder:
- Help > troubleshooting information > profile directory: opens showing the file
-
Prob w/Importing Favorites and other data from Internet Explorer
Everything by following the steps described in the forum article titled "Importing Favorites and other data from Internet Explorer" after completing step 3, select which points to import, if I select all the option or just the Favorites, I get the same error "Firefox has stopped working... close the program."
I am importing of IE 8 on laptop Win7 OS. I tried importing every time and cannot get past this error. I made an export of IE8 that takes the form of a html file that there is apparently no option in Firefox to use.
in Firefox:
Bookmarks > organize bookmarks-> import and backup - import HTML... = HTML file
Maybe you are looking for
-
iPhoto crashes when you enter "places"
iPhoto crashes when you enter "places".
-
Why bookmark drop down panel change has >; Z-order when modified in the menu bookmark?
When I try to set the order of bookmarks in bookmarks organize the library page opens, I select Menu bookmarks, select a bookmark and click on organize, select all and all are highlighted, then go to view, sort, sort by name of the sort order, has >
-
Graphics memory shared in a Satellite A200-1CK
Hello, I have a Satellite A200-1CK which has 2 GB of RAM and 256 MB graphics memory shared. is there a way to check how my phone is currently using this 256 MB and you can manually change this? for example, to define graphics for always using 128 MB
-
Download Apple Watch App on iPhone 5
When I arrived to the App Store to download the App to Apple Watch it y apps here who are trying to sell me something, but I can't find the BASIC I watch App to download on my IPhone 5 to allow me to sync my new Apple Watch. Can you help me. ?
-
'system' process in the Task Manager running @ 50 to 100%
Just reinstalled xp family and for some reason, the 'system' process in the Task Manager runs 100% gel about the custom of all the system let me download updates update freezes keyboard and touch pad and wont stop. tried to reinstall it 4 times same