Decode Not working in sql loader
I had a requirement of loading flatfile into staging table using SQL Loader, One of the columns in the the Flat file is having values FALSE or TRUE and my requirement is that I load 0 for FALSE and 1 for TRUE which can be achieved by simple DECODE function...I did use decode and tried to load several times but did not work. What might be the problem
LOAD DATA
INFILE 'sql_4ODS.txt'
BADFILE 'SQL_4ODS.badtxt'
APPEND
INTO TABLE members
FIELDS TERMINATED BY "|"
( Person_ID,
FNAME,
LNAME,
Contact,
status "decode(:status, 'TRUE', '1','FALSE','0')"
I did try putting a trim as well as SUBSTR but did not work....the cloumn just doent get any values in the output (just null or say free space)
Any help would be great.....
Hello user8937215.
Please provide a create table statement and a sample of data file contents. I would expect DECODE or CASE to work based on the information provided.
Cheers,
Luke
Please mark the answer as helpful or answered if it is so. If not, provide additional details.
Always try to provide create table and insert table statements to help the forum members help you better.
Similar Messages
-
ADOBE CLOUD ON MY DESKTOP WILL NOT WORK. IT LOADS UP BUT NOTHING FILLS THE WINDOW
ADOBE CLOUD ON MY DESKTOP WILL NOT WORK. IT LOADS UP BUT NOTHING FILLS THE WINDOW
BLANK Cloud Screen http://forums.adobe.com/message/5484303 may help
-and step by step http://forums.adobe.com/thread/1440508?tstart=0
-and http://helpx.adobe.com/creative-cloud/kb/blank-white-screen-ccp.html -
LIKE operator is not working in SQL Query in XML file
Hi Gurus,
LIKE operator is not working in SQL query in XML template.
I am creating a PDF report in ADF using Jdeveloper10g. The XML template is as follows
<?xml version="1.0" encoding="WINDOWS-1252" ?>
<dataTemplate name="catalogDataTemplate" description="Magazine
Catalog" defaultPackage="" Version="1.0">
<parameters>
<parameter name="id" dataType="number" />
<parameter name="ename" dataType="character" />
</parameters>
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[
SELECT ename, empno, job, mgr from EMP where deptno=:id and ename LIKE :ename || '%']]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="EmployeeInfo" source="Q1">
<element name="EmployeeName" value="ename" />
<element name="EMPNO" value="empno" />
<element name="JOB" value="job"/>
<element name="MANAGER" value="mgr" />
</group>
</dataStructure>
</dataTemplate>
if i pass the parameter value of :ename from UI, it doesn't filter. But if I give ename = :ename it retrieves the data. Can anyone help me why LIKE operator doesn't work here?
Appreciate your help,
Shyamal
email: [email protected]Hi
Well for a start, you are doing some very strange conversions there. For example...
and to_char(a.msd, 'MM/DD/YYYY') != '11/11/2030'
and to_char(a.msd, 'MM/DD/YYYY') != '10/10/2030'If a.msd is a date then you should e converting on the other side ie.
and a.msd != TO_DATE('11/11/2030', 'MM/DD/YYYY')
and a.msd != TO_DATE('10/10/2030', 'MM/DD/YYYY')Also, you may want to take into consideration nothing being input in :P2_ITEM_NUMBER like this...
AND INSTR(a.item_number,NVL(:P2_ITEM_NUMBER,a.item_number)) > 0Is item number actually a number or char field? If it's a number, you want to explicitly convert it to a string for using INSTR like this...
AND INSTR(TO_CHAR(a.item_number),NVL(TO_CHAR(:P2_ITEM_NUMBER),TO_CHAR(a.item_number))) > 0?
Cheers
Ben -
EXEC SP_EXECUTESQL not working in sql server 2014
EXEC SP_EXECUTESQL not working in sql server 2014
EXEC SP_EXECUTESQL not working in sql server 2014
Hi Amar,
What's the error when executing this stored procedure?
I have tested it on my local environment, we can run this SP without any problems.
Please provide us more information, so that we can make further analysis.
Regards,
Charlie Liao
TechNet Community Support -
this photo illustrate how that (Substitution Variables) not working in "SQL Developer" Environment :-
http://www.imagehosting.com/show.php/1555180_ddddd.PNG.html
any solve for this problem ?????!!!!!!!!!!There is a dedicated forum for SQL Developer related questions
SQL Developer
I should admit however, that query you have provided ( with substitution variables) works like a charme in my environment (SQL Developer 1.1.0.23 build 23.64)
Best regards
Maxim -
File- Print not working from SQL Developer 1.2.1 Build MAIN-32.13
File->Print not working from SQL Developer 1.2.1 Build MAIN-32.13.
I downloaded sqldeveloper-1.2.1.3213.ZIP and extract to a local directory. From the extracted directory I ran ..\sqldeveloper\sqldeveloper.exe from Windows XP sp2. The program itself seems to run just fine but File-Print doesn't do anything. In Help-About, Java Platform is reported as 1.5.0_06 and Oracle IDE is 1.2.1.3213. I'm not sure where to look for what is causing the problem.
ThanksI hadn't tried CTRL-P before but I did today. On the first attempt, I saw a small jump in the memory usage for sqldeveloper.exe as reported in Windows Task Manager. Otherwise, there was no change. A second CTRL-P in the same session produced a further bump but subsequent attempts in the same session produced no further change in CPU or Memory Usage.
Using Task Manager to monitor this further, I tried File->Print again and saw that sqldeveloper would periodically climb to 1 or 2 percent CPU and consume a little more memory. After a minute or so, though, all activity stops again.
I do not get a print dialog box from SQLDeveloper using either CTRL-P or File->Print -
Database Mail not working with SQL Server Agent
I'm running SQL Server 2005 Standard edition 64 bit with SP2 on a 64 bit machine.
Database mail does not work with SQL Server Agent. When I configure SQL Server Agent to use database mail the test email button is greyed out and inactive therefore I cannot send emails using operators or for jub success failure etc.
I've read that there was supposed to be a fix for this with SP1 but I have SP2 and still receive the same problem. Please can somebody help as I do not wish to use SQL Mail as a work around due to this becomming redundant in future versions of SQL Server.
Kind RegardsThe problems solved
steps:
1)we create a mail profile at at Managment->Database Mail ,of SQL Managment
2)we set this account as "default" at Managment->Database Mail -> Configure Database Mail -> Manage profile security
3)At tab "Alert System" of SQL Server Agent properties , we check the "Enable mail profile" , Mail System=Database Mail, Mail profile = "the profile we already create"
4)we create a new operator at "Operators" of sql agent, where at "notification options" -> "Email name" we put the mail where we want to sent the agent the mails at failured job
5)We go at a specific job, at tab "Notifications" ,we check the "email" check box and then we choose the operator we just create, at the text box next to check box.
I hope not to forget something
Thank You all for the help -
HT5622 why after my verify apple id still not working my down load apps
why after m verify id stil not working my down load apps
Who knows?
Settings>iTunes and App Stores>Tap your ID and sign out. Reboot your iPad.
Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
Go back to the settings and sign back in again and see of it works now.
If it doesn't work, post back with some information that might help us help you. Describe what you are doing in some detail and it might let us better understand why this is happening. -
Distributed transaction using linked server not working in SQL Server 2008 64 bit
Hi. I have had an issue trying to get distributed transactions to work in SQL Server 2008 using a linked server. The error message I get is
OLE DB provider "SQLNCLI10" for linked server "pod1" returned message "No transaction is active.".
Msg 7391, Level 16, State 2, Line 3
The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "pod1" was unable to begin a distributed transaction.
My Environment:
Windows Server 2008 Enterprise 64 bit, SQL Server 2008 Enterprise 64 bit
Problem occurs with multiple different builds of SQL Server 2008 - I have been able to reproduce the problem with 10.0.1600.0, 10.0.1779.0 (CU 2), as well as 10.0.2531 (SP1)
I am aware that other people have had this issue and have reviewed all existing posts. I have verified that the MSDTC is configured correctly on both machines. I have also used DTCTester to verify that DTC is working correctly on all machines in question.
None of the mentioned resolutions has solved this problem for me.
I am not seeing this problem occur on my 32 bit test machines - it is only occurring if at least one of the two machines is 64 bit.Hi All,
I realise that this topic may be a little bit out-of-date but if someone gets here from some search engine trying to find a solution for DTC problems, this MAY be useful.
So... I recently had the same issue, tried all the approaches described in KB and other articles, but it didn't help. Because my task to solve this was not of the highest priority I forgot about it for some time.
Today I was troubleshooting some other issue and, by accident discovered source of that first problem:
In the EventViewer I found Error entry logged by MSDTC saying:
"The local MS DTC detected that the MS DTC on vm-server1 (other machine name that also runs DTC - my comment) has the same unique identity as the local MS DTC. This means that the two MS DTC will not be able to communicate
with each other. This problem typically occurs if one of the systems were cloned using unsupported cloning tools. MS DTC requires that the systems be cloned using supported cloning tools such as SYSPREP. Running 'msdtc -uninstall' and then 'msdtc -install'
from the command prompt will fix the problem. Note: Running 'msdtc -uninstall' will result in the system losing all MS DTC configuration information."
So I followed suggestion and run:
msdtc -uninstall
msdtc -install
This solved my problems with DTC. Hope it will help someone.
Piotr -
I have recently installed SQL Server 2008. When I try to execute a query against an Access database, I receive this debugging error:
"Unable to start Transact-SQL debugger. The Transact-SQL debugger does not support SQL Server 2005 or earlier versions of SQL Server. (SQLEditors)"
Nor will the query execute; I get a transport-level error 0. Any thoughts?Hi Davidmhjr,
>>Unable to start the Transact-SQL Debugger. The Transact-SQL Debugger does not support SQL Server 2005 or earlier versions of SQL Server. (SQLEditors).
Have you tried to restart the server once you have installed SQL Server 2008? As Naomi N mentioned please check the version of SQL Server you are using.
If you tried to connect to SQL Server 2005 from SQL Server 2008 SSMS, you would not be able to debug and get this error, it happens because T-SQL debugger includes both server-side and client-side components. The server-side debugger components are installed
with each instance of the SQL Server 2008 Database Engine. The client-side components are installed when you install the SQL Server 2008 client-side tools.
So it works with SQL Server 2008 only so far. Another way is you can triy to use SQL Server 2005 SSMS to connect to SQL Server 2005.
More information about configuration requirement to run T-SQL debugger as below, please refer:
There are no configuration requirements to run the Transact-SQL debugger when SQL Server Management Studio is running on the same computer as the instance of the SQL Server Database Engine. However, to run the Transact-SQL debugger when SQL Server Management
Studio is running on a different computer from the instance of the Database Engine, you must enable program and port exceptions by using the Windows Firewall Control Panel application on both computers.
On the computer that is running the instance of the Database Engine, in Windows Firewall, specify the following information:
•Add TCP port 135 to the exceptions list.
•Add the program sqlservr.exe to the exceptions list. By default, sqlservr.exe is installed in C:\Program Files\Microsoft SQL Server\MSSQL10.InstanceName\MSSQL\Binn, where InstanceName is MSSQLSERVER for the default instance, and the instance name for
any named instance.
•If the domain policy requires network communications to be done through IPsec, you must also add UDP port 4500 and UDP port 500 to the exception list.
On the computer that is running SQL Server Management Studio, in Windows Firewall, specify the following information:
•Add TCP port 135 to the exceptions list.
•Add program ssms.exe (SQL Server Management Studio) to the exceptions list. By default, ssms.exe is installed in C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE.
Hope it is helpful.
Regards, Amber zhang -
I recently downloaded SQL developer Version 2.1.1.64. However the code completion feature is not working automatically. I have checked the Automatically complete code in SQL worsheet checkbox under Tools->Preferences-> Code Editor-> Completion Insight.
Strangely, I get the code completion pop up window when I explicitly press the completion insight shortcut(Ctrl + Space).
Please help.
Thanks and Regards.Hi, I am getting the following logs :
Code completion time = 1015
*...?aux tok2?, parse time = 63
InsightableOracleDatabase.fetch() time = 360
Code completion time = 844
Finished parsing = 0
*...?aux tok2?, parse time = 62
InsightableOracleDatabase.fetch() time = 344
Code completion time = 812
Finished parsing = 0
*...?aux tok2?, parse time = 63
InsightableOracleDatabase.fetch() time = 359
Code completion time = 891
Finished parsing = 0
Thanks -
XP_DELETE_FILE NOT WORKING IN SQL SERVER 2005 SP2
Hi All,
I have one job in sql 2005 sp2 that deletes backup older than one week.It is not working.I have checked service account permissions on backup folder and all required permissions and authentications are in place.Please let me know how to troubleshoot the
same.
Regards
RahulCheck the following:
http://stackoverflow.com/questions/212603/sql-server-xp-delete-file-not-deleting-files
QUOTE: "Note that xp_delete_file is broken in SP2 and won't work on report files;"
Kalman Toth Database & OLAP Architect
SQL Server 2014 Design & Programming
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
SET NULL not working in SQL*Plus
DB Version: 10.2.0.4
Question1.
Won't SET NULL work with PL/SQL block?
Question2.
Why is <<>> appearing in several lines (one character per line) as shown below? Sorry about the "jive-quote" thing below, got that after i added code tags.
SQL > show lines
linesize 80
SQL > show pages
pagesize 14
SQL > set null <<>>
SQL > select null from dual;
N
<
<
>
>
SQL > set serveroutput on
SQL > declare
2 v_Val VARCHAR2(100) :='COCOJUMBO';
3 BEGIN
4 SELECT null INTO v_val from dual ;
5 DBMS_output.put_line(v_val);
6 EXCEPTION
7 WHEN NO_DATA_FOUND THEN
8 dbms_output.put_line('Exception:'||SQLERRM);
9 END;
10 /
PL/SQL procedure successfully completed.
SQL >user872043 wrote:
DB Version: 10.2.0.4
Question1.
Won't SET NULL work with PL/SQL block?No. SET NULL is a SQL*Plus command, not a PL/SQL command.
Question2.
Why is <<>> appearing in several lines (one character per line) as shown below? Sorry about the "jive-quote" thing below, got that after i added code tags.That's due to default formatting. For example:
SQL> SET NULL <<>>
SQL> SELECT NULL FROM DUAL;
N
<
<
>
>
SQL> COLUMN col FORMAT A4
SQL> SELECT NULL col FROM DUAL;
COL
<<>> -
Search options not working in SQL
Hi,
I have the Following SQL statement that filters for a Search
Criteria and it works fine in MySQL 4
SELECT *,MATCH (presentationID,presentationTitle,
PresentationName,ProductlineName,
LevelName,RoleName,presentationDescrip) AGAINST (SearchString IN
BOOLEAN MODE)
FROM tbpresentations
WHERE MATCH (presentationID,presentationTitle,
PresentationName,ProductlineName,LevelName,RoleName,presentationDescrip)
AGAINST (SearchString IN BOOLEAN MODE)
ORDER BY productfamilyName DESC
The SearchString Variable has the following parameters:
Name = SearchString
Type = Text
Default Value = -1
Run-time Value = $SearchStringSQL
updating to SQL 5 returns the error:
MM_ERROR: MySQL Error#: 1054 Unknown column 'SearchString' in
'field list'
Any ideas?
cheersThat did not work. I deleted the MM Files and the error still
returned.
Again, Functionality is unaffected which is completely
unusual for a coding environment.
I have no access to the recordset bindings, so I handcoded
the references instead, and it works fine.
I took the issue to our worldwide Web Developement
Department, as they are responsible for the Organisations Corporate
and ECommerce Sites and they had a look. (I look after the Training
Intranet)
They use Visual Studio for the sites and I gave them all the
code.
They ran a debugger and found nothing wrong with the code,
Which is why it runs fine.
After a few hours of testing and retesting and checking all
the lines of code (They get paid the big bucks) they concluded that
the error is caused by a bug in Dreamweaver CS3 unable to parse or
recognise changes to either MySQL Syntax or PHP 5.
Dreamweaver has added the $SearchString variable as a Table
Column in the Bindings for some daft reason based on the SQL
Statement, which is causing the error. It also added another Column
called 'Real', I have no idea where that was coming from. It also
added a third Table field tothe Recordset bindings called MATCH.
My Local testing Servers (3 of) all use WAMPserver 2 and
generate the same eror.
The live Intranet Server, which is a new Win2003 Dell Server,
uses IIS6 and also generates the same error when I "test" it
through CS3.
So, I dusted off a copy of Dreamweaver 8 installed it, and
guess what....no errors.
They said the immortal words that programmers never say: "
Ignore the error, it wont affect functionality".
Just thought I'd let you know.
cheers for the help. -
P/SQL Not Working in SQL Developer
The following P/SQL seems to work fine in SQL Plus but does not run in SQL Developer
insert /*+ append */ into upl_exclude_claims
(select /*+ ordered parallel(s,4) parallel(claim,4) */
/*+ use_hash(s,claim) no_index(claim, xbm_clm_recip) */
s.recip,
s.month_1st_day
from lrx.upl s,
mcd.fact claim;
Thanks911105 wrote:
The following P/SQL seems to work fine in SQL Plus but does not run in SQL Developer
insert /*+ append */ into upl_exclude_claims
(select /*+ ordered parallel(s,4) parallel(claim,4) */
/*+ use_hash(s,claim) no_index(claim, xbm_clm_recip) */
s.recip,
s.month_1st_day
from lrx.upl s,
mcd.fact claim;
ThanksWhat happens when you run it? Do you get an error or does nothing happen?
If you get an error post the message
Why didn't the first answer I did to this question post???
Maybe you are looking for
-
I just bought a MacBook. The first few times it worked when I used the instructional video from teh default MacPage. Now when I try to watch a instructional video I get the message that teh file didn't finish downloading and I ma unable to watch the
-
So I just got Apple TV in the mail today. I was all ready to see what it was all about before I realized that I didnt have the cords to make all the connections. I do have a HDTV with 1 extra HDMI port open. I also have ATT uverse. I heard there
-
Migrating from laptop to desktop
I bought a new desktop Windows 8.1 computer that I intend to use for photo-editing. I will need to load my CS5.1 and LR4 onto the new computer, as well as migrate all my photos from my Windows 7 laptop. I was wondering what other folders and files I
-
BDC is not working in back ground
Hi all, I have created bdc for F-51 but it is not working in back ground (mod N) and it is not showing any error in error tab , but it is working fine in mod A & E .I tried with mod P and using CTU_PARAMS but no use.. I have tested my recording i
-
Events are not pushing from iPhone to iCloud
New events created on iPhone calendar NOT pushing to iCloud Calendar (web app), nor to iCal on my Mac event was created about 6 hours ago, still not pushed. Events created in iCal on my Mac ARE pushed to iCloud (visible on web app) and to iPhone in a