Skip to content

Tag: oracle

TO_CHAR failing to set specific format in update

I’m trying to set a specific field in a record where the legacy code has used a DDMM format DATETIME as a char. I want to be able to find one specific value that matches something and basically change that one field. Super simple stuff, right? I know for a fact that if I query using to_char(SOME_DATETIM…

MERGE table, do nothing when matched

I have a table DOMAINS in 2 different schemas with columns ID, NAME,CODE,DESCRIPTION. For any NAME exist in new schema, it should use existing ID without any merge; for those new NAME records, it should insert with ID from old schema. How can i intepret the portion of do nothing in above query? Answer For you…

Oracle parameterized update query c#

It should work but it doesn’t. I have referred others but couldn’t find the reason. Thanks in advance. Joon Answer I found why it didn’t update table. To make it work I added parameters in the order of the query parameter and found it works. But I still do not understand why the order of add…

SQL Query Confused

Display: account no. customer id initial amount in terms of lakhs (rounded off to 2 decimals) [change the column heading to ‘INITIALAMTIN_LAKHS’] amount category(amt < 50000 show as 'Low', amt > …

Oracle PL/SQL Functions: “Invalid Datatype”

The following function checks to see if a zip code is present in a table called ZIPCODE: The schema for the ZIPCODE table is as follows: To test this function, I issued the following statement which should return false as the zip code passed as an argument is present in the ZIPCODE table: However, I receive t…