SQLTeam.com | Weblogs | Forums

Query to CREATE and INSERT data


#1

Hi

I have the following query which returns the GroupID, GroupName, UserID, UserName and UserEnabled results.

select
GR.GROUPID as GroupID,
GR.FULLNAME as GroupName,
DU.USERID as UserID,
DU.FULLNAME as UserName,
DU.LOGIN as UserEnabled
from mhgroup.GROUPMEMS GM
join mhgroup.GROUPS GR on GR.GROUPNUM=GM.GROUPNUM
join mhgroup.docusers DU on DU.USERNUM=GM.USERNUM
where GR.GROUPID in ('1407 - SLR Users')
order by GROUPID

I need to modify this QUERY into 1 or 2 queries to :

Insert a new GroupID called ' 1405 - SLR Users' ; and

then insert new values into the UserID column for this new group.

Thanks in advance


#2

You want to create a new record in [GROUPS] table with that GroupID? or just add that as an additional, or alternative?, criteria in your query?

Looks look Autonomy / iManage document management system, and as such personally I wouldn't want to insert data into tables direct - ditto for the [docusers] table. Pretty sure there is an API available which will do this (i.e. some sort of Queue that you can put "Create user XXX" tasks into)


#3

Hi Kristen,

Yes correct autonomy/imanage system. Yes there is an API, which I use to create groups, however was wondering if there was a quicker way to insert users as sometimes there are hundreds of users to insert.

I've now done this job all through the API,added group and inserted about 100 users manually.

Thanks