What does pub.package mean - sql

I have a dynamic SQL select statement that selects various fields from something named pub.package.customer.
I have never seen this before and I don't what it means or where it is getting the data from. If anyone has seen this or something similar before you knowledge would be greatly appreciated.

pub.package.customer
pub is database name
package is schema name
customer is table name
The full path of object is dot delimited name
Servername.Databasename.Ownername.Objectname
Here your object is customer table from which various fields are being used in your dynamic sql query.

Related

What does the from content of this query mean?

I am learning SQL now, I would like to know what is meant within the from, what is contained before and after the dot.
For example:
SELECT *
FROM apler.W_WORKED_INVOICES wwi
What does apler stand for?
The W_WORKED_INVOICES is the table, correct?
appler is database schema. Schema is defined in the Oracle documentation as a collection of logical data structures or schema objects.
W_WORKED_INVOICES is a table created in the appler schema

Create an SQL query to find all tables in the whole Redshift database containing a specific text string (data)

using, Tableau or Aginity I am trying to find all the Tables in Redshift Database that contain the string of word "Certified Service".
Look online and so very long codes, as I am new to SQL I couldn't see what to replace in the code to adapt it to my query, and most codes seems to give me the error "Syntax error".
I'm sorry for the repeated question, although most answers on here seem to be a few years old so not sure if anything as changed.
Again I'm very new to SQL
Thanks in advance
Try using following query to list all the table in Redshift, containing a specific text string
SELECT DISTINCT tablename FROM pg_table_def WHERE schemaname = 'public' and tablename ilike '%certified service%';
In case you want to search tbales with another sub-string, Replace certified services with your custom string and you'll get a list of all tables whose name contain that sub-string.

MS Access SQL How to put a table name as Variable (how to run one query for multiple tables)

Lets say I have a query like this:
Parameters Table_Name string, Field_Name string;
Update Table_Name Set Table_Name.[field1] = "new value", Table_Name.[field2] = "new Value" Where Table_Name.[Field_Name] = "Some value"
Basically I have the same query which I need to run against different tables which share some fields together. I want to be able to type the table name when I run the query.
I know this can be achieved with VBA, but this way would be a lot easier than VBA. Although VBA is also welcome but I would like to be able to do this in pure SQL.
How to achieve the above logic for table names AND field names?
Is this being done in MSAccess or in SQL Server? If you've got a SQL Server behind things, then you'll be looking to do some sp_executesql calls to get the job done. If you're doing this in MSAccess, you can accomplish the same by building dynamic SQL statements in VBA - either way would work if you've got Access pointing to SQL, though.

How can I stop my SQL from returning empty data results?

I usually use Toad to manipulate my Oracle databases, but I even tried SQL manager for this one and it still would not work. I have a table with a few hundred records, and even running a simple
SELECT * FROM customer
will not work. There are no errors, and the data grid that displays pulls all the correct field column names but there are no records shown. What could be causing this?
Does your login schema own the table? If not, verify that any synonym is actually pointing to the object that you think it is. Preface the table name with its owning schema to rule out any conflicts.

Create delimited string from a row in stored procedure with unknown number of elements

Using SQL Server 2000 and Microsoft SQL Server MS is there a way to create a delimited string based upon an unknown number of columns per row?
I'm pulling one row at a time from different tables and am going to store them in a column in another table.
A simple SQL query can't do anything like that. You need to specify the fields you are concatenating.
The only method that I'm aware of is to dynamincally build a query for each table.
I don't recall the structure of MSSQL2000, so I won't try to give an exact example, maybe someone else can. But there -are- system tables that contain table defintions. By parsing the contents of those system tables you can dynamically build the necessary query for each source data table.
TSQLthat writes TSQL, however, can be a bit tricky to debug and maintain :) So be careful how you structure everything...
Dems.
EDIT:
Or just do it in your client application.