I have many different file names within my table and I want to remove the .TXT extension from each one. I want to try this SQL but being a newbie in Oracle, I don't know how to say "Left" characters. "Left" is an invalid identifier.
Update TableName Set File_Name = Left(File_Name, Len(File_Name)-4) Where File_Name LIKE '%.TXT'
We have to get some data from U98 (saixdbU98) in UTF-8 format in Excel sheet.We are having queries ready for this. These queries bring data which have Japanese characters.But when we run the Select queries then in the result Japanese chars are garbled. It comes in ????.
let us know what process we have to follow to get the result in UTF-8 format in Excel sheet.here is the code
set sqlblanklines on; SET DEFINE OFF; set linesize 1000 set long 1000000
I'm using utl_encode.mimeheader_encode to encode the subject line for non ascii chars, but its encoding only first 75 chars, is there any other way to encode subject.
I have a function that is being called three time using UNION and wanted to know if this can be improved to just one call while incorporating all the table joins.
select field1,fdate,fname,username,stepnum from ( SELECT M.FIELD1, TO_CHAR (M.FIELD_DATE, 'MM/DD/YYYY HH24MISS') AS FDATE, M.FIELDNAME AS FNAME, M.USERNAME,
We have to get some data from U98 (saixdbU98) in UTF-8 format in Excel sheet.We are having queries ready for this. These queries bring data which have Japanese characters.
But when we run the Select queries through pbrun (Power Broker) then in result Japanese chars are garbled. It comes in what process we have to follow to get the result in UTF-8 format in Excel sheet.
here is the code -- set sqlblanklines on; SET DEFINE OFF; set linesize 1000 set long 1000000 set pages 50000
I have a function that returns the total sum of an account. From reports I call the function passing the account code. The function sums the values for that specific account code and returns the value. In my function I have the following code :
where account_code = P_CODE.
Eg. The value of :P_CODE is 'CS'.
I now want to pass multiple account codes ('CS','TV',LJ') to the function. How do I change the IN clause in the function to accommodate multiple values.
I have tried using the instr function, but it does not work. eg. AND instr(o.ACCOUNT_CODES,','||P_CODE||',') > 0
I've used PIPELINED FUNCTION and I've no issues in using this. Just wanted to know is there a way so that I don't need to pipe each row separately and I can pipe a set of rows at once.
Like we use BULK COLLECT INTO to fetch multiple rows at once instead of fetching one row using SELECT INTO.
TRUNCATE INTO TABLE NEW_DATA FIELDS TERMINATED BY '|' (INK_DATE date "YYYY-MM-DD", INV_ID, CUST_ID, AMOUNT)
My problem is that there are some rows (about 1%) where the columns INV_ID, CUST_ID, AMOUNT are containing non numeric characters and they end up in the BAD-file as errors.
Is there a way to make them end up in the discard file instead so I don't end up with errors but discards?Or even better load then into another table looking like this
I am using: Desktop / Discoverer 4.1 / Windows XP.
I am attempting to add a new calculated column and have had some success with the CASE function but need to add additional criteria.
What I have that works is:
SUM(CASE WHEN Expenditure Type = 'Supplier Rebates' THEN Total Spend Plus Commit ELSE 0 END)
What I need to add are a few additional criteria. I attempted and failed with a few variants of this:
SUM(CASE WHEN Expenditure Type = 'Supplier Rebates' AND Capitalizable = 'Y' AND Task Owing Company = '534' OR '915' THEN Total Spend Plus Commit ELSE 0 END)
The three criteria points that I am looking to includea are:
•Expenditure Type = 'Supplier Rebates' •Capitalizable = 'Y' •Task Owing Company = '534' OR '915'
i tried to apply a sql case statement in sql loader control file in " " the load succeed with 258 chars case or decode statement but when i add more cases it return sql loader 350 token longer than max
LOAD DATA INFILE 'F:Vouvou20110613_102_951454.unl' BADFILE 'F:Vouvou.pad' DISCARDFILE 'F:Vouvou.dic' replace INTO TABLE vou_test_2 FIELDS TERMINATED BY '|' TRAILING NULLCOLS [code].......
the above one succeed when i edit the case statement as follow
ACCOUNT_2001 "CASE WHEN:ACCOUNTTYPE1='2001'THEN :REWARDAMOUNT1 WHEN :ACCOUNTTYPE2='2001' THEN :REWARDAMOUNT2 WHEN :ACCOUNTTYPE3='2001' THEN :REWARDAMOUNT3 WHEN :ACCOUNTTYPE4='2001' THEN :REWARDAMOUNT4 WHEN :ACCOUNTTYPE5='2001' THEN :REWARDAMOUNT5 WHEN :ACCOUNTTYPE6='2001' THEN :REWARDAMOUNT6 WHEN :ACCOUNTTYPE7='2001' THEN :REWARDAMOUNT7 WHEN :ACCOUNTTYPE8='2001' THEN :REWARDAMOUNT8 WHEN :ACCOUNTTYPE9='2001' THEN :REWARDAMOUNT9 WHEN :ACCOUNTTYPE10='2001' THEN :REWARDAMOUNT10 END"
i got the Error sql loader 350 token longer than max allowable length of 258 chars .
note : i cant modify the table structure to shorten the column names .
My need is to pass multiple values as single input parameter into pipelined function. For example - "2" and "3" are values of input parameter "t":
with data as ( select 1 as t from dual union all select 2 as t from dual union all select 3 as t from dual union all select 4 as t from dual union all select 5 as t from dual ) select * from data where t in (2,3)
[CODE] DECLARE D1 DATE:='&D1'; D2 DATE; BEGIN WHILE D1<=D2 LOOP DBMS_OUTPUT.PUT_LINE(TO_CHAR(D1,'DAY DD-MON-YYYY')); D1:=D1+1; END LOOP; END;
Here I want to display all the seven days. One more question is here I'm d1<=d2 but d2 is null. So how does <= works here a null. A null is always null. What will be there in d2 how does the loop works with this comparision.
I have the query below that works absolutely fine in Oracle 10g but is not running in Oracle 11g. Couple of things I notices about this query.
1. If I remove the alias 'FACILITY_W_CODE' in the ORDER BY clause, query works fine in 11g. If I replace 'FACILITY_W_CODE' with the actual fields - 'F.SERVICE_AREA || F.DISTRICT_OFFICE || F.DO_GROUP || F.DO_SSC' even then it works fine.
2. If I remove the GROUP BY clause in the inside query but keep the alias 'FACILITY_W_CODE' in the outside ORDER BY clause, the query works fine.
I am not sure where the issue is, GROUP BY or the ALIAS. Also, the alias issue seems to be only where the alias is used for multiple fields.
SELECT F.SERVICE_AREA || F.DISTRICT_OFFICE || F.DO_GROUP || F.DO_SSC FACILITY_W_CODE, PF.FAC_TYPE FACILITY_TYPE, PF.FAC_IDENT LOCATION_IDENTIFIER, P.DISTRICT_CODE USER_W_CODE, P.EMAIL_ADDRESS, PF.CERTIFICATION_AUTHORITY, PF.CALLBACK_TECHNICIAN, PF.CALLBACK_ENVIRONMENTAL FROM PEOPLE P JOIN ( SELECT I_PF.ID, I_PF.FAC_TYPE, I_PF.FAC_IDENT,
I am fighting with some code to work in IE7. It is currently working in Firefox.
A little bit more on the context of the situation is that I am entering the code as a personalization on an Oracle Self Service Page. I am entering in as a raw text personalization.
My teacher taught the lesson of DML statemnts, he told us how does merge works , but he did not give us any query for that,provide query for Merge and if possible then explain it too , I am using Oracle 10g Sql Plus.
I want to know how Remap_datafile paramater in IMPDP works in Oracle 10g. give me the whole scenario for two databases. One in Linux Platform and other in Windows platform. I want to import the tablesapce data from Linux to Windows Server database.
this is my coding on save button. this is working fine but only once. when i enter the data second time and try to save, it didn't do anything. what should i do?
I'm trying to create a view that includes both custom and delivered tables. The SQL code produces the desired results in SQL Developer. However, when I create and test the view using that code, I get very different and incorrect results. The SQL part of the view is below:
SELECT j.emplid, pt.deptid, pt.y_policy_id, pt.effdt, pt.title, pt.comments, pt.y_policy_covg, pt.doc_url FROM psoprdefn a , ps_job j , ps_y_policy_tbl pt WHERE substr(a.oprid,1,1) = '0' AND a.emplid = j.emplid AND j.job_indicator = 'P' AND j.effdt = (SELECT MAX(effdt) FROM ps_job WHERE emplid = j.emplid AND empl_rcd = j.empl_rcd AND effdt <= sysdate) [code]....