I have a small vbscript to load data and process it using sqlldr and sqlplus. I have 2 questions about sqlplus usage though: 1) Can I exec a stored procedure without using an .sql script file? e.g. sqlplus user/pass@server @exec proc_myname 2) Can I use .sql script files on a shared UNC path? e.g. sqlplus use…
How to replace first and last character of column in sql server?
I have a database column and its give a string like ,Recovery, Pump Exchange,. I want remove first and last comma from string. Expected Result : Recovery, Pump Exchange. Answer You can use SUBSTRING for that: Obviously, an even better approach would be not to put leading and trailing commas there in the first…
how to generate OTP and send the password to mobile via sms
I am doing a project of using OTP for the login of the websites, I have created a button named “Generate” once clicked it will create an OTP and send an SMS via HTTP gateway, then it stores the …
Mysql issue with WHERE in clause
What is wrong with my “where in” clause in mysql? My two tables SEATS and REGISTERS look like this The query to fetch the matching results is Can someone figure out what’s wrong ? Thanks, Answer IN requires the list to be a literal list, not a comma-delimited string. Use FIND_IN_SET for that…
Cannot create a table due to naming conflict
I am trying to create a table in my database and it gives me the following error. Then I thought that the table must exist so I ran the following query: But could not find anything. Then I tried: Any idea how to sort this? i am tying to rename the type by and getting the error. Answer Postgres creates
Insert Checkbox value to Database
so im trying to store values from a checkbox into my database It works if I use a normal Textbox but as soon as I attempt it with a checkbox it doesnt work any idea? I want to have two for example …
SQL SERVER Insert Addition?
So this seems like something that should be easy. But say I had an insert: and I wanted X to go from 1-100. (Knowing there are some of those numbers that already exist, so if the insert fails I want it to keep going) how would I do such a thing? Answer Here’s a slightly faster way
sql distinct selection avg aggregate
here is my table schema SessionID and relevancy is not unique i want to remove urlid duplicates and have an avg of relevancy values corresponding of each unique urlid. this is my code select …
How to find schema name in Oracle ? when you are connected in sql session using read only user
I am connected to a oracle database with a read only user and i used service name while Setting up connection in sql developer hence i dont know SID ( schema ). How can i find out schema name which i am connected to ? I am looking for this because i want to generate ER diagram and in that
SQL query to get the Sum of all column values in the last row in access table
I have a table like below. I want to sum parts column and write the total after the last record. how to specify total and the result in SQL query. Answer Try this query