I have been stuck trying to fix this error for a while and I cannot figure it out. I have researched this error code and the problem is I am trying to store a number/char that cannot fit into a variable. Everything looks fine within my code and I cannot find the problem. Here is the Student table information:…
Tag: oracle
How to upload a flat file without using SQL*loader and external table in oracle database?
Can anyone let me know how to upload a flat-file without using SQL*loader or external table in oracle database? Like is there any function available in oracle to complete this task? Please let me …
How to queue up calls to stored procedures in Oracle?
I have a stored procedure in oracle (which schedules a one-time job to run another procedure, if this is relevant). The job calls another stored procedure which runs for a few minutes, and performs inserts updates and deletes and also uses loops. Now while the long procedure is running, if there is another ca…
how to resolve error while using grant admin option in execute immediate
I am trying to run the below script. My script works fine without ‘ WITH ADMIN OPTION’ in EXECUTE IMMEDIATE. But when using ‘ WITH ADMIN OPTION’ i get below error. “Error report – ORA-00900: …
How to make WHERE clause case insensitive in oracle sql database?
I need to fetch both “red” and “RED”. For example: I need to use both upper and lower in same statement. How can I do this? Answer You could use case insensitive parameter at session ‘NLS_SORT=BINARY_CI’. There are two parameters at session level: NLS_COMP NLS_SORT Let̵…
SQL: finding duplicates that do not have a success message
I am struggling to return all batch_id’s that do not contain a corresponding “PASS” From the above table, i need an sql statement that only returns batch_id 104 because it never had a status of “PASS” The database is an oracle DB, therefore if its is not possible with a simple se…
Count the length of Chinese character in sql
I have a string that includes Chinese characters in it. I want to calculate the length of the string but I want to count 1 Chinese character equals to 3 characters. Here are the strings and how I am …
behavior of sql query with OFFSET and fetch clause in postgres/oracle with deletion of records
I have a query like : select * from mytable order by mycol_1 OFFSET 0 ROWS FETCH FIRST 10 ROWS ONLY; Now, if in this iteration ,I delete several records out of the 10 records fetched by above query …
Oracle SQL Roll up function or alternatives
First, I am finding an average of some data, and then formatting that average into to decimal points. And in the end, I want to use rollup to generate a total row for all columns. The problem is: I want the rollup to sum the data as they appear, however, when adding up the average it is not adding them
SQL Query to group by month and display individual month sum for a record
I’m trying to sum product codes with a particular description as total products sold in a month over the years. The two table used are: The date format is in ‘DD-MON-YYYY HH12:MI PM’. So far I’m able to formulate this: How do I separate the count as different month columns and get the …