strongloop / strong-oracle

Deprecated: Node.js Driver for Oracle databases (Use https://github.com/oracle/node-oracledb instead)
Other
45 stars 18 forks source link

JSON is cut after call store procedure. #46

Open jgauna opened 8 years ago

jgauna commented 8 years ago

I'm working with a store procedure which returns JSON. Calling it with Sqldeveloper works great but using:

var sqlGetQuestions = 'call WEBAPPPORTALPM.pk_portal_n.preguntas_registro(:1, :2)',
            questionsAndAnswers = new oracle.OutParam(oracle.OCCISTRING);
        dataSource.connector.execute(sqlGetQuestions, [credential,
            questionsAndAnswers
        ], function(err, response) {
            // We use an internal callback to chain stores procedures. @TODO: Use promises instead callbacks.
            utils.streamResponseInternal({
                err: err,
                response: response
            }, internalCb);
        });

returns:

{ updateCount: 0,
  returnParam: '{"questions":[{"title"   :"Indique el número de integrantes de su grupo familiar, incluido usted","options" :["3","7","2","1","Ninguno de éstos"],"correct" :4},{"title"   :"Indique el día de su cum' }

Where an ok json should be:

{"questions":[{"title"   :"Indique el número de integrantes de su grupo familiar, incluido usted","options" :["8","1","4","9","Ninguno de éstos"],"correct" :2},{"title"   :"Indique el día de su cumpleaños","options" :["16 de Agosto","13 de Junio","25 de Septiembre","18 de Junio","Ninguno de éstos"],"correct" :3},{"title"   :"Indique el nombre de un familiar de su grupo","options" :["Marvin","Vivian","Alexia","Sook","Ninguno de éstos"],"correct" :5},{"title"   :"Indique el número de su domicilio","options" :["7717","4039","2140","1576","Ninguno de éstos"],"correct" :2}]}

Any clue on this ?

raymondfeng commented 8 years ago

Are you getting the 1st record from the result set?

jgauna commented 8 years ago

I'm getting the first object from the array and part of the second but not the complete json.

jgauna commented 8 years ago

Any news on this? Sorry to bother.

raymondfeng commented 8 years ago

Can you share your stored procedure?