Hello!
I have an INSERT that I'm trying to write that I could use some input on from experts...
I run this function:
And, as an example, it returns the following:
Record1
LocId: 159937
LocClientID: 153
ClientName: MyClient
L6: NULL
L5: NULL
L4: NULL
L3: Center
L2: 1st Floor
L1: Level 01
configuredUses: NULL
validConfigured: INVALID
currentUses: NULL
validCurrent: INVALID
confUseType: NULL
currentUseType: NULL
Record2
LocId: 159938
LocClientID: 153
ClientName: MyClient
L6: NULL
L5: NULL
L4: NULL
L3: Center
L2: 1st Floor
L1: Level 01
configuredUses: NULL
validConfigured: INVALID
currentUses: NULL
validCurrent: INVALID
confUseType: NULL
currentUseType: NULL
Now, I want to do an INSERT into another table for these records.
bmkAssignments table columns:
baID
baClientID
baPDID
baLocID
baConfiguredUse
baCurrentUse
baCurrentCapacity
baRefurnCapacity
baSupportCapacity
So, into the bmkAssignment table I want to make the following inserts/values:
baID: autogenerated, don't need to worry about
baClientID: 153 (static in this example & is also returned from function - 'LocClientID: 153')
baPDID: 16
baLocID: <value returned from function - LocId: 159937/159938>
baConfiguredUse: 208
baCurrentUse: 208
baCurrentCapacity: 0
baRefurnCapacity: 0
baSupportCapacity: 0
Obviously, I know how to do the 'static' numbers (baPDID, baConfiguredUses, etc); I'm just not sure on how to get the baLocID = to the LocID from the function....
Thanks in advance for your time and help once again!
-jiggyg
I have an INSERT that I'm trying to write that I could use some input on from experts...
I run this function:
Code:
select *
from getInvalidBmkAssignments(153)
And, as an example, it returns the following:
Record1
LocId: 159937
LocClientID: 153
ClientName: MyClient
L6: NULL
L5: NULL
L4: NULL
L3: Center
L2: 1st Floor
L1: Level 01
configuredUses: NULL
validConfigured: INVALID
currentUses: NULL
validCurrent: INVALID
confUseType: NULL
currentUseType: NULL
Record2
LocId: 159938
LocClientID: 153
ClientName: MyClient
L6: NULL
L5: NULL
L4: NULL
L3: Center
L2: 1st Floor
L1: Level 01
configuredUses: NULL
validConfigured: INVALID
currentUses: NULL
validCurrent: INVALID
confUseType: NULL
currentUseType: NULL
Now, I want to do an INSERT into another table for these records.
bmkAssignments table columns:
baID
baClientID
baPDID
baLocID
baConfiguredUse
baCurrentUse
baCurrentCapacity
baRefurnCapacity
baSupportCapacity
So, into the bmkAssignment table I want to make the following inserts/values:
baID: autogenerated, don't need to worry about
baClientID: 153 (static in this example & is also returned from function - 'LocClientID: 153')
baPDID: 16
baLocID: <value returned from function - LocId: 159937/159938>
baConfiguredUse: 208
baCurrentUse: 208
baCurrentCapacity: 0
baRefurnCapacity: 0
baSupportCapacity: 0
Obviously, I know how to do the 'static' numbers (baPDID, baConfiguredUses, etc); I'm just not sure on how to get the baLocID = to the LocID from the function....
Code:
INSERT INTO bmkAssignments (baClientID, baPDID, baLocID, baConfiguredUse, baCurrentUse, baCurrentCapacity, baRefurnCapacity, baSupportCapacity)
VALUES ('153', '16', ????, '208', '208', '0', '0', '0')
Thanks in advance for your time and help once again!
-jiggyg