Concat function is not working – invalid number of arguments

SELECT CONCAT(Name,”(“,SUBSTR(Occupation,1,1),”)”) FROM OCCUPATIONS; First, the double quotes ” are used to enclose identifiers. use single quote ‘ to wrap a string. Second, CONCAT accepts two params. You could nest bunch of concats, but it’s easier and cleaner to use concatenation operation ||: SELECT Name || ‘(‘ || SUBSTR(Occupation,1,1) || ‘)’ FROM OCCUPATIONS;

“column not allowed here” error in INSERT statement

You’re missing quotes around the first value, it should be INSERT INTO LOCATION VALUES(‘PQ95VM’, ‘HAPPY_STREET’, ‘FRANCE’); Incidentally, you’d be well-advised to specify the column names explicitly in the INSERT, for reasons of readability, maintainability and robustness, i.e. INSERT INTO LOCATION (POSTCODE, STREET_NAME, CITY) VALUES (‘PQ95VM’, ‘HAPPY_STREET’, ‘FRANCE’);

Oracle ‘Partition By’ and ‘Row_Number’ keyword

PARTITION BY segregate sets, this enables you to be able to work(ROW_NUMBER(),COUNT(),SUM(),etc) on related set independently. In your query, the related set comprised of rows with similar cdt.country_code, cdt.account, cdt.currency. When you partition on those columns and you apply ROW_NUMBER on them. Those other columns on those combination/set will receive sequential number from ROW_NUMBER But … Read more

How to view an image from blob column in Oracle with JasperReports?

Without seeing how you’re calling the blob to embed the image within your report code… Use blob.getBinaryStream(). Convert the stream using javax.imageio.ImageIO.read( InputStream ). For example: javax.imageio.ImageIO.read( blob.getBinaryStream() ) This will return an instance of BufferedImage, which subclasses java.awt.Image, and should be a suitable object to embed in the report. The blob variable shown in … Read more

return resultset from function

If you need a result set and a ref cursor won’t do with a datatype called sys.anydataset. i.e what you seem to want is a pipelined function, but of course with a regular pipelined function you need to define the output structure, which in your case isn’t static. Enter anydataset. this type allows us to … Read more