I have multiple SQL queries that look similar where one uses JOIN and another LEFT OUTER JOIN. I played around with SQL and found that it the same results are returned. The codebase uses JOIN and LEFT OUTER JOIN interchangeably. While LEFT JOIN seems to be interchangeable with LEFT OUTER JOIN, I cannot I cann…
React Form won’t save date
I’ve created a basic form in React to save a name, category, and date if available to an SQL table. My form is acting fine – it’s submitting correctly and saving the new entries. The problem is, while it saves the name and the category fine, if you choose a date (using the HTML date picker) …
Why do I get this Error: ORA-00932: inconsistent datatypes: expected – got –
I am trying to cast a number to a varchar with the CAST function in order to be able to concatenate inside dbms_output.put_line(). Please note that you need to be able to understand collection types …
Making a table with a foreign key
I’m creating a SQL database in Oracle. I have created this table: And I tried creating a second table that has a foreign key referencing it: I get this error: ORA-00904: “LID”: invalid identifier 00904. 00000 – “%s: invalid identifier” Answer Defining a foreign key on a col…
How do I properly input an sql where clause in VBA?
The where clause in the code below is throwing me an error. I just can’t seem to get the syntax right. Answer The values of the variables need to be added to the SQL, not their names, and the values need to be in an appropriate format. The following code will add the dates in yyyy-mm-dd format.
Swift not passing variables to PHP Web Service to query my SQL database
I have a PHP Web Service that can insert a new row to my database if I hardcode the values in to the SQL query directly. But when I try to do this using variables passed to the PHP script from my Swift function it breaks down. I have add print statements to my Swift so I am confident that
Insert only few columns from exec (SQL) when column name is not fixed
I have the below code: IF OBJECT_ID(N’tempdb..#VALS’) IS NOT NULL BEGIN DROP TABLE #VALS END IF OBJECT_ID(N’tempdb..#Tbl_Eval_Temp’) IS NOT NULL BEGIN DROP TABLE #Tbl_Eval_Temp END IF exists (select …
Want the count how many times row changes from -1 to 1 or vice-versa in SQL Server
SQL query to display the count, how many times row changes from -1 to 1 or vice-versa in SQL Server in a table. Let the table name be A Answer For this question to have an answer, you need a column that specifies the ordering. SQL tables represent unordered (multi)sets. There is no inherent ordering. To answe…
Set oracle standard data type for varchar2 from BYTE to CHAR
Data type varchar2 can be stored as BYTE or CHAR. If in DDL it’s not defined as which, it create automatically as BYTE. This can cause problems since some characters are bigger than one byte. So …
Is It A Good Idea or A Huge Mistake to Combine More Than 1 Type of Data Into A Single Column in An SQL Database Table? [closed]
So, let’s say I have 5 items, A, B, C, D and E. Item A comes in sizes 1 and 2, item B comes in sizes 2 and 3, C comes in 1 and 3, D comes in 1 and E comes in 3. Now, I am considering 2 table options, …