multiple jid with same account or rename jid - ejabberd

Hi I am working on requirement where I am using ejabbered and want to implement afunctionality in which
1: I want to rename the jid from 'test#xmpp.com' to 'phonenumebr#xmpp.com'
OR
2: Multiple jids associated to same account , ex('test#xmpp.com' and 'phonenumebr#xmpp.com')

1: I want to rename the jid from 'test#xmpp.com' to 'phonenumebr#xmpp.com'
Right now nothing like that is implemented, as far as I know. If you use SQL storage, it wouldn't be much difficult for you to write some SQL code that traverses the corresponding database tables and replaces one JID with the other.
Of course, the contacts of those renamed accounts should logout and login to see the roster changes.
Relevant tables: users, last, rosterusers, rostergroups, spool, archive, archive_prefs, vcard, ...
2: Multiple jids associated to same account , ex('test#xmpp.com' and 'phonenumebr#xmpp.com')
Something like that is not implemented at all.

Related

MS-Access Looking up and updating records based on values in form

I've learned a lot in Access over the last month or so but am now have trouble resolving an issue that I don't know how to approach. I'm sure there's a simple solution but I need help being pointed in the right direction. Here's the background:
This problem deals with three forms:
frmProject - Lists project details it has a
subfrmMilestones - Milestone details
frmProjMsgBox - Collects info to pass to Project table
I have it set that when I click OK on ProjectMsgBox it passes the information to the Project form and starts the creation of a new record.
tblProject stores all details related to projects
tblMilestones stores all details on milestones, contains key for tblProject
tblMilestones_Inf stores a list of common milestones based on project type, has key for tblProjectType, which is on tblProject
My Problem -
When I click okay on the ProjectMsgBox form, I would like it to also look up milestones from tblMilestones_Inf and insert into tblMilestones. I also need to assign the Project_ID that on the form to the creates. What is the best way to go about this?
I've tried a few things in VBA but haven't had success. I can create a query that pulls the milestones in but don't know how to update the milestone table with the relationship to the project table.
I can provide more details but wasn't sure what is helpful and what is not. I'm more or less looking for a resource (or keywords to search) so I can figure this out on my own
Thank you!
UPDATE:
tblProject has 1 to many relationship with tblMilestones
tblProjectType has 1 to many relationship with tblMilestones_Inf
Once I hit okay on the frmProjMsgBox it fills out text boxes that have controls on frmProject to create the parent record (i think that's the term) in tblProject. This works well. I would like access to go out to the tblMilestones_Inf and match the project type (child record?). It would then add 4-5 records based on matching ProjectType on the Milestone_Inf table. I don't want code, but maybe actions/keywords to lookup so I can figure this out on my own. I'll post some of my code later that tries to achieve this.
You might want to look into Query Defs, you can use those to change the SQL statement of your queries from VBA. So if you have something like:
MyQryDef.SQL = "SELECT * FROM MyTable WHERE MyIndex = " & MyControl.Value & ";"
and your control value is set to 5, you then use the execute statement and your Query SQL will then read:
SELECT * FROM MyTable WHERE MyIndex = 5;
There's a few more lines you will have to look up to make this work, but this is a very basic example.

How do I add custom records into a query containing a linked table?

I have a linked table that contains descriptive information of restaurants such as name, address, city, etc.
tbl_Restaurant
REST_SITE_CD (PK)
Restaurant
Address
City
…
I have created a query based off of this linked table and a different table that hosts auditing information.
tbl_Audit
AuditID (PK)
REST_ID (FK)
Date
…
From this query, a form was created to allow the user to easily choose a restaurant by its name and location, and enter in the necessary auditing information.
However, some audited restaurants are not located inside tbl_Restaurants. I would like to manually enter these locations into the query, but the query does not allow me to enter new addresses that do not match an existing primary key in tbl_Restaurant.
The only solution I can think of is to create a redundant table just for unlisted restaurants and combine it with the query later on via a union query or something like that. However, I’m sure this violations a bunch of normalization principles. Additionally, it would be ideal if the custom locations are only reflected upon the query and not the linked table, if that makes any sense.
Any help would be appreciated! Please let me know if there’s any other information I can provide.
Records need to be stored in a table.
You can use a local table, and use a UNION ALL to add the records from your local table to the query. However, you can't enter them directly in the query, since union queries are not updateable. You need to add them to the table.

Update a NULL column that was added

I'm not a coder, but from time to time I have to interact with out client database. The company I work for does online education. The problem is that we have two SQL databases
Client_personal
client_educational
Client personal keeps all of the name, email, address, phone type of information. Client educational keeps track of what classes they have purchased. I need to take the information from client educational and tag the client personal information in our CRM. The problem is that the the two databases only have one common field "client id" and my CRM only allows me to search for duplicates by client name. So basically I need to add the client name column to my client educational database. I've added it, but it just says null. Anybody have any advise?
Your question is a little vague but assuming:
They're on the same machine
The table is called clients in both databases
The "client name" field is called clientName in both databases
The "client id" field is called clientID in both databases
You want to copy the data from one table into the other as a one off
You can use a user account with access to both databases
As always please don't run this on your real data. Try a mock first.
something like:
UPDATE client_educational.clients
SET client_educational.clients.clientName = Client_personal.clients.clientName
FROM client_educational.clients
INNER JOIN Client_personal.clients
ON client_educational.clients.clientID = Client_personal.clients.clientID
If you don't actually want to copy data as a one off, you should create a view or use join statements instead.

How can I replace a field with a similar result in MySQL

Unfortunately, I have to deal with a lot of user submitted data, text fields rather than option boxes. I have imported it into my MySQL database as strings. I do all this to be able to run statistics quickly on the data like top 10 most common companies. The problem I have run into is that some of the rows have slightly different names for the same companies. For example:
Brasfield & Gorrie, LLC VS Brasfield and Gorrie
Britt Peters and Associates VS Britt, Peters & Associates Inc.
Is there some fairly straightforward MySQL command or external tool that will allow me to go through and combine these sort of rows. I know how to use REPLACE(), but I don't think it has the power to do this simply. Correct me if I'm wrong!
Taking this example:
Brasfield & Gorrie, LLC VS Brasfield and Gorrie
Assuming that I want to keep the first one, I would find all records that have the ID of the second one and update them to use the first, assuming that this table that has these titles also has an ID field for each one.
You would create a page in PHP that will allow you to administer this with mouse clicks, but it will require regular pruning since you allow users to enter this data. For future entries, you can try to apply the Levenshtein Distance and try to provide a suggestion based on available similar matches so that you can help guide the users to something that already exists rather than a new db entry.

How to change the values of two table automatically (MySQL)?

I have a database with two tables. The first one contains the user_name, user_password, user_email. The second one contains the user_name, user_age, user_description.
When a person finds the user he needs by the user_name, the script looks through the database using the user_name, to give out the information about certain user.
But if the person changes his user_name via preferences, the value changes only in the first table.
Question:
1) Is there a way to make the user_name in the second table change automatically? (To connect them some how)
I am using MySQL (phpMyAdmin).
This is just a simple example. In "real world" I am trying to manage more serious applications that have more tables. Is there an easier way than to create a separate php query for each table?
You could always create an AFTER UPDATE MySQL trigger targeting single rows for this. See the manual. It's probably not easier than using separate PHP queries for the tables, though. You don't need to spell them all out, just map up what needs to be synchronized when, and abstract your code.
However I'd recommend that you use a unique ID field for the user and only store the username in one of the tables -- and refer to the user with the ID under the hood of your code, and in both tables. Not a good idea to use something changeable as a unique identifier in your database design.