Skip to content
Advertisement

Tag: firebird

SQL execute block using update

I am trying to perform an execute block using an update. However I am getting an error. The SQL shown here is similar to the real problem, but the update is much more complex. I need to use every declared cust_id into the update block. How can I accomplish that? Answer you cannot use do begin after our update statement

How to cast varchar on update?

When I update t1 then “VALUE” field should increment but this field is set to VARCHAR and I would cast it to INTEGER: Answer You will need to cast “VALUE” to an integer to be able to increment it, so: Firebird will automatically convert the INTEGER back to a VARCHAR on assignment. See this dbfiddle. That said, the proper way

SQL replace and calculate character length and replace again

I want to do an update on a Firebird table. So far not a problem: Before the update statement my params look like this: After my update the params look like this: So far it’s ok. But the frontend program can not handle this because there is a checksum in the params. The value s:91 is the character length from

Select closest maximal numeric value in Firebird

Imagine there’re 2 tables, let’s call them “Master” and “Detail”: There’re 2 input parameters: list of Master IDs (master_id_list) and numeric value (num_value). For every ID in master_id_list I should get one Detail record: If num_value < MIN( f_value ), it should be the record with MIN( f_value ) If num_value > MAX( f_value ), it should be the record

Count double occurrences in order list

I have a list of orders, I need to find which ones occur with code 47 more than once with different users. For example: The expected result is 111 and 333. How can I accomplish this? Regards Answer I think you want aggregation and having: You can also express the having as:

SQL check whether current date is monday

I am trying to create a SQL statement in where clause so when the current date is a Monday, it returns Friday results, but if it is any other weekday, it returns yesterday as the result. Something …

Cannot create new procedure in SQL manager lite

I am working with SQL manager lite for Interbase/Firebird application. I have downloaded firebird database, successfully connected to that database and its host, but now I want to create procedure. I couldn’t done it via tutorials, so I decided to just click New->Procedure and do that automatically. But doing this way I still have errors. My code what I have

Advertisement