Link to home
Start Free TrialLog in
Avatar of thenrich
thenrich

asked on

Modify SQL

Who can I modify the following SQL and add a parameter to modify the internalprops field so it's not copied directly?

SQL = "INSERT INTO cto_objects  " & _
            "       ( project,iobjname,objname, " & _
            "         objtype,status,path," & _
            "         description,filename,objpath, " & _
            "         internalprops,externalprops,ctoprops ) " & _
            "   SELECT '000000',:newname ,:newExtName, " & _
            "          objtype, status,:newname ||'.IKM', " & _
            "          description,filename,objpath, " & _
            "          internalprops,externalprops,ctoprops " & _
            "    FROM cto_objects " & _
            "    WHERE ( cto_objects.project = :project ) AND " & _
            "          ( cto_objects.iobjname = :iobjname ) "

thx
TOM
Avatar of thenrich
thenrich

ASKER

Found the solution myself:

SQL = "INSERT INTO cto_objects  " & _
                       "       ( project,iobjname,objname, " & _
                       "         objtype,status,path," & _
                       "         description,filename,objpath, " & _
                       "         internalprops,externalprops,ctoprops ) " & _
                       "   SELECT '000000',:newname ,:newExtName, " & _
                       "          objtype, status,:newname ||'.IKM', " & _
                       "          description,filename,objpath, " & _
                       "          replace(internalprops,'|' || :o_seq ||';','|' || :n_seq || ';'),externalprops,ctoprops " & _
                       "    FROM cto_objects " & _
                       "    WHERE ( cto_objects.project = :project ) AND " & _
                       "          ( cto_objects.iobjname = :iobjname ) "

Going to ask for this question to be deleted.
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial